Skip to Content
avatar image
Former Member

XSLT mapping

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' ?>

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • avatar image
    Former Member
    Aug 14, 2008 at 07:11 PM

    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>

    Add comment
    10|10000 characters needed characters exceeded

  • Aug 14, 2008 at 08:24 PM

    String to XML:

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

    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

    https://blogs.sap.com/?p=40977

    Add comment
    10|10000 characters needed characters exceeded