Using XPATH to query XML that contains a namespace definition
we have got problems while using XPATH with a XML document that contains a name space.
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
XPATH using /flowInputParam/action
does not return a result.
However, if the xmls... attribute is omitted, then the XPATH returns the expected result.
Any ideas why XPATH does not work if xmlns... attribut is defined?
Many Thanks in Advance
I am Operations Orchestration representative, regarding your request please take a look the next information:
When you use the xmlns=" http://com.mycompany.prj/HPOO_flow_input_param" on the root element of your XML puts the root and its descendants in the http://com.mycompany.prj/HPOO_flow_input_param. This effectively means that all of the element names in your XML document are preceded by http://com.mycompany.prj/HPOO_flow_input_param. Therefore the elements stated in your XPath are not in the http://com.mycompany.prj/HPOO_flow_input_param namespace. Then, your XPath will not matches nothing.
Using xmlns:conf="URL" instead of “xmlns”, the XPath will matches the element.
I hope this information help you, but if not doesn't hesitate to let me know and I will continue with my researches.
If you find this or any post useful to resolve the issue, please mark this thread as correct answer and other members can benefit with the information given
SW Support Technical Consultant
San Jose, Costa Rica
Hewlett Packard Enterprise “