XML information pipe

Ihre Spezialisten für XML

Banner Werbung

XSLT 2.0 reference

as

Example 1 | Example 2 | Example 3 | Example 4 |


Example 1:


XML source: <aaa/>
XSLT stylesheet: <xsl:stylesheet exclude-result-prefixes="my sch" version="2.0"
xmlns:my="myFunctions"
xmlns:sch="http://www.w3.org/2001/XMLSchema"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:output
method="xml"/>
indent="yes"/>
omit-xml-declaration="yes"/>

<xsl:function as="sch:integer" name="my:return-number">
   <aaa>10</aaa>
</xsl:function>

<xsl:function name="my:return-node">
   <aaa>10</aaa>
</xsl:function>

<xsl:template match="/aaa">
   <xxx>
   <xsl:copy-of select="my:return-node()"/>
   </xxx>
   <yyy>
   <xsl:copy-of select="my:return-number()"/>
   </yyy>
</xsl:template>

</xsl:stylesheet>
Output xml.file: <xxx>
   <aaa>10</aaa>
</xxx>
<yyy>10</yyy>
Back