cancel
Showing results for 
Search instead for 
Did you mean: 

XSLT mapping

Former Member
0 Kudos

Hi Guys,

I have to mapp the complete Idoc xml structure into a Single variable(String type) using XSLT.

Source structure is Eg:

<?xml version="1.0" encoding="UTF-8"?>

<MATMAS04>

<IDOC BEGIN="1">

<EDI_DC40 SEGMENT="1">

<TABNAM>EDI_DC40</TABNAM>

<MANDT>850</MANDT>

<DOCNUM>0000000000670745</DOCNUM>

<DOCREL>640</DOCREL>

<STATUS>30</STATUS>

<DIRECT>1</DIRECT>

<OUTMOD>2</OUTMOD>

...

..

Target variable is "Input" , type <xsd:string> .

I want all the above mentioned Idoc-xml into Input.

right now im getting the above values of the nodes but not the XML tags.

Could you please gimme a piece of XSLT for this ?

Thanks in advance

Kiran

Accepted Solutions (1)

Accepted Solutions (1)

former_member206604
Active Contributor
0 Kudos

Hi,

You can use copy-of XSLT function to achieve that

<input>

<xsl:copy-of select="path" />

</input>

Thanks,

Prakash

Former Member
0 Kudos

Hi Prakash,

Thanks a lot for your reply.

I tried with tht also but it is not working.

Could you please tell me

I shd write

<xsl:template match="/"> or <xsl:template match="MATMAS04"> ?? and

<xsl:copy-of select=?? is it MATMAS04?

Thanks

Kiran

Former Member
0 Kudos

Hi,

Check this link

try this

<xsl:template match="/">

<xsl:copy-of select="MATMAS04"/>

Hope this fixes your issue

Regards

Vishnu

former_member206604
Active Contributor
0 Kudos

Hi,

You can either use as Vishnu said

<xsl:template match="/">
<xsl:copy-of select="MATMAS04"/> 

Or you can also try using the child function.

<xsl:template match="/">
<xsl:copy-of select="child::node()"/>
</xsl:template>

Thanks,

Prakash

Former Member
0 Kudos

Hi Vishnu and Prakash,

Its working fine now. Actually it was working but I was using the wrong test instance to test the mapping.

Thanks a lotttttt!!!

Kiran

Answers (0)