[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: returning nodes which have a specific child

Subject: Re: returning nodes which have a specific child
From: Michael Ludwig <mlu@xxxxxxxxxxxxx>
Date: Fri, 03 Jul 2009 19:07:18 +0200
Re:  returning nodes which have a specific child
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

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2011 All Rights Reserved.