xsl-list
[Top] [All Lists]

Re: SV: [xsl] XML Question

2006-10-04 04:41:08

<xsl:value-of select="string-join(((name(ancestor::*)), name()), '/')"/>
but Altova gives error message "too many items"...

You can't apply name() to a sequence of more than 1, you want
ancestor::*/name() not name(ancestor::*)
although you could write the whole thing as
<xsl:value-of select="ancestor-or-self::*/name()" separator="/"/>


<xsl:template match="//*[not(*)]">
Starting a match with // doesn't do anything useful,

<xsl:variable name="path">
perhaps its just because you simplified for your posted example, but
this variable is only used once, so you don't need to declare it, just
use the content directly.

<xsl:template match="*[not(*)]">
<xsl:text>
</xsl:text>
<xsl:value-of select="ancestor-or-self::*/name()" separator="/"/>
<xsl:value-of select="' ===> '"/>
<xsl:value-of select="."/>
</xsl:template>

David

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>