All,
I am new to XSLT and having some problems understanding the syntax of
XPath which selects nodes in the XML document. Consider this bit of
XML, which contains three outer XML elements.
<FOO>foo.top.le vel</FOO>
<BOO><FOO>foo.s econd.level</FOO></BOO>
<CHOO><BOO><FOO >foo.third.leve l</FOO></BOO></CHOO>
My testing shows
(a) "/*/FOO" results in a empty string
(b) "//FOO" results in "foo.top.le vel"
(c) "/FOO" results in a empty string
(d) "//*/FOO" results in "foo.top.le vel"
(e) "//*/*/FOO" results in "foo.top.le vel"
(f) "//BOO/FOO" results in "foo.second.lev el"
I'm picking up the results like this...
<xsl:variable name="foo1" select="/*/FOO"/>
I'm hopelessly confused as to why various XPath's pick various nodes.
Any help you can provide is greatly appreciated.
Thanks,
TFSquare
I am new to XSLT and having some problems understanding the syntax of
XPath which selects nodes in the XML document. Consider this bit of
XML, which contains three outer XML elements.
<FOO>foo.top.le vel</FOO>
<BOO><FOO>foo.s econd.level</FOO></BOO>
<CHOO><BOO><FOO >foo.third.leve l</FOO></BOO></CHOO>
My testing shows
(a) "/*/FOO" results in a empty string
(b) "//FOO" results in "foo.top.le vel"
(c) "/FOO" results in a empty string
(d) "//*/FOO" results in "foo.top.le vel"
(e) "//*/*/FOO" results in "foo.top.le vel"
(f) "//BOO/FOO" results in "foo.second.lev el"
I'm picking up the results like this...
<xsl:variable name="foo1" select="/*/FOO"/>
I'm hopelessly confused as to why various XPath's pick various nodes.
Any help you can provide is greatly appreciated.
Thanks,
TFSquare
Comment