Subject: Re: [xsl] generate full xpath name to an attribute? From: Ray Tayek <rtayek@xxxxxxxxx> Date: Mon, 31 Mar 2003 08:33:13 -0800 |
yikes! - looks like the simplest way is to have:
<xsl:template match="name"> <xsl:for-each select="ancestor-of-self::*"> <xsl:value-of select="name()" /><xsl:text>/</xsl:text> </xsl:for-each> <xsl:value-of select="." /> </xsl:template>
depending on your document type this might not give you an unambigous path back to your attribute
(and you probably want a @ before that last step)
<xsl:if test="../@*/."> <xsl:if test="../@*"> count(. | ../@*) = count(../@*)
using the first two: <xsl:if test="../@*/."> <xsl:text>@</xsl:text> </xsl:if> <xsl:if test="not(../@*/.)"> <xsl:text>/</xsl:text> </xsl:if>
--- ray tayek http://tayek.com/ actively seeking mentoring or telecommuting work vice chair orange county java users group http://www.ocjug.org/ hate spam? http://samspade.org/ssw/
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] generate full xpath name , David Carlisle | Thread | RE: [xsl] generate full xpath name , Michael Kay |
Re: [xsl]Passing Parameter to the U, David Carlisle | Date | Re: [xsl] html:br, Karl J. Stubsjoen |
Month |