on 08-02-2007 10:45 AM
Hi everybody
Can anyone tell me the best way to transform parts of my xml file as CDATA ?
For some part of my xml file i need the '<' '>' instead of < and > .
Thanks for your help
hi,
you can do it in mapping
just add CDATA tags with UDF for example
Regards,
michal
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi michal
I tried using [[!CDATA in different formats as you suggested but none is producing the desired result. Can you identify which format you have exactly used and let me know please?
This is my xml file
<ns0:QueryString_Initial_MT xmlns:ns0="urn:ABG.com/EDI/PurchaseOrders">
<pin/>
<user_id/>
<pwd/>
<orders_lines>
<isbn>sfdg</isbn>
<record_dues>fgfh</record_dues>
<part_supply>fdg</part_supply>
<order_quantity>fdds</order_quantity>
<order_line_reference>ffg</order_line_reference>
<special_instructions>f</special_instructions>
<affiliate_id>dfg</affiliate_id>
<promotional_code>df</promotional_code>
</orders_lines>
<orders_ref>f</orders_ref>
</ns0:QueryString_Initial_MT>
I want the <orders_line> tag and its sub tags to be presented as a string.
Even an XSLT for it be a great help.
thanks a lot
Sudheer,
as per your requirement, the following XSLT would help:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ns0="urn:ABG.com/EDI/PurchaseOrders">
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
<xsl:template match="orders_lines">
<xsl:text disable-output-escaping="yes"><![CDATA[<![CDATA[
]]
>
]]>
However, it is strange not to have a wrapping tag around the string.
If you wanted only the subtags of <orders_lines> to be inserted in the string, just exchange the <xsl:copy> and <CDATA> tags.
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ns0="urn:ABG.com/EDI/PurchaseOrders">
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
<xsl:template match="orders_lines">
<xsl:copy>
<xsl:text disable-output-escaping="yes"><![CDATA[<![CDATA[
]]
>
]]>
Regards,
Henrique.
thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
>>For some part of my xml file i need the '<' '>' instead of < and >
well you can always find and replace '<' & '>' with '<' and '>'
Ranjit
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.