Class DocumentBuilder
Class DomDestination
Class DynamicContext
Class DynamicError
Class EmptyEnumerator
Class ExtensionFunctionCall
Class InvalidityHandlerWrapper
Class NamespaceConstant
Class NullDestination
Class Processor
Class QName
Class SchemaManager
Class SchemaValidator
Class Serializer
Class StandardLogger
Class StaticContext
Class StaticError
Class TextWriterDestination
Class XPathCompiler
Class XPathExecutable
Class XPathSelector
Class XQueryCompiler
Class XQueryEvaluator
Class XQueryExecutable
Class XdmAnyFunctionType
Class XdmAnyItemType
Class XdmAnyNodeType
Class XdmAtomicType
Class XdmAtomicValue
Class XdmDestination
- Class TreeProtector
Class XdmEmptySequence
Class XdmFunctionItem
Class XdmItem
Class XdmItemType
Class XdmNode
Class XdmNodeKind
Class XdmSequenceType
Class XdmValue
Class XmlDestination
Class Xslt30Transformer
Class XsltCompiler
Class XsltExecutable
- Class ParameterDetails
Class XsltPackage
Class XsltTransformer
Enum RecoveryPolicy
Enum SchemaValidationMode
Enum TreeModel
Enum WhitespacePolicy
Enum XdmAxis
Interface IInvalidityHandler
Interface IMessageListener
Interface IQueryResolver
Interface IResultDocumentHandler
Interface IXdmEnumerator
Interface IXmlLocation
Interface SchemaResolver
public class Serializer
A Serializer
takes a tree representation of XML and turns
it into lexical XML markup.
Note that this is serialization in the sense of the W3C XSLT and XQuery specifications.
Unlike the class System.Xml.Serialization.XmlSerializer
, this object does not
serialize arbitrary CLI objects.
Field Summary | |
---|---|
static QName |
METHOD QName identifying the serialization parameter "method". If the method is a user-defined method, then it is given as a QName in Clark notation, that is "{uri}local". |
static QName |
BYTE_ORDER_MARK QName identifying the serialization parameter "byte-order-mark" |
static QName |
CDATA_SECTION_ELEMENTS QName identifying the serialization parameter "cdata-section-elements". The value of this parameter is given as a space-separated list of expanded QNames in Clark notation, that is "{uri}local". |
static QName |
DOCTYPE_PUBLIC QName identifying the serialization parameter "doctype-public" |
static QName |
DOCTYPE_SYSTEM QName identifying the serialization parameter "doctype-system" |
static QName |
ENCODING QName identifying the serialization parameter "encoding" |
static QName |
ESCAPE_URI_ATTRIBUTES QName identifying the serialization parameter "escape-uri-attributes". The value is the string "yes" or "no". |
static QName |
INCLUDE_CONTENT_TYPE QName identifying the serialization parameter "include-content-type". The value is the string "yes" or "no". |
static QName |
INDENT QName identifying the serialization parameter "indent". The value is the string "yes" or "no". |
static QName |
MEDIA_TYPE QName identifying the serialization parameter "media-type". |
static QName |
NORMALIZATION_FORM QName identifying the serialization parameter "normalization-form" |
static QName |
OMIT_XML_DECLARATION QName identifying the serialization parameter "omit-xml-declaration". The value is the string "yes" or "no". |
static QName |
STANDALONE QName identifying the serialization parameter "standalone". The value is the string "yes" or "no" or "omit". |
static QName |
SUPPRESS_INDENTATION QName identifying the serialization parameter "suppress-indentation" (introduced in XSLT/XQuery 3.0). Previously available as "saxon:suppress-indentation" The value is the string "yes" or "no" or "omit". |
static QName |
UNDECLARE_PREFIXES QName identifying the serialization parameter "undeclare-prefixes". The value is the string "yes" or "no". |
static QName |
USE_CHARACTER_MAPS QName identifying the serialization parameter "use-character-maps". This is available only with XSLT. The value of the parameter is a list of expanded QNames in Clark notation giving the names of character maps defined in the XSLT stylesheet. |
static QName |
VERSION QName identifying the serialization parameter "version" |
static QName |
SAXON_CHARACTER_REPRESENTATION QName identifying the serialization parameter "saxon:character-representation" |
static QName |
SAXON_INDENT_SPACES QName identifying the serialization parameter "saxon:indent-spaces". The value is an integer (represented as a string) indicating the amount of indentation required. If specified, this parameter overrides indent="no". |
static QName |
SAXON_DOUBLE_SPACE QName identifying the serialization parameter "saxon:double-space". The value of this parameter is given as a space-separated list of expanded QNames in Clark notation, that is "{uri}local"; each QName identifies an element that should be preceded by an extra blank line within indented output. |
static QName |
SAXON_SUPPRESS_INDENTATION QName identifying the serialization parameter "saxon:double-space". The value of this parameter is given as a space-separated list of expanded QNames in Clark notation, that is "{uri}local"; each QName identifies an element whose content should not be indented even when indent=yes is specified. |
static QName |
NEXT_IN_CHAIN QName identifying the serialization parameter "saxon:next-in-chain". This is available only with XSLT, and identifies the URI of a stylesheet that is to be used to process the results before passing them to their final destination. |
static QName |
SAXON_REQUIRE_WELL_FORMED QName identifying the serialization parameter "saxon:require-well-formed". The value is the string "yes" or "no". If set to "yes", the output must be a well-formed document, or an error will be reported. ("Well-formed" here means that the document node must have exactly one element child, and no text node children other than whitespace-only text nodes). |
Constructor Summary | |
---|---|
Serializer() Create a Serializer |
Method Summary | |
---|---|
void |
SetOutputProperty(QName name, string value) Set a serialization property |
void |
SetDefaultOutputProperties(java.util.Properties props)
Set default output properties, for use when no explicit properties are set using SetProperty().
The values supplied are typically those specified in the stylesheet or query. In the
case of XSLT,
they are the properties associated with unamed |
void |
SetCharacterMap(net.sf.saxon.serialize.CharacterMapIndex charMap) Set a character map to be used |
void |
SetOutputFile(string filename) Specify the destination of the serialized output, in the form of a file name |
void |
SetOutputStream(System.IO.Stream stream) Specify the destination of the serialized output, in the
form of a |
java.io.OutputStream |
GetOutputDestination() |
void |
SetProcessor(Processor processor) Set the Processor associated with this Serializer. This will be called automatically
if the
serializer is created using one of the |
void |
SetOutputWriter(System.IO.TextWriter textWriter) Specify the destination of the serialized output, in the
form of a |
net.sf.saxon.event.Receiver |
GetReceiver(net.sf.saxon.event.PipelineConfiguration pipe) |
java.util.Properties |
GetOutputProperties()
|
void |
Close()
|
Field Detail |
---|
public static readonly QName METHOD
QName identifying the serialization parameter "method". If the method is a user-defined method, then it is given as a QName in Clark notation, that is "{uri}local".
public static readonly QName BYTE_ORDER_MARK
QName identifying the serialization parameter "byte-order-mark"
public static readonly QName CDATA_SECTION_ELEMENTS
QName identifying the serialization parameter "cdata-section-elements". The value of this parameter is given as a space-separated list of expanded QNames in Clark notation, that is "{uri}local".
public static readonly QName DOCTYPE_PUBLIC
QName identifying the serialization parameter "doctype-public"
public static readonly QName DOCTYPE_SYSTEM
QName identifying the serialization parameter "doctype-system"
public static readonly QName ENCODING
QName identifying the serialization parameter "encoding"
public static readonly QName ESCAPE_URI_ATTRIBUTES
QName identifying the serialization parameter "escape-uri-attributes". The value is the string "yes" or "no".
public static readonly QName INCLUDE_CONTENT_TYPE
QName identifying the serialization parameter "include-content-type". The value is the string "yes" or "no".
public static readonly QName INDENT
QName identifying the serialization parameter "indent". The value is the string "yes" or "no".
public static readonly QName MEDIA_TYPE
QName identifying the serialization parameter "media-type".
public static readonly QName NORMALIZATION_FORM
QName identifying the serialization parameter "normalization-form"
public static readonly QName OMIT_XML_DECLARATION
QName identifying the serialization parameter "omit-xml-declaration". The value is the string "yes" or "no".
public static readonly QName STANDALONE
QName identifying the serialization parameter "standalone". The value is the string "yes" or "no" or "omit".
public static readonly QName SUPPRESS_INDENTATION
QName identifying the serialization parameter "suppress-indentation" (introduced in XSLT/XQuery 3.0). Previously available as "saxon:suppress-indentation" The value is the string "yes" or "no" or "omit".
public static readonly QName UNDECLARE_PREFIXES
QName identifying the serialization parameter "undeclare-prefixes". The value is the string "yes" or "no".
public static readonly QName USE_CHARACTER_MAPS
QName identifying the serialization parameter "use-character-maps". This is available only with XSLT. The value of the parameter is a list of expanded QNames in Clark notation giving the names of character maps defined in the XSLT stylesheet.
public static readonly QName VERSION
QName identifying the serialization parameter "version"
public static readonly QName SAXON_CHARACTER_REPRESENTATION
QName identifying the serialization parameter "saxon:character-representation"
public static readonly QName SAXON_INDENT_SPACES
QName identifying the serialization parameter "saxon:indent-spaces". The value is an integer (represented as a string) indicating the amount of indentation required. If specified, this parameter overrides indent="no".
public static readonly QName SAXON_DOUBLE_SPACE
QName identifying the serialization parameter "saxon:double-space". The value of this parameter is given as a space-separated list of expanded QNames in Clark notation, that is "{uri}local"; each QName identifies an element that should be preceded by an extra blank line within indented output.
public static readonly QName SAXON_SUPPRESS_INDENTATION
QName identifying the serialization parameter "saxon:double-space". The value of this parameter is given as a space-separated list of expanded QNames in Clark notation, that is "{uri}local"; each QName identifies an element whose content should not be indented even when indent=yes is specified.
public static readonly QName NEXT_IN_CHAIN
QName identifying the serialization parameter "saxon:next-in-chain". This is available only with XSLT, and identifies the URI of a stylesheet that is to be used to process the results before passing them to their final destination.
public static readonly QName SAXON_REQUIRE_WELL_FORMED
QName identifying the serialization parameter "saxon:require-well-formed". The value is the string "yes" or "no". If set to "yes", the output must be a well-formed document, or an error will be reported. ("Well-formed" here means that the document node must have exactly one element child, and no text node children other than whitespace-only text nodes).
Constructor Detail |
---|
public Serializer()
Create a Serializer
Method Detail |
---|
Set default output properties, for use when no explicit properties are set using SetProperty().
The values supplied are typically those specified in the stylesheet or query. In the
case of XSLT,
they are the properties associated with unamed xsl:output
declarations.
props
-
Set a character map to be used
Parameters:charMap
-
Specify the destination of the serialized output, in the form of a file name
Parameters:filename
-
DynamicError
- Throws a DynamicError
if it is not possible to
create an output stream to write to this file, for example, if the filename is in
a
directory that does not exist.
Specify the destination of the serialized output, in the
form of a Stream
Saxon will not close the stream on completion; this is the caller's responsibility.
Parameters:stream
-
Set the Processor associated with this Serializer. This will be called automatically
if the
serializer is created using one of the Processor.NewSerializer()
methods.
processor
-
Specify the destination of the serialized output, in the
form of a TextWriter
Note that when writing to a TextWriter
, character encoding is
the responsibility of the TextWriter
, not the Serializer
. This
means that the encoding requested in the output properties is ignored; it also
means that characters that cannot be represented in the target encoding will
use whatever fallback representation the TextWriter
defines, rather than
being represented as XML character references.
textWriter
-
textWriter
on completion; this is the caller's responsibility.
Set a serialization property
In the case of XSLT, properties set within the serializer override any properties set in
Parameters:xsl:output
declarations in the stylesheet. Similarly, with XQuery, they override any properties set in the Query prolog usingdeclare option saxon:output
.name
-value
-