XslCompiledTransform 클래스
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
XSLT 스타일시트를 사용하여 XML 데이터를 변환합니다.
public ref class XslCompiledTransform sealed
[System.Diagnostics.CodeAnalysis.RequiresDynamicCode("XslCompiledTransform requires dynamic code because it generates IL at runtime.")]
public sealed class XslCompiledTransform
public sealed class XslCompiledTransform
[<System.Diagnostics.CodeAnalysis.RequiresDynamicCode("XslCompiledTransform requires dynamic code because it generates IL at runtime.")>]
type XslCompiledTransform = class
type XslCompiledTransform = class
Public NotInheritable Class XslCompiledTransform
- 상속
-
XslCompiledTransform
- 특성
예제
다음 예제에서는 변환을 실행하고 파일에 출력합니다.
// Load the style sheet.
XslCompiledTransform xslt = new XslCompiledTransform();
xslt.Load("output.xsl");
// Execute the transform and output the results to a file.
xslt.Transform("books.xml", "books.html");
' Load the style sheet.
Dim xslt As New XslCompiledTransform()
xslt.Load("output.xsl")
' Execute the transform and output the results to a file.
xslt.Transform("books.xml", "books.html")
샘플에서는 다음 두 개의 입력 파일을 사용합니다.
<?xml version='1.0'?>
<!-- This file represents a fragment of a book store inventory database -->
<bookstore>
<book genre="autobiography" publicationdate="1981" ISBN="1-861003-11-0">
<title>The Autobiography of Benjamin Franklin</title>
<author>
<first-name>Benjamin</first-name>
<last-name>Franklin</last-name>
</author>
<price>8.99</price>
</book>
<book genre="novel" publicationdate="1967" ISBN="0-201-63361-2">
<title>The Confidence Man</title>
<author>
<first-name>Herman</first-name>
<last-name>Melville</last-name>
</author>
<price>11.99</price>
</book>
<book genre="philosophy" publicationdate="1991" ISBN="1-861001-57-6">
<title>The Gorgias</title>
<author>
<name>Plato</name>
</author>
<price>9.99</price>
</book>
</bookstore>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:template match="bookstore">
<HTML>
<BODY>
<TABLE BORDER="2">
<TR>
<TD>ISBN</TD>
<TD>Title</TD>
<TD>Price</TD>
</TR>
<xsl:apply-templates select="book"/>
</TABLE>
</BODY>
</HTML>
</xsl:template>
<xsl:template match="book">
<TR>
<TD><xsl:value-of select="@ISBN"/></TD>
<TD><xsl:value-of select="title"/></TD>
<TD><xsl:value-of select="price"/></TD>
</TR>
</xsl:template>
</xsl:stylesheet>
설명
이 API에 대한 자세한 내용은 XslCompiledTransform에 대한 추가 API 비고를 참조하세요.
생성자
| Name | Description |
|---|---|
| XslCompiledTransform() |
XslCompiledTransform 클래스의 새 인스턴스를 초기화합니다. |
| XslCompiledTransform(Boolean) |
지정된 디버그 설정을 사용하여 클래스의 XslCompiledTransform 새 인스턴스를 초기화합니다. |
속성
| Name | Description |
|---|---|
| OutputSettings |
스타일시트 XmlWriterSettings 요소에서 |
| TemporaryFiles |
메서드를 TempFileCollection 성공적으로 호출 Load 한 후 디스크에서 생성된 임시 파일이 포함된 파일을 가져옵니다. |
메서드
적용 대상
스레드 보안
개체가 XslCompiledTransform 로드되면 스레드로부터 안전합니다. 즉, 메서드가 Load 성공적으로 완료된 Transform 후 여러 스레드에서 메서드를 동시에 호출할 수 있습니다.
메서드가 Load 다른 스레드에서 호출되는 동안 Transform 한 스레드 XslCompiledTransform 에서 메서드가 다시 호출되면 개체는 이전 상태를 계속 사용하여 호출 실행을 Transform 완료합니다. 메서드가 성공적으로 완료되면 새 상태가 사용됩니다 Load .
Load 메서드는 여러 스레드에서 동시에 호출할 때 스레드로부터 안전하지 않습니다.