xsl-list
[Top] [All Lists]

Re: [xsl] Still thinking to object oriented...

2008-10-09 05:20:54
now since i was working with the solution i got from here, i am stuck
with the following problem:

<xsl:template match="/">
<xsl:value-of
 select="//*[descendant-or-self::*[contains(name(),'to_search')]]/name()"
 separator="&#10;"/>
</xsl:template>
</xsl:stylesheet>

This stylesheet only gives me the name of the node, but now i have the
requirement to get also attributes from these nodes. Can anyone help
me to change the XPath invocation for my needs. If i try to do it with
the node() function at the end, there are more nodes in the output
than just with the name() function. I know, that has something to do
with empty text nodes and things like that, but i don't know, how to
filter them or which function is appropriate for me to get the same
nodes as the name() function does, but with the attributes.


select="//*[descendant-or-self::*[contains(name(),'to_search')]]/(name(), @*)"

....will give you the attributes of the elements as well as its name

cheers
-- 
Andrew Welch
http://andrewjwelch.com
Kernow: http://kernowforsaxon.sf.net/

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