Output & Serialization
Output & Serialization
xsl:output
Controls how the result document is serialized.
<xsl:output method="xml" indent="yes" omit-xml-declaration="yes"/>Supported attributes
| Attribute | Values | Default |
|---|---|---|
method |
xml, html, text |
xml |
indent |
yes, no |
no |
version |
e.g. "1.0" |
|
omit-xml-declaration |
yes, no |
no |
xsl:result-document
Directs output to a secondary file. The primary result is always produced; additional documents can be written with xsl:result-document.
<xsl:template match="/">
<!-- Primary output -->
<index>
<xsl:for-each select="//chapter">
<ref href="ch-{@id}.html"/>
<!-- Secondary output per chapter -->
<xsl:result-document href="ch-{@id}.html">
<html>
<body><xsl:apply-templates/></body>
</html>
</xsl:result-document>
</xsl:for-each>
</index>
</xsl:template>In the Go API, secondary documents are available in TransformResult.SecondaryDocuments.