Altova Mailing List Archives>Archive Index >xsl-list Archive Home >Recent entries >Thread Prev - Re: [xsl] returning nodes which have a specific child [Thread Next] Re: [xsl] returning nodes which have a specific childTo: xsl-list@-----.------------.--- Date: 7/3/2009 5:08:00 PM David Carlisle schrieb:
> You can see that the node test node() is true for attribute nodes if
> you apply it to an axis that has such nodes, as in:
>
> attribute:node()
To further clarify or mystify or nodify all this node salad, here's an
alternative, more symmetrical syntax for our beloved identity template:
<xsl:template match="@node()|node()">
<xsl:copy>
<xsl:apply-templates select="@node()|node()"/>
</xsl:copy>
</xsl:template>
This probably has been proposed before, but I haven't seen it yet.
Interestingly (and regrettably), LibXSLT 1.1.24 will compile this in the
path expression (@select), but not in the match pattern.
xsltCompilePattern : failed to compile '@node()'
(Yes, I'm going to notify Daniel.)
> node() matches attributes in other contexts too, such as the xpath2
> expression
>
> @foo instance of node()
Great test - I'd never have thought of that.
Michael Ludwig
--~------------------------------------------------------------------
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@l...>
--~--
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
