cancel
Showing results for 
Search instead for 
Did you mean: 

XML Namespace Error with XPATH condition

barath_dv
Participant
0 Kudos
148

Dear Experts,

We have below as the content which needs to be routed based on the field 'Message' value. 

<?xml version="1.0" encoding="utf-8"?>
<error xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">
  <code>06/019</code>
  <message xml:lang="en">Document  does not exist</message>
  <innererror>
    <application>
      <component_id/>
      <service_namespace>/SAP/</service_namespace>
      <service_id>TEST</service_id>
      <service_version>0001</service_version>
    </application>
    <transactionid>d828d56baed54a718432432e7cd27533</transactionid>
    <timestamp/>
    <Error_Resolution>
      <SAP_Transaction/>
      <SAP_Note>See SAP Note 1797736 for error analysis (https://service.sap.com/sap/support/notes/1797736)</SAP_Note>
    </Error_Resolution>
    <errordetails>
      <errordetail>
        <ContentID/>
        <code>06/033</code>
        <message>Document  does not exist</message>
        <propertyref/>
        <severity>error</severity>
        <target/>
        <transition>false</transition>
      </errordetail>
    </errordetails>
  </innererror>
</error>

 

Tried the condition = //innererror/errordetails/errordetail[contains(message, 'Document')]

Somehow, it is not working due to the namespace. I've also added the namespace in the runtime configuration as xmlns=http://schemas.microsoft.com/ado/2007/08/dataservices/metadata Still getting invalid namespace declared error. 

Appreciate your valuable inputs and support. 

Thanks,

Barath Vivekanandan

 

View Entire Topic
maik_bosch
Contributor
0 Kudos

As an addition to Ryan. I prefer to use XSLT below to clean the XML namespaces:

https://stackoverflow.com/questions/5268182/how-to-remove-namespaces-from-xml-using-xslt

snayak
Explorer
0 Kudos
Hi Barath, You can use this xml routing condition:- //*:innererror/*:errordetails/*:errordetail[contains(*:message, 'Document')]