AnsweredAssumed Answered

XML namespace issues

Question asked by ToddDixon on Oct 15, 2017
Latest reply on Oct 16, 2017 by nicolai

Hi everyone.

 

In essence my goal is to implement simple inventory management in to my eBay store database that I have written.  Using Base Elements HTTP functions I have successfully extracted a response from eBay for a specific variation of an item. This will be the core routine I will use to populate a field which shows what eBay is listing as quantity for an item versus what my database thinks I have.

 

With this function working perfectly I now have a nice bunch of XML in a field and I now I want to get the appropriate Quantity field from that data. After playing with BE_Xpath and bashing my head trying to work out why it wasn't working I discovered that if I removed...

 

xmlns="urn:ebay:apis:eBLBaseComponents"

 

...from the code it would extract the appropriate node value as I wanted.  Doing more research I found this is a 'namespace' and that this what is getting in my way.  Realising that BE_Xpath has an optional parameter for  this I have tried to work out how to create a call to this function with the appropriate parameters to allow the function to effectively ignore the namespace.  I would prefer to use this function to its fullest rather than writing code to strip the xmlns line from the field.

 

The function description is BE_XPath ( xml ; xpath {; namespaceList ; asText } ) but how on earth do I code the "namespaceList" parameter to help Xpath navigate through "urn:ebay:apis:eBLBaseComponents"?

 

I have done lots of searching but I can't get my head around the syntax of it.  Can any kind should give me a leg up here?


Thanks

Outcomes