Subject: Re: [xsl] this script converts an instance path to an RNG path From: S Woodside <sbwoodside@xxxxxxxxx> Date: Mon, 31 Mar 2003 18:42:21 -0500 |
<!-- Converts an instance path to an RNG path --> <xsl:template name="inst2rngPath"> <xsl:param name="fragment"/>
<xsl:choose>
<xsl:when test="starts-with($fragment, '/')"> <!-- strip beginning / -->
<xsl:call-template name="inst2rngPath">
<xsl:with-param name="fragment" select="substring-after($fragment, '/')"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise> <xsl:text>//*[@name='</xsl:text>
<xsl:choose> <xsl:when test="substring-before($fragment, '/')"> <xsl:value-of select="substring-before($fragment, '/')"/> </xsl:when><xsl:otherwise> <xsl:value-of select="$fragment"/> </xsl:otherwise></xsl:choose> <xsl:text>']</xsl:text>
<xsl:choose>
<xsl:when test="contains($fragment, '/')"> <!-- recursive step -->
<xsl:call-template name="inst2rngPath">
<xsl:with-param name="fragment" select="substring-after($fragment, '/')"/>
</xsl:call-template>
</xsl:when><xsl:otherwise> <!-- default step --> <xsl:text>/*</xsl:text> </xsl:otherwise>
That's all.</xsl:choose> </xsl:otherwise> </xsl:choose> </xsl:template>
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] this script converts an insta, S Woodside | Thread | [xsl] question on preceding nodes, Liao, John Teguh (Jo |
Re: [xsl] Re: generate full xpath n, Ray Tayek | Date | [xsl] Creating a binary file, Hugh Dixon |
Month |