[xsl] a simple question about node tests

Subject: [xsl] a simple question about node tests
From: "Robert P. J. Day" <rpjday@xxxxxxxxxxxxxx>
Date: Thu, 22 May 2003 13:20:58 -0400 (EDT)
  a while back, i read somewhere (can't remember where, darn it)
an explanation of node tests that cleared up a minor confusion
i've had for a while.  to recap first...

  the "node()" test selects all nodes on the relevant axis,
the default being the child axis.  therefore, the kinds of 
nodes that will be selected based on the axis will be:

child::node() -- element, text, comment, processing-instruction
attribute::node() -- attribute nodes only
namespace::node() -- namespace nodes only

so far, so good.

  but, WRT abbreviations, it's always explained that "*"
(again short for child::*, right?) will select elements.
unless it's used in conjunction with the attribute axis,
at which point either attribute::* or @* will select just
attribute nodes.  same for the namespace axis.

  so what exactly does "*" mean?  a while back, i read
that "*" doesn't mean "element" so much as it does "the
primary node type along that axis", which for the child
axis is an element node, for the attribute axis is the
attribute node, etc.

  once i read this, it made perfect sense.  did i read
that correctly?  is that how one should interpret the
"*" node test?


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

Current Thread