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

Re: namespace aware template matching

Subject: Re: namespace aware template matching
From: David Carlisle <davidc@xxxxxxxxx>
Date: Thu, 27 Oct 2005 10:14:47 +0100
Re:  namespace aware template matching
> if so, is one any better/faster than the other?, or are they completely 
> different somehow?

they are different.

ancestor::ns:article[1] finds the nearest ancestor ns:article
ancestor::ns:*[1][self::article] finds the nearest ancestor ns:*
            element if it is an article, and nothing otherwise.

so if you have

<ns:article>
  <sadjfg>
     <ns:wibble>
       <lkjgh>
          <ns:id>

the ns:id element matches

ns:id[ancestor::ns:article[1]]

but not

ns:id[ancestor::ns:*[1][self::article]]

I understood from your description that you wanted the form that I gave,
but if you actually wanted the form that you gave, then use that
instead:-)

If that is the form you wanted, then possibly you may also be happy
with the much simpler form

match="ns:root//ns:article//ns:id"

which in some edge cases left as an excercise to the reader isn't
equivalent to either of the forms above, but may well address your real
use case.


David

________________________________________________________________________
This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________

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-2013 All Rights Reserved.