Skip to content

Commit

Permalink
Added comma-splitter.xsl. Doesn't actually do anything yet.
Browse files Browse the repository at this point in the history
  • Loading branch information
kgal committed Dec 11, 2019
1 parent e84c942 commit c2c798d
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions comma-splitter.xsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:cc="https://niap-ccevs.org/cc/v1"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:htm="http://www.w3.org/1999/xhtml"
version="1.0">


<xsl:template match="/">
<abc>
<xsl:apply-templates select="//cc:selection-depends/@ids"/>
</abc>
</xsl:template>

<xsl:template match="@ids" name="split">
<xsl:param name="pText" select="."/>

<xsl:if test="string-length($pText) > 0">
<xsl:variable name="vNextItem" select=
"substring-before(concat($pText, ','), ',')"/>

Found: <xsl:value-of select="$vNextItem"/>

<xsl:call-template name="split">
<xsl:with-param name="pText" select=
"substring-after($pText, ',')"/>
</xsl:call-template>
</xsl:if>
</xsl:template>
</xsl:stylesheet>

0 comments on commit c2c798d

Please sign in to comment.