Notifications
Announcements
Hi,
When I use set XML element value, I am getting the error "Xpath expression returned no element". Please refer to the screenshots.
and the xml code:
I want to set the value for attribute "Id", but getting the error. Please help.
After removing the namespace xmlns it is working so definitely that is obstructing the xpath.
https://codebeautify.org/Xpath-Tester
Looks like there are some ways to bypass it
https://stackoverflow.com/questions/5239685/xml-namespace-breaking-my-xpath
https://stackoverflow.com/questions/4440451/how-to-ignore-namespaces-with-xpath
If you are not able to get the right way by doing a web search for this, then you could think of replacing the xmlns with a blank string and then set the new element value and then put back the xmlns. Just a thought.
Below is a sample using the XPath function.
/*[name()='Offering' and namespace-uri()='http://hogehoge.com/ns']/*[name()='OfferInXml']/*[name()='Data']/*[name()='Offer' and namespace-uri()='urn:nms:offer']/*[name()='Metadata']/*[name()='Id']
Hi, It worked! thanks
and may I know is it possible to get more attributes at once, for example under a particular tag, I need to extract all the tags value.
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
In our never-ending quest to improve we are simplifying the forum hierarchy…
We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Michael E. Gernaey 501 Super User 2025 Season 2
Tomac 323 Moderator
abm abm 237 Most Valuable Professional