xpath-1.0

How to select the nth item in xpath 1.0?

I have some XML and an XPath query. I'm using Yahoo! widgets, so I'm using XPath 1.0. Here's the gist of my XML... <root> <cat num="SOURCE"> <movie> <swf>speak.swf</swf> <width>250</width> <height>150</height> <colour>cccccc</colour> </movie> <movie> ...

How can I use XPath to find the minimum value of an attribute in a set of elements?

If I have XML like: <foo> <bar id="1" score="192" /> <bar id="2" score="227" /> <bar id="3" score="105" /> ... </foo> Can I use XPath to find the minimum and maximum values of score? Edit: The tool i'm using (Andariel ant tasks) doesn't support the XPath 2.0 solution. ...

Short hand for number of tags having lengthier [and almost same] Xpath

For example : this is an xslt <xsl:template match="/root/sub-root/parent/child/grand_child/dummy1/dummy2/dummy3/dummy4/node_1 |/root/sub-root/parent/child/grand_child/dummy1/dummy2/dummy3/dummy4/node_2 |/root/sub-root/parent/child/grand_child/dummy1/dummy2/dummy3/dummy4/node_3 . . |/root/sub-root/parent/child/grand_child/dummy1/dummy2...

How do I select the shallowest matching elements with XPath?

Let's say I have this document. <a:Root> <a:A> <title><a:B/></title> <a:C> <item><a:D/></item> </a:C> </a:A> </a:Root> And I have an XmlNode set to the <a:A> element. If I say A.SelectNodes( "//a:*", namespaceManager ) I get B, C, and D. But I don't want D because it's nested in another...

In XPath 1.0, how can I test whether a string with length 1 falls between two others codepoint-wise?

Given a document containing these tags, how can I tell whether " " < "H" < "z" in the document's encoding? I'm trying to do this in XPath 1.0. <text>H</text> <range> <from>&#x20;</from> <to>z</to> </range> I might even be able to get away with using contains(), but then how would I create a string containing the characters from "...