What is the difference between as="element()+" and as="element()*" in XSL?
- by Rachel
What is the difference between using as="element(data)+" and as="element(data)" in xsl:variable. The below XSL solution works if use "+" but not when i use "". Can some one clarify.
XSL code:
<xsl:variable name="insert-data" as="element(data)+">
<xsl:for-each select="$insert-file/insert-data/data">
<xsl:sort select="xsd:integer(@index)"/>
<xsl:variable name="index" select="xsd:integer(@index)" />
<xsl:variable name="nodeName" select="@nodeName" />
<data nodeName="{$nodeName}" index="{@index}" text-id="{$main-root/*//*[@id=$nodeName]/text()[sum((preceding::text(), .)/string-length(.)) ge $index]/generate-id(.)}">
<xsl:copy-of select="node()"/>
</data>
</xsl:for-each>