Project

Profile

Help

Support #4932 » bug-report.xsl

Tomos Hillman, 2021-03-10 11:37

 
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:math="http://www.w3.org/2005/xpath-functions/math"
xmlns:map="http://www.w3.org/2005/xpath-functions/map"
exclude-result-prefixes="xs math"
version="3.0">
<xsl:output method="text"/>
<xsl:variable name="this" select="map{
'firstmap' : map{
'set' : 'return',
'content' : 'This is a cow'
},
'secondmap' : map{
'content' : 'This is a pig'
},
'string' : 'This is a sheep',
'number' : 110
}"/>
<xsl:template name="xsl:initial-template">
<xsl:variable name="WannaCow" select="map:keys($this) ! $this?(.) [. instance of map(*)][exists(?set)]"/>
<xsl:variable name="WannaCowFixed" select="(map:keys($this) ! $this?(.) [. instance of map(*)])[exists(?set)]"/>
<xsl:sequence select="serialize($WannaCow, map{'method':'json'})"/>
</xsl:template>
</xsl:stylesheet>
    (1-1/1)