This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Re: XSLT Tree Model


> > 1. I wanted to find namespace nodes by catching them in a template 
>
> a match pattern of node() should match namespace nodes, but probably
> it's easier to use for-each, as you have done.

>From Mike Kay's book:

1. Formal definition of a pattern (page 405):
   "The node N matches a pattern P if and only if
    there is a node A that is ancestor-or-self of N,
    such that evaluating P as an expression 
    with A as the context node
    returns anode-set thatcontains N".

2. A more direct answer (page 406):
   "Although the formal usually give the answer you would expect intuitively, 
    there can be surprises. For example, you might expect the pattern "node()"
    to match any node; but it doesn't. As an expression it short for 
   "./child::node", and the only nodes that this can select are nodes that are 
    children of something. Since root nodes, attribute nodes and namespace nodes
    are never children of another node, they will never be matched by the 
    pattern "node()""

I can only add, that due to the fact that only the "child" and "attribute" axis are
allowed in a pattern (excluding contents of predicates where any XPath expression is
OK), this effectively means, that namespace nodes cannot be matched by a pattern.

So, picking namespace nodes in another way (not directly matching them with template
rules) is the only way to go.

Or am I wrong?

Cheers,
Dimitre Novatchev.

__________________________________________________
Do You Yahoo!?
NEW from Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month.
http://geocities.yahoo.com/ps/info1

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]