xsl-list
[Top] [All Lists]

Re: Problem with nested Stuff

2005-11-14 12:40:06
I don't see anything nested "stuff" here (besides the input xml, but
it's not a nesting problem).  Are you asking how to get a value out of
an attribute?  Rather basic and faq question.  @foo will give the
value.  So you can just do a varient of the identity transformation
for this.

So something like:

<xsl:template match="*">
<xsl:choose>
<xsl:when test="@myid">
<xsl:copy>{<xsl:value-of select="@myid" />}</xsl:copy>
</xsl:when>

<xsl:otherwise>
<xsl:copy>
<xsl:apply-templates />
</xsl:copy>
</xsl:otherwise>

</xsl:template>

If there is an attribute called @myid, this template (untested, might
have typos) should get the value of @myid instead of the value of
applying templates to the children

Jon  Gorman

--~------------------------------------------------------------------
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>