Re: What does a "//" mean in an xpath expressin?




eric.gofo...@xxxxxxxxx wrote:
In an xsl stylesheet, I have

<xsl:when test="string-length(//mystuff) &gt; 0">
<xsl:attribute name="someattribute">blahblahblah</xsl:attribute>
</xsl:when>

In the xml that mystuff is several layers deep, does the // do a search
in the xpath?

<test>
<another_level>
<mystuff>testing123</mystuff>
</another_level>
</test>

Answering my own question, from the w3schools website:

Selecting Nodes

XPath uses path expressions to select nodes in an XML document. The
node is selected by following a path or steps. The most useful path
expressions are listed below:
Expression Description
nodename Selects all child nodes of the node
/ Selects from the root node
// Selects nodes in the document from the current node that match the
selection no matter where they are
.. Selects the current node
... Selects the parent of the current node
@ Selects attributes

I'd tried searching w3schools, Google Group, etc. But couldn't find
anything for the "//" string.

-Eric

.



Relevant Pages

  • Re: Random access of XML file
    ... select all nodes matching an XPath expression. ... selects the first node that matches the XPath ... Fundamentally, if it's not well-formed XML, then it isn't XML, period. ... look at XSLT, but that may be overkill depending on your needs. ...
    (microsoft.public.dotnet.xml)
  • Re: Need help with PHP DOMXML - get_elements_by_tagname
    ... PHP as a supported platform. ... uses the built in XML handler CF MX provides. ... in newer versions of PHP and the method will *not* support xpath. ...
    (comp.lang.php)
  • ANN: XMLMax Virtual XML Editor Beta
    ... Xponent is pleased to announce Beta version 2.0.5 of its XMLMax ... Virtual XML Editor. ... It provides xpath query and editing of any xml file, ...
    (microsoft.public.dotnet.framework)
  • ANN: XMLMax Virtual XML Editor Beta
    ... Xponent is pleased to announce Beta version 2.0.5 of its XMLMax ... Virtual XML Editor. ... It provides xpath query and editing of any xml file, ...
    (microsoft.public.office.misc)
  • ANN: XMLMax Virtual XML Editor Beta
    ... Xponent is pleased to announce Beta version 2.0.5 of its XMLMax ... Virtual XML Editor. ... It provides xpath query and editing of any xml file, ...
    (microsoft.public.biztalk.general)