Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <xsl:otherwise>
- <xsl:for-each select="//*[local-name()='Output']">
- <xsl:choose>
- <xsl:when test="count(./*/*[local-name()='LiteralData'])>0">
- <!--LiteralData type -->
- <xsl:variable name="literalIdentifier"
- select="concat(fn:flagRemover(string(./*[local-name()='Identifier']/text())),'Result')" />
- <xsl:element name="{$literalIdentifier}">
- <xsl:value-of select="./*/*[local-name()='LiteralData']/text()" />
- </xsl:element>
- </xsl:when>
- <xsl:when test="count(./*/*[local-name()='BoundingBoxData'])>0">
- <xsl:variable name="crs" select="./*/*[local-name()='BoundingBoxData']/@crs"/>
- <xsl:variable name="dimensions" select="./*/*[local-name()='BoundingBoxData']/@dimensions"/>
- <xsl:variable name="lowerCorner" select="./*/*/*[local-name()='LowerCorner']/text()" />
- <xsl:variable name="upperCorner" select="./*/*/*[local-name()='UpperCorner']/text()" />
- <xsl:value-of select="concat(translate($lowerCorner,' ',','),',',translate($upperCorner,' ',','),',',$crs,',',$dimensions)" />
- </xsl:when>
- <xsl:otherwise>
- <!-- ComplexData -->
- <!-- ATTENTION THE LITERALDATA AS REFERENCE WILL OUTPUT FROM HERE, NOT ELEGANT :( -->
- <xsl:variable name="complexIdentifier"
- select="concat(fn:flagRemover(string(./*[local-name()='Identifier']/text())),'Result')" />
- <!--ComplexData may contain XML or string -->
- <xsl:choose>
- <xsl:when test="./*/*/*">
- <xsl:element name="{$complexIdentifier}">
- <xsl:copy-of select="./*/*/*" />
- </xsl:element>
- </xsl:when>
- <xsl:otherwise>
- <xsl:element name="{$complexIdentifier}">
- <!-- 2 Posibilities content or reference -->
- <xsl:choose>
- <xsl:when test="./*[local-name()='Reference']/@href">
- <xsl:value-of select="./*[local-name()='Reference']/@href" />
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="./*/*/text()" />
- </xsl:otherwise>
- </xsl:choose>
- </xsl:element>
- </xsl:otherwise>
- </xsl:choose>
Advertisement
Add Comment
Please, Sign In to add comment