on 08-11-2020 6:15 AM
Hi,
I'm trying to use the Content Modifier to retrieve some fields from a SuccessFactors oData standard XML payload. The Atom XML has the following root node with namespaces defined:
<entry xmlns="http://www.w3.org/2005/Atom" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xml:base="https://api10preview.sapsf.com:443/odata/v2/">
I have added the namespaces to the CPI iFlow> Runtime Configuration> Namespace Mapping as:
xmlns=http://www.w3.org/2005/Atom;xmlns:d=http://schemas.microsoft.com/ado/2007/08/dataservices;xmlns:m=http://schemas.microsoft.com/ado/2007/08/dataservices/metadata
However CPI complains that I don't have a prefix for the default namespace with "Enter a valid collaboration namespace eg. xmlns:test=http://test.com/test". When I remove the default namespace or add an alias/prefix to the default CPI is happy, but at runtime the XPath isn't evaluated successfully and I get no data returned.
There are ways around the issue (eg. remove namespaces from the XML, remove just the default namespace from the XML, tried wild-carding the default namespace elements in the XPath but that didn't pass validation) however I don't believe I should have to and assume I just need to know a 'default' namespace prefix alias (or some similar small tweak).
How do I specify a default namespace along with explicit aliased namespaces?
Thanks,
Jason
I've found an acceptable workaround:
Basically create an alias for the default Namespace and reference that in your XPaths:
eg. xmlns:a=http://www.w3.org/2005/Atom
Then in the XPath use the alias prefix for the default namespace eg. /a:entry/a:content/m:properties/d:firstName
Its not ideal, but a simple workaround. Still interested to know if there is a way to use the default namespace though.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
you are right , if you have many fields to take xpaths and complex namespaces are there then it might help, otherwise, our approach is fine. as an example,i taught of it.
Thanks,
Vijay
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi ,
One way i think is , if you have a standard structure then do a mapping with source as EDMX and Receiver with the expected XSD. Then it will produce simple xml from the atom-xml.
Thanks and Regards,
Vijay.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Vijay,
Thanks for the response. As I mentioned in my question, I realise that there are several possible workarounds which involve transforming the incoming payload. However I don't believe you should need to do that to access basic Xpath functionality on XML produced by a standard SAP system (or any other internet standard system for that matter).
I should be able to create my Xpath in Oxygen based on the SuccessFactors oData payload (which I did) and use the resultant XPath without having to transform the payload or introduce an artificial namespace alias/prefix.
Thanks again for the response.
User | Count |
---|---|
77 | |
9 | |
7 | |
6 | |
6 | |
6 | |
6 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.