cancel
Showing results for 
Search instead for 
Did you mean: 

XSLT mapping

Former Member
0 Kudos

Hi all,

We have a mapping from an XML to a specific XML message format - the weird thing is the webservice we are sending it to requires that it be sent as a single string <inputXML>string</input XML> even though there are a couple hundred elements. So I need transform the result of my formentioned map into a string and also add a namespace. I tried doing so using XSLT but that doesn't work. Can any body please find the error in that ? This is what the scenario looks like in the webservice we are hitting ...

XSLT:

<?xml version='1.0' ?>

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:impl="http://services.web.tessco.com/">

<xsl:template match="/">

<impl:sendPOConfirmation>

<impl:inputXml>

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

<xsl:copy-of select="impl:VendorLink"/>

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

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

</impl:inputXml>

</impl:sendPOConfirmation>

</xsl:template>

</xsl:stylesheet>

Can anybody please suggest the error. I cannot get the XML as string in inputXML tag

Regards,

Kulwant

Accepted Solutions (0)

Answers (2)

Answers (2)

GabrielSagaya
Active Contributor
0 Kudos

String to XML:

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

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

<xsl:template match="/">

<my_tag>

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

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

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

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

</my_tag>

</xsl:template>

</xsl:stylesheet>

check Henrique Pinto's reply for that blog

Former Member
0 Kudos

Is VendorLink root element?

try

<impl:inputXml>

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

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

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

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

</impl:inputXml>