cancel
Showing results for 
Search instead for 
Did you mean: 

XSLT mapping issue.

Former Member
0 Kudos

All,

Im having this following XSLT do the mapping..

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format">

<xsl:template match="/">

<ns0:Target xmlns:ns0="urn:Target">

<sessionid><xsl:value-of select="MT_SOURCEMESSAGE/dataId"/></sessionid>

<TargetMsg>

<xsl:text disable-output-escaping="yes"><![CDATA[<![CDATA[]]></xsl:text>

<xsl:copy-of select="MT_SOURCEMESSAGE/Source"/>

<xsl:text disable-output-escaping="yes"><![CDATA[]]]]></xsl:text>

<xsl:text disable-output-escaping="yes"><![CDATA[>]]></xsl:text>

</TargetMsg>

</ns0:Target>

</xsl:template>

</xsl:stylesheet>

the issue is when we get the source message in the following format,

<ns0:MT_SOURCEMESSAGE xmlns:ns0="http://mycomp/test">

<sessionId>1223221</sessionId>

<Source>

<Employee>

<Id>252103175</Id>

<Name>Sam</Name>

</Employee>

</Source>

</ns0:MT_SOURCEMESSAGE>

the mapping fails...

IF I REMOVE the "ns0:" in the source message, it works. What command in the XSL should i use to overcome this?

Thanks

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

You can get rid of the namespace also. Check this weblog:

/people/sameer.shadab/blog/2005/12/05/how-to-remove-namespaces-in-mapping--xi

or

Check question 12 in Integration engine section of michals weblog:

/people/michal.krawczyk2/blog/2005/06/28/xipi-faq-frequently-asked-questions

Regards,

---Satish

Answers (1)

Answers (1)

Former Member
0 Kudos

Replace <xsl:copy-of select="MT_SOURCEMESSAGE/Source"/> with <xsl:copy-of select="//MT_SOURCEMESSAGE/Source"/>

it shud work...as it specifies a relative path

praveen

Former Member
0 Kudos

i tried that, but still it is coming empty. Any thoughts?

Thanks,

Former Member
0 Kudos

try this...it worked on my machine

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format">
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes" />
<xsl:template match="/">
<ns0:Target xmlns:ns0="urn:Target">
<sessionid><xsl:value-of select="//sessionId"/></sessionid>
<TargetMsg>
<xsl:text disable-output-escaping="yes"><![CDATA[<![CDATA[

]]
>



]]>

praveen