Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

can i use xpath to set values to elements?

Tags:

xpath

can i use xpath to set element properties ?

/html/body/form[@id='search']/select[@name='category' and @value='apple' and @type='select-one']

1 Answers

XPath, the XML Path Language, is a query language for selecting nodes from an XML document.

To set the value you can use something like a DOM parser and setAttribute('value', 'foo');

It might help if you actually told us if that returned anything or not. You can use count() to see if it returns anything, if not noticeable.

like image 173
meder omuraliev Avatar answered Oct 22 '25 05:10

meder omuraliev



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!