Page 1 of 1

Need to know the XPath derivation in DS to read an xml

Posted: Wed Mar 02, 2011 4:34 am
by sendmkpk
hi,

I want to know the XPath derivation for the below XML, tried to figure it out for a while, but ......

want to read the name="MK_T_9117_MOD" and value="MMA" part

Here is the xml i have

<TranslationResponse xmlns="http://w3.ibm.com/xmlns/ibmww/crm/blueh ... nfigurator" xmlns:com="http://w3.ibm.com/xmlns/ibmww/com" xmlns:sap="http://www.ibm.com/bh/cnfg/fed/documents/sap">
<IBM_GWA_Metadata>
<com:CharSet>String</com:CharSet>
</IBM_GWA_Metadata>
<Messages highestSeverity="ok">
<Message severity="ok">ok</Message>
</Messages>
<Differences/>
<Document>
<GenericSAPDocument>
<sap:Material id="9117NEW" quantity="1">
<sap:LineItem>10</sap:LineItem>
<sap:ExternalReferences instanceGUID="12DE2C7688D000002200093F84B50000"/>
<sap:CharacteristicValue name="MK_T_9117_MOD" value="MMA"/>
<sap:CharacteristicValue name="MK_MTM" value="9117MMA"/>
<sap:CharacteristicValue name="MK_PROCESS_TYPE" value="NEW"/>
<sap:CharacteristicValue name="MK_SYSTEM_TYPE" value="9117"/>

Posted: Wed Mar 02, 2011 4:52 am
by sendmkpk
using
/sap:TranslationResponse/sap:Document/sap:GenericSAPDocument/sap:Material/sap:CharacteristicValue/@name
/sap:TranslationResponse/sap:Document/sap:GenericSAPDocument/sap:Material/sap:CharacteristicValue/@value

but no output is thrown.

Posted: Wed Mar 02, 2011 4:56 am
by sendmkpk
also tried

/defns:TranslationResponse/defns:Document/defns:GenericSAPDocument/defns:sap:Material/defns:sap:LineItem/text()

Posted: Wed Mar 02, 2011 5:10 am
by eostic
Could be a variety of things going on.

Just for structure's sake, I would suggest entirely removing the namespaces (just zap then in an editor in a small test document), then having a single column for CharacteristicValue and end the xpath with it (fill in the higher elements) .../.../CharacteristicValue/ Make it the repeating element and see if you get "n" rows for how many CharacteristicValue elements you have.

If not...then there's something else going on. If you get the rows you want, then at least you know the navigation is ok and it is probably a namespace issue.

What release are you using? (namespaces were a mess prior to 8.1 with FP1).

After seeing how it goes without any namespaces, what happens when you try:

/TranslationResponse/Document/GenericSAPDocument/sap:Material/sap:CharacteristicValue/

?

Ernie

Posted: Thu Mar 03, 2011 6:16 am
by sendmkpk
hi,

imported the TD from file and did it.