xsl-list
[Top] [All Lists]

RE: [xsl] Match nodes searching for attributes in children

2010-01-18 03:17:43

I want to match a node A that has a child B with an @attr = 
1. I tried this, but it didn't work:

<xsl:template match="//A[B/@attr = 1]">

also this didn't work:

<xsl:template match="//A[B[(_at_)attr = 1]]">


Both those are perfectly correct, though the "//" is redundant and best
avoided.

Your error must be in something you haven't shown us. Perhaps the elements
are in a namespace. Try posting a small but complete example.

Regards,

Michael Kay
http://www.saxonica.com/
http://twitter.com/michaelhkay 


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