426 questions
0
votes
0
answers
53
views
Long XPATH / strctured XML filter has a huge performance hit
I have been trying to minimize the logs sent to SIEM by filtering them at the source.
You can find the filter I used below. It is long. Instead of using a long <Select> statement with inverted ...
0
votes
1
answer
66
views
How to prevent end node name from being written when parsing xml with MSXML6
Apologies for the unclear title but I'm unsure of the correct terminology.
Allow me to clarify:
My starting XML
<osmChange>
<way id="304298875">
<nd ref="...
0
votes
1
answer
84
views
Why does this XSLT/XPath Concat returns a 'Nodetest expected here' error using MSXMLDom?
My XML (snip):
<way id="1237072661">
<nd ref="11488882051"/>
<nd ref="11488882048"/>
<tag k="railway" v="station&...
0
votes
0
answers
34
views
XPath: How do I return only one child element, but retain the tree structure?
I'm using this XPath to filter out data.
.selectNodes("(//delete/node|//delete/way)[tag[@k='railway'][@v='station' or @v='platform']]")
It returns this, as expected.
<delete>
<...
0
votes
1
answer
42
views
How we extract multiple parameter in Xpath from XML including condition
Unable to extract the all values from Xpath from multiple tags with condition
Example: Extract all parameters :CarrierCode,DepartureDate,Destination,OperatingFlightNumber with condition PtcId=1.
<?...
0
votes
2
answers
70
views
XPath 1.0 predicate with number function doesn't match all nonzero values in XSLT input
I'm using the xsltproc command and getting unexpected output from a predicate using the number() function. I'm trying to use number()'s output as a boolean, with 0 treated as false and all other ...
0
votes
2
answers
141
views
Postgresql - XML- Processing xpath with date comparission
I have ingested XML file in Postgresql DB and I trying to perform XPATH operation on the field with date comparison but it is not working. From Postgresql official site I found out that Postgresql ...
1
vote
1
answer
56
views
Facing difficulties with the XPATH text() function
My goal is to get the price text from the page.
When I use the XPATH
//*[@id="module_product_price_1"]/div/div/span
, it finds just one item. However, when I include the text() function
//*[...
1
vote
2
answers
51
views
Xpath: Extract text between tags, but stop as soon as an embedded tag occurs
I would like to extract the text within the following HTML. However, everything that occurs within an enclosed HTML tag and everything that comes after it should be ignored.
The HTML appears in ...
0
votes
1
answer
40
views
How to get the last element of a string with : as seperator using Xpath1.0 in a XML doc
I have this xml document:
" : " is the separator.
xml = """
<a>
<b> 1,2,3 : 4,5,6 : 7,8,9 : 10,11,12 </b>
</a>
"""
How can I get ...
0
votes
1
answer
40
views
Is there a workaround to "distinct-values()" in this case?
first time poster and XPath beginner. I hope you can help me with this XPath problem I have. Here's a simplified example of my file.
<town>
<library>
<section>
<book&...
0
votes
1
answer
453
views
How to correctly concatenate XPath?
I try to match multiple elements and all their occurences through concatenation.
I tried two expressions
concat(//h5,'###',//h5/following-sibling::p)
concat(//*/h5,'###',//*/h5/following-sibling::p)
...
0
votes
0
answers
74
views
XPath Append '-' to Element Values When Sibling Matches String
I am trying to create an XPath with v1.0 that returns a list of all amount elements Amt[@Ccy="EUR"]. However, it should be noted that if the sibling element of this element CdtDbtInd has the ...
1
vote
2
answers
137
views
How can I filter source XML and then pass the result on again as XML to process normally
I have a xslt and xml processing workflow where the document is processed from the root match and then various other processing elements are triggered. I now need to take that same workflow and inject ...
2
votes
1
answer
46
views
Range in XPATH 1.0
I'm writing a custom xml rule for SonarQube with XPath 1.0.
The parent version cannot be lower than 4.12.*
<?xml version="1.0" encoding="UTF-8"?>
<project>
<...
0
votes
1
answer
28
views
How to locate the element which has same class name and text as shown below
I need to click on the element which is there in the list but I am unable to click on the element I am using (//[@class="pb-dropdown__contents pb-dropdown__contents--no-margin pb-...
1
vote
1
answer
3k
views
How to select for content contains substring in Windows Event Viewer using XPath 1.0? [duplicate]
Windows Event Viewer (WEV) allows custom queries using "a subset of XPath 1.0."1 I've been unsuccessfully struggling for a couple hours to craft a query that works. I'm hoping someone on ...
1
vote
3
answers
81
views
how to implement when in xpath where i want to validate a parent node is same as present in condition?
"name" : "a",
"type": "container",
"kids": [{
"name": "a1",
"type": "container"...
1
vote
1
answer
63
views
Webscraping with Selenium using Xpath
I'm looking for some numbers on https://tnnslive.com/
The numbers I'm looking for on tnnslive.com:
If I copy the xpath in Chrome, I get:
//*[@id="root"]/div/div/div/div/div/div/div/div[2]/...
0
votes
1
answer
17
views
Fetching an Xml Listobject depending on the value in one of its keys
I am currently going through an xml data,
<datas>
<data>
<key1>ABC</key1>
<key2>def</key2>
</data>
<data>
<key1&...
0
votes
1
answer
54
views
Select ancestor based on the attribute value of the selected node
input.xml file -
<?xml version="1.0" encoding="utf-8"?>
<sg:EmployeeDetails xmlns:sg="http://sg.iaea.org/ssac-qs/qsSchema.xsd">
<sg:FirstName>Sagar&...
0
votes
2
answers
48
views
XPath get element value from XML
I have below XML
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns="urn:partner.soap....
0
votes
1
answer
27
views
how to get the element with text in xpath1.0
when i use text as follow , but it doesn't work
//button[contains(text(),"Project Association")]
how to get the element "button" with specific text in xpath 1.0
<div data-v-...
-1
votes
2
answers
136
views
Match only the deepest child instead of its parent
I have this example HTML:
<div class="_bns--table">
<table class="bns--table" border="0" cellspacing="0" cellpadding="0" width="...
-1
votes
1
answer
87
views
Match elements containing both a specific case-insensitive whole word and any number of any digits
Example HTML:
<root>
<td><p><b>Random Text</b></p>
<p><b>Random Text:</b> Random Text</p>
<p><b>Random Text:</b> 001057567&...
0
votes
1
answer
134
views
Match elements containing both specific text and any number of any digits
I'm looking for an XPath 1.0 query that would look somewhat like this:
//*[contains(text(), 'EXAMPLE') and translate(text(), translate(text(), '0123456789', ''), '') != '']
But the problem with this ...
0
votes
1
answer
117
views
Xpath 1.0 get unique values with limited scope
I am wokring with XML and XPATH v1.0, specifically using libxml2's Schematron module, that I am quite sure that uses the Xpath module for the assert tests. So in order to simplify the problem, lets ...
0
votes
2
answers
49
views
xsl 1.0 code to create an distinct elements not working
I have this xsl 1.0 call-template.
It takes the two xml-elements, given as parameters and returns an element created from both parameters, but with distinct Elements. All doubles should be removed
<...
1
vote
2
answers
88
views
How to write xpath for li content for breadcrumb items
I want to write an xpath for verify the Custom Report text without index.
HTML:
<ol>
<li>
<a href="https://dumpy.url.com">Lw2_0702230135</a>
</li&...
0
votes
0
answers
137
views
How to sum two XPATH Values
I need to sum the values of the following two XPATHS
1: /data/dealerLoanApplication[1]/licenseFee[1]
2: /data/dealerLoanApplication[1]/titleFees[1]
When I test the above XPATHs separate I get the ...
1
vote
1
answer
250
views
Find child element by xpath
public WebElement findChildByXpath(WebElement parent, String xpath) {
loggingService.timeMark("findChildByXpath", "begin. Xpath: " + xpath);
String parentInnerHtml = ...
0
votes
1
answer
2k
views
How to select an element from Span tag using xpath or css selector
I'm trying to automate process of pinging a person on a messenger on selecting the messenger name(Nayan)
Please find the Html code
<div class="Presence__text">
<span class="...
3
votes
3
answers
931
views
How to fix the #SPILL! Error by displaying only the second value?
I have a column with some info displayed like that:
Product Info
I am the 3rd product from 2020
I was created in 1995 and I went public in 2021
I am a not sure if I'm from 2019 2020 2021
I have a ...
0
votes
3
answers
5k
views
How to find xpath of this button
enter image description here
<button class="MuiButtonBase-root MuiButton-root MuiButton-contained MuiButton-containedPrimary MuiButton-sizeMedium MuiButton-containedSizeMedium MuiButton-root ...
1
vote
1
answer
43
views
XPATH get node based of value of another node
Im trying to filter an XML File based on the value of the node
<MIME_INFO>
<MIME>
<MIME_TYPE>image/jpeg</MIME_TYPE>
&...
1
vote
1
answer
272
views
XPath 1.0 get tag with dot in the attribute name
I want to get <sonar.exclusions>, <jacoco.line.min.coverage> and <jacoco.complexity.min.coverage> from the pom.xml
<?xml version="1.0" encoding="UTF-8"?> &...
0
votes
3
answers
459
views
Excluding tags with links using Xpath
I want to exclude all elements that contain links, using xpath
<p/>...</p>
<p/>...</p>
....
<p/>
<strong/>
<a href="https://exapmle.com" rel="...
0
votes
1
answer
53
views
XPath on lxml's iterparse matches elements outside its scope
I have huge corpora that I am parsing with lxml, so I am using iterparse which makes it easy to read XML on-the-fly. By using iterparse(fh, tag="your_tag") we can efficiently iterate over ...
0
votes
1
answer
68
views
number() not supported in LXML XPath parsing?
I am running into some unexpected issues with XPath. I have a query that runs fine when using a database system like BaseX, but in Python with lxml it throws an error.
Here is an example:
import lxml....
1
vote
1
answer
88
views
Exclude elements from Xpath groups
I have a very complex HTML of a website. I want to select multiple groups of elements by relative Xpath. For example:
//div[@class="something] | //span/div | //div/span/div[@class="...
0
votes
1
answer
140
views
Multiple filters while doing Sum in XSLT 1
XML :
<A>
<B>
<C name="test name1" age="10">
<id>1</id>
<address/>
</C>
<C name=&...
2
votes
2
answers
323
views
XPath: multiple predicates vs logical And operator
When we have multiple terms to locate an element we can use a single predicate with logical and operator inside it or to use multiple predicates with single term inside each predicate.
For example on ...
0
votes
3
answers
253
views
Exclude Xpath from other Xpath
If you have two Xpaths you can join them with the | operator to return both their results in one result set. This essentially gives back the union of the two sets of elements. The example below gives ...
1
vote
1
answer
4k
views
Xpath ends-with expression does not work while starts-with does [duplicate]
I'm looking for some hint how to use xpath "ends-with" expression. I've got such element to find:
<div class="osaiowrhg29875n345" id="react-select-4-listbox">
...
5
votes
2
answers
10k
views
XPath: difference between "//*[contains(.,'sometext')]" and "//*[contains(text(),'sometext')]" [duplicate]
I want to clearly understand what is the difference between the following XPath expressions "//*[contains(.,'sometext')]" and "//*[contains(text(),'sometext')]".
From this great ...
0
votes
1
answer
483
views
XPath for extracting image scr with style attribute with the help of Screaming Frog
My goal is to extract image URLs together with style attribute (width and height) with the help of Screaming Frog.
<p style="text-align: center;"><img alt="Scary games are all ...
1
vote
1
answer
108
views
XML/Xpath 1.0: Checking if any descendant of a given node contains a specific attribute value?
I am working with a content management system that allows placing elements depending on XPath rules.
Here is a simplified example:
<...>
<chapter>
<node2>
<step tool=&...
0
votes
0
answers
91
views
How can I use Turkish character with XPath's translate() function?
I need a select element by xpath with text. In this case it should be case-insensitive. I added Turkish characters (Ç,Ö,İ,Ş,Ü,Ğ) in translate() function but its not working. Same method working ...
1
vote
1
answer
913
views
how to use xpath to click the element if the value is greather than?
I have XPath, which click the element when the value matches to 1800, but I want this to work only like if the value is greater than 1800, I am noob and I don't know about that I just googled,
Here is ...
0
votes
2
answers
160
views
How do I chose a chunk of tags that are in between of two tags?
(and including the ending tag)
For example:
<xml>
<a></a>
<a><b></b></a>
<a></a>
<a></a>
<a><c></c></a&...