File::XslTransform |
Description |
Uses
an Xsl stylesheet to perform an xsl transformation on an XML file. |
|
Options |
XML
input file |
The
XML file to transform. |
Conformance
level |
Setting |
Description |
Document |
Ensures that the XML
data conforms to the rules for a well-formed XML 1.0 document. This
level of checking ensures that any processor can consume the stream
being read as an well-formed XML 1.0 document.
The reader checks for the following:
- The top-level
item must not have any nodes other than XML Declaration, document
type definition (DTD), element, comment, white space, or processing
instruction.
- The XML data must
have exactly one top-level element node.
|
Fragment |
Ensures that the XML
data conforms to the rules for a well-formed XML 1.0 document fragment.
This setting accepts XML data with multiple root elements, or text
nodes at the top-level. This level of checking ensures that any
processor can consume the stream being read as an external parsed
entity.
|
Auto |
Specifies that the
reader should determine the level of conformance checking based on
the incoming data.
Document conformance checking is applied if the XML data contains
DTD information.
Fragment conformance checking is applied if the XML data contains
one of following:
- Text, CDATA, or
entity reference node at the root level.
- More than one
element at the root level.
- No element at
the root level.
An XmlException is thrown if there is a conflict, such as when
there is a text node and a DTD at the root level.
This setting can be used in wrapping scenarios when the Create
method is used to add additional features to an existing XmlReader.
In this case, ConformanceLevel.Document does not add any new conformance
|
|
DTD
processing |
Document type
definition (DTD) validation is implemented by using the validity constraints
defined in the W3C Extensible Markup Language (XML) 1.0 (fourth edition)
recommendation. DTDs use a formal grammar to describe the structure and
syntax of compliant XML documents; they specify the content and values allowed
for the XML document.
This property can have one of the following values:
- Parse to enable DTD
processing.
- Prohibit to throw an
XmlException exception when a DTD is encountered.
- Ignore to disable DTD
processing without warnings or exceptions
|
Xsl
stylesheet |
The
XSL stylesheet. |
Enable
support for embedded script blocks |
Enabled
or disable support for embedded script blocks. |
Enable
document function |
Enabled
or disable support for the XSLT document() function. |
Pre-proces
variables |
If
enabled, all user-defined variables that exist in the XSLT stylesheet will
first be interpreted before the stylesheet is used for the transformation. |
Output
File |
The
output file. |
Conformance
level |
Setting |
Description |
Document |
Ensures that the XML
output conforms to the rules for a well-formed XML 1.0 document and
can be processed by any conforming processor.
The document conformance checks include most of the fragment-level
checks and also ensure the following:
- The top-level
item doesn't have any nodes other than XML Declaration, DTD, element,
comment, white space, or processing instruction.
- The XML data has
one and only one top-level element node.
The XML writer doesn't
parse DTD information that is written. The user is responsible for
ensuring that the DTD is well-formed. |
Fragment |
Ensures that the XML
output conforms to the rules for a well-formed XML 1.0 document fragment.
This setting
accepts XML data that has multiple root elements or text nodes at
the top level. This level of checking ensures that any processor
can consume the stream being read as an XML 1.0 external parsed
entity.
DTD information isn't
allowed in document fragments. |
Auto |
Specifies that the
XML writer should determine the level of conformance checking based
on the incoming data. This setting can be useful when you don't know
whether the generated XML will be a well-formed XML document or a
fragment.
Document conformance checking is applied in the following cases:
- If the WriteStartDocument
method is called.
- If DTD information
is written.
Fragment conformance
checking is applied if the XML data contains one of these:
- Text, CDATA, or
EntityReference node at the root level.
- More than one
element at the root level.
- No element at
the root level.
An XmlException is
thrown if there is a conflict, such as when you try to write a text
node and a DTD at the root level.
If you are wrapping
another XmlWriter object, the outer object doesn't do any additional
conformance checking; this is left to the underlying object.
|
|
Encoding |
The
text-encoding of the outputfile. If set to "AUTO" the encoding
of the inputfile will be used. |
Newline
handling |
This
setting applies when writing text content or attribute values. Each of the
NewLineHandling values is described below:
- The Entitize setting
tells the XmlWriter to replace new line characters that would not be
otherwise preserved by a normalizing XmlReader with character entities.
This is useful in round-trip scenarios where the output is read by a
normalizing XmlReader. Additional normalization rules apply for attribute
values when round tripping since \t, \n and \r are replaced with a space
in attribute values when normalized in an XmlReader.
- The Replace setting
tells the XmlWriter to replace new line characters with \r\n, which
is the new line format used by the Microsoft Windows operating system.
This helps to ensure that the file can be correctly displayed by the
Notepad or Microsoft Word applications. This setting also replaces new
lines in attributes with character entities to preserve the characters.
This is the default value.
- The None setting tells
the XmlWriter to leave the input unchanged. This setting is used when
you not want any new-line processing. This is useful when the output
is read by an XmlReader that does not do any normalization (for example,
an XmlTextReader with default settings.)
|
Indent |
Enable
or disable whether to indent elements. |
Add
XML Declaration |
If
enabled, a standard XML-declaration will be automatically added to the beginning
of the outputfile. |