Project

Profile

Help

Support #2459 » saxon-json.xslt

Jason Mihalick, 2015-09-26 00:33

 
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:map="http://www.w3.org/2005/xpath-functions/map"
version="3.0">

<xsl:param name="json"/>

<!-- Main template that kicks everything else off. -->
<xsl:template match="/">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="document">
<xsl:variable name="json-map" select="parse-json($json)" as="item()*"/>
<xsl:element name='foo-element'>
<xsl:attribute name="foo-attr" select="map:get($json-map,'foo')"/>
</xsl:element>

</xsl:template>
</xsl:stylesheet>
(2-2/2)