on 11-11-2008 8:26 PM
Hello Everybody,
I am generating an XML file using an FTP adapter and in the generated XML we are having first line as
<XML vesrion ... >, is there any way to remove this line from XML document?
Please provide your inputs as soon as possible.
thanks,
Vijay Kumar T.
Use this xslt:
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" omit-xml-declaration="yes"/>
<xsl:template match="*">
<xsl:copy-of select="." />
</xsl:template>
</xsl:stylesheet>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Open your Message Type in Integration Repository and from field 'XML Namespace', just delete it from there. Thta's it.
Regards,
Sarvesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I do not know your requirement but, and XML file file without XML tag header is invalid as per w3c standards.
VJ
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Vijay,
It is possible using XSLT mapping. We had simliar requirement.I have done that.
1. Convert you input XML data in String. Below is the code to do that
<a:ReceiveXml>
<xml>
<xsl:text disable-output-escaping="yes"><![CDATA[<![CDATA[]]></xsl:text>
<xsl:copy-of select="VendorLink"/>
<xsl:text disable-output-escaping="yes"><![CDATA[]]]]></xsl:text>
<xsl:text disable-output-escaping="yes"><![CDATA[>]]></xsl:text>
</xml>
</a:ReceiveXml>
2. Use Replace function of mapping to rempove XML declaration.
3. Convert String to XML data again usiong XSLT mapping.
<?xml version='1.0'?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:tns="your namespace">
<xsl:template match="/">
<xsl:for-each select="//tns:xml">
<xsl:value-of select="." disable-output-escaping="yes"/>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
You can find it on the SDN more about to convert XML to string and back to XML
Thanks
-Kulwant
Edited by: Kulwant Bhatia on Nov 12, 2008 4:06 PM
Hi Kulwant,
thanks for your inputs,
i have used XSLT mapping to convert the XML file ( after graphical mapping ) to string, below is the code that i used
<?xml version='1.0' ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<name>
<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>
</name>
</xsl:template>
</xsl:stylesheet>
with this above i am able to get entire xml document in one string but i am not able to see xml vesrion header line at all, it is having remaining data except first line.
Please suggest us.
Thanks,
Vijay Kumar T.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.