Connecting Tech Pros Worldwide Help | Site Map

parent::*/preceding-sib*ling::tagname VS parent::preceding-sib*ling::tagname

KJ
Guest
 
Posts: n/a
#1: Jul 20 '05
Hello All,

I'd like to know what the difference is between these 2 expressions:

parent::*/preceding-sib*ling::tagname

VS

parent::preceding-sib*ling::tagname

That is to say: why is the */ necessary.

Thank you.
-KJ

Richard Tobin
Guest
 
Posts: n/a
#2: Jul 20 '05

re: parent::*/preceding-sib*ling::tagname VS parent::preceding-sib*ling::tagname


In article <1117731594.030165.176820@g14g2000cwa.googlegroups .com>,
KJ <n_o_s_p_a__m@mail.com> wrote:
[color=blue]
>I'd like to know what the difference is between these 2 expressions:
>
>parent::*/preceding-sibling::tagname
>
>VS
>
>parent::preceding-sibling::tagname[/color]

Well the second one is a syntax error! axis:: is always followed by a
node-test. parent::preceding-sibling means all parent nodes called
preceding-sibling. (Obviously there's only one parent node, so
it really means "the parent node if it's called preceding-sibling,
otherwise nothing".)

-- Richard
Martin Honnen
Guest
 
Posts: n/a
#3: Jul 20 '05

re: parent::*/preceding-sib*ling::tagname VS parent::preceding-sib*ling::tagname




KJ wrote:

[color=blue]
> I'd like to know what the difference is between these 2 expressions:
>
> parent::*/preceding-sib*ling::tagname
>
> VS
>
> parent::preceding-sib*ling::tagname
>
> That is to say: why is the */ necessary.[/color]

parent is an axis, then you need a node test on that axis which * is
(matches all element nodes).
parent::preceding-sibling is not syntactically correct.


--

Martin Honnen
http://JavaScript.FAQTs.com/
Closed Thread