How to use condtion in xpath

<courses> <course number = "1" category = "A"> <title>B</title> </course> </courses> I want to pick all @number has category= "A" I try to use //@number[@category/text()='A'], but it seem no work, So how can I ge...
more »

2017-12-03 23:12 (2) Answers

Selecting a parent node in XPath?

Here is a snippet of XML (there is much more) I'm working with, I'm trying to run an XPath expression to find the ASIN node in the Item section while confirming that the Author isn't JK Rowling. I tried this: /ItemSearchResponse/Items/Item/ItemAttri...
more »

2017-12-02 20:12 (1) Answers

XPath: found last element with criteria

this xpath-Statement extract the first value from Attribut Adressen/Adresse/NUMMER //Adressen/Adresse/NUMMER[../TYP="P"] Response: 20171129100600 But I try to get the last value from the Property Adressen/Adresse/NUMMER with Adressen/Adresse/...
more »

2017-12-01 13:12 (2) Answers

XPath for custom Sonar coding rules

I am trying to set up a custom coding rule for XML in SonarQube using XPath 1.0 to look at my pom.xmlfiles. Below is an example of what I am trying to query. <properties> <hcp-lang.version>2.0.37</hcp-lang.version> </prope...
more »

2017-11-24 14:11 (1) Answers

XPath for element with maximum value?

I have a XML file containing different publications. I want to find the publication with the highest amount of timesCited which is published before 2010. I have this as of now: /publications/publication[timesCited = max(/publications/publication/tim...
more »

2017-11-22 20:11 (2) Answers

XPath matching wildcards?

Looking to use a wildcard in an xpath where the attribute is a path and I want all paths that end with "text". Example: <Property name="jcr:content/MainParsys/*/text"/> jcr:content/MainParsys is constant. * is where I want the wildcard (al...
more »

2017-11-21 21:11 (1) Answers

How do I break down large XPaths in XSLT?

I'm writing some product exports in XSLT and I have some fairly large select statements, as I have these sort of nested sorts/headers Given a select statement such as... /objects/object/items/item[ not( custom_options/custom_option[brac...
more »

2017-11-09 16:11 (1) Answers

Select an element in nested XML in SQL Server

I have a column with XML contents in a SQL Server table. Actually, several different XML's are merged together in this particular XML column. When I do select columnwithXML.query('(/root/secondlayer/node())').value('(/*)[11]', 'varchar(max)')...
more »

2017-11-09 15:11 (1) Answers

How to get result out from xpath using php?

Im trying to get the text out xpath/html using php..but not successful any idea. Example: My xpath (This is correct i already double check) //*[@id="bodyContent"]/div/div/div[3]/div[1]/div[1]/d...
more »

2017-11-01 19:11 (2) Answers

How to Select distinct values in FOR XML PATH?

Given the following tables where T_DATA.ID = PARENT_ID or CHILD.ID Name: T_DATA +----+------+--------+ | ID | CODE | VALUE | +----+------+--------+ | 1 | 3186 | value1 | | 2 | 3186 | value2 | | 3 | 3189 | value3 | | 4 | 3189 | value4 | | 5 | ...
more »

2017-10-31 17:10 (1) Answers

Why won't my xpath work?

I have the following xml: <?xml version="1.0" encoding="UTF-8"?> <prefix:someName xmlns:xsi="" xmlns:prefix="someUri" xsi:schemaLocation="someLocation.xsd"> <prefix:someName2> ...
more »

2017-10-27 10:10 (2) Answers