Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

XML -> CSV using XSLT

Status
Not open for further replies.

stoggers

Vendor
May 30, 2001
93
0
0
US
Hi,

I have an XSLT script that converts to CSV (comma separated) so that I can load the data into a database.

The problem I have is that the source XML contains embedded HTML tags encoded as escape sequences and I would like to retain these.

An example would be:

<para-text>Example &gt;P&lt;Example...</para-text>

Which is output as <P>Example...

This may seem fine but I need the escape sequences as the data is moving across code pages and the use of escape sequences is an easy way of ensuring transparency.

Assistance appreciated.

Thanks,

Stoggers.
 
Best thing would be to have the html-text in CDATA-sections in your XML:
<para-text><![CDATA[Example &gt;P&lt;Example...]]></para-text>

If that's no option you might try to fool xsl by setting the output method to xml and pretend to make CDATA-sections in your output:

<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl=">
<xsl:eek:utput method = "xml" cdata-section-elements ="para-text"/>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top