cancel
Showing results for 
Search instead for 
Did you mean: 

Read source XML as a string in expression editor

Former Member
0 Kudos

Hi all,

Is there any way to read an entire container objects source (an XML message) in an integration process as a string using an xpath expression in the expression editor?

I would like to pass the source XML of a container object as a string into an import parameter in a mapping.

I have solved for now by creating a separate mapping for each type of message. But I have many message types and would like to have just one mapping if possible, where at runtime I can pass a different message source.

I have looked for an xpath function that will return the XML source of a node but no luck.

I have seen the "use sap XML toolkit" checkbox on an operation mapping. Does this have any feature that would help?

Or, is there any way to pass a different source message schema into a mapping at runtime?

Thanks all,

RBL

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi.

I have a similar problem:

In the Expression Editor, my structure looks like this:

procNfe (element/type:procNfe)

CNPJRec (element/type: string)

procNFeStr (element/type: string)

I need to compare if the first 3 caracters in the infNFe-Id is iqual to NFe.

The following XPath Expression does not consider any TAG (anywhere I put X-outside any tag, it works. Therefore I need to search inside <infNfe....id="HERE">

XPath Expression:

/p1:procNFe[substring(p1:procNFeStr, 1, 1) = "X"]

Payload:

<n0:procNFe xmlns:n0="http://sap.com/xi/NFE/common"......>

<n0:CNPJRec>17469701009980</n0:CNPJRec>

<n0:procNFeStr><?xml version="1.0" encoding="UTF-8"?><nfeProc xmlns="http://www.portalfiscal.inf.br/nfe" versao="1.10"><NFe xmlns="http://www.portalfiscal.inf.br/nfe"><infNFe versao="1.10" Id="NFe35100217469701004911550010000000860089724956"><ide>...............

Any sugestions?