xsl-list
[Top] [All Lists]

Re: Recursion (I think)

2005-09-26 04:52:28
Hi,

Would that be

ancestor-or-self::*[ObjectType][1]/@id

No, that you get you an ancestor node (or the current node) that has a
childnode with the element name ObjectType.

What purpose does the [1] serve?

What ancester-or-self::*[(_at_)id] does, is to select the superset of all
ancestors and current node, which have an attribute called id.
The [1] here, then, selects the first of these nodes in reverse
document order - as that is the order of ancestor-or-self
(buttom-up)).
The last /@id selects the attribute id of that node.

What you would want was probably something like
ancestor-or-self::*[(_at_)id][self::ObjectType][1]/@id

I think you can write:
ancestor-or-self::ObjectType[(_at_)id][1]/@id
But this is not tested (I haven't had to do this before, and my
reference book is not nearby).

Hope this helps
Regards,
Ragulf Pickaxe :-)

--~------------------------------------------------------------------
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(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



<Prev in Thread] Current Thread [Next in Thread>