on 08-14-2008 7:04 PM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
78 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.