Skip to content

Instantly share code, notes, and snippets.

@dmj
Created July 9, 2019 08:43
Show Gist options
  • Save dmj/a33d417258e0b097d25d371025ce8e51 to your computer and use it in GitHub Desktop.
Save dmj/a33d417258e0b097d25d371025ce8e51 to your computer and use it in GitHub Desktop.
Serialize secondary result port in p:xslt
<p:declare-step name="main" version="1.0"
xmlns:p="http://www.w3.org/ns/xproc">
<p:xslt name="transformation">
<p:input port="stylesheet">
<p:document href="beispiel.xsl"/>
</p:input>
<p:input port="source">
<p:inline>
<document/>
</p:inline>
</p:input>
<p:input port="parameters">
<p:empty/>
</p:input>
</p:xslt>
<p:sink/>
<p:for-each>
<p:iteration-source>
<p:pipe step="transformation" port="secondary"/>
</p:iteration-source>
<p:store method="html" version="5.0">
<p:with-option name="href" select="base-uri(/)"/>
</p:store>
</p:for-each>
</p:declare-step>
<xsl:transform version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<xsl:result-document href="foo.html" method="html">
<h1>Foo</h1>
</xsl:result-document>
<xsl:result-document href="bar.html" method="html">
<h1>Bar</h1>
</xsl:result-document>
<h1>Foobar</h1>
</xsl:template>
</xsl:transform>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment