|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: How to select either ElementA -OR- ElementB in an
Hi,
On mer, 2005-06-15 at 12:25 -0700, Christopher R. Maden wrote:
> chris wrote:
> > Thanks for the response. Are you sure that's correct or am I goofing
> > it up somehow? Using Saxon 8.4, I get an error trying to use your
> > solution...
>
> No, that won't work. You need to look at all your ancestors, then find
> the closest one that matches your pattern:
>
> ancestor::*[name() = 'A' or name() = 'B'][1]
Using name() = 'A' is not namespace safe and self::A should be preferred
in such situations :
ancestor::*[self::ElementA | self::ElementB][1]
Also note that the order of the ancestor axis can be misleading since
you'll get the first one starting from the context node going toward the
document root.
Eric
>
> HTH,
> Chris
--
Curious about Relax NG? Read my book online.
http://books.xmlschemata.org/relaxng/
------------------------------------------------------------------------
Eric van der Vlist http://xmlfr.org http://dyomedea.com
(ISO) RELAX NG ISBN:0-596-00421-4 http://oreilly.com/catalog/relax
(W3C) XML Schema ISBN:0-596-00252-1 http://oreilly.com/catalog/xmlschema
------------------------------------------------------------------------
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








