Questions tagged [xpath-2.0]

Use this tag for questions specific to XML Path Language (XPath) version 2.0

W3C Recommendation:


Online Training

A 70-minutes "Crash Course in XPath" module is available as part of the Pluralsight video-course "XSLT 2.0 and 1.0 Foundations", by Dimitre Novatchev


681 questions
30
votes
4 answers

What browsers support Xpath 2.0?

I have recently been working with XPath and have been searching for information on which browsers support XPath 2.0 without much luck. The best I could find was the query technologies comparison table of various rendering engines. This clearly tells…
Default
  • 16,020
  • 3
  • 24
  • 38
25
votes
2 answers

Will XPath 2.0 and/or XSLT 2.0 be implemented in PHP?

The question was asked but deleted by the asker before it received an answer. Because I believe the question is sound and legitimate and serves a purpose, I'm asking it again and provide the answer I already wrote for the original question. Will…
Abel
  • 56,041
  • 24
  • 146
  • 247
19
votes
2 answers

xpath dates comparison

I'm trying to filter elements based on an attribute that is a date in the format yyyy-MM-dd. My XML looks like this:
15
votes
3 answers

XPath 2.0 online tester?

i work with Oxygen XMLTester for xPath selectors, supporting XPath 2.0 specification. So i wonder if there is any online tester working with XPath 2.0…
Igor Savinkin
  • 5,669
  • 8
  • 37
  • 69
13
votes
4 answers

Does libxml2 support XPath 2.0 or not?

I've tried to use the XPath 2.0 exp //span/string(.) in libxml2, but it doesn't work. So, my question is: does libxml2 support XPath 2.0 or not?
13
votes
2 answers

Evaluate Xpath2.0 in python

I have an XPath expression as shown below. if(replace(//p[1]/text(),'H','h') = 'hello') then //p[1]/text() else if(//p[1]/text() = 'world') then //p[2]/text() else 'notFound' I want to display which 'if ' expression worked. e.g //p[1]/text() if…
Er Bharath Ram
  • 131
  • 1
  • 3
13
votes
4 answers

How do you identify duplicate values in a numerical sequence using XPath 2.0?

I have an XPath expression which provides me a sequence of values like the one below: 1 2 2 3 4 5 5 6 7 This is easy to convert to a sequence of unique values 1 2 3 4 5 6 7 using distinct-values(). However, what I want to extract is the list of…
woody
13
votes
3 answers

XSL if test starts-with

Given this piece of XML info:eu-repo/date/embargoEnd/2013-06-12 2012-07-04 I should need with XSL to output only the year of the string not starting with info:eu-repo. I'm trying this way, but it doesn't work.…
robert laing
  • 1,331
  • 2
  • 12
  • 19
12
votes
2 answers

How to get only numbers from string with XPath

I have a string which contains numbers. Is it feasible only with XPath that I get only numbers from it? For example: myString="abcd12ef34gh567", result: 1234567
Attila Zobolyak
  • 739
  • 2
  • 10
  • 15
11
votes
3 answers

Convert dateTime to unix epoch in xslt

I have a dateTime variable, and I want to convert it to a decimal value of epoch. How can this be done? I tried using: seconds-from-duration($time, xs:dateTime('1970-01-01T00:00:00')) but it just returns 0. Please advice. Thanks.
Anna
  • 4,099
  • 4
  • 24
  • 26
10
votes
2 answers

how to check parent of current node is root node or not in xslt?

I want to check the parent of current node is root node or not in Xslt.How i do that? Please Guide me to get out of this issue... Thanks & Regards, P.SARAVANAN
Saravanan
  • 11,372
  • 43
  • 143
  • 213
10
votes
2 answers

Split node value with XPath

Is there some kind of split() function in XPath? Say I have this XML: C:\folder\filename And I want to retrieve filename, how can I do this? I know I can get the node value like this: //path/text() How can I get only…
Rise_against
  • 1,042
  • 3
  • 15
  • 36
9
votes
4 answers

Nested conditional if else statements in xpath

I have this XML: No Yes RESIDENTIAL and I want to create an xpath statement that is…
Kirk WSI
  • 173
  • 1
  • 1
  • 9
8
votes
4 answers

XQuery/XPath: Using count() and max() function for return of element with highest count

I have an XML file that contains authors and editors.
Jea
  • 484
  • 2
  • 5
  • 17
8
votes
3 answers

Finding the difference between 2 dates in xslt

Is there a less then kludgey way of finding the difference in days between 2 dates in xslt? If so can you point me in the right direction. I am receiving dates in the format of mm/dd/yyyy.
Mike T
  • 3,696
  • 4
  • 21
  • 21
1
2 3
45 46