Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 20th, 2005, 03:28 AM
Registered User
 
Join Date: Feb 2005
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default CDATA issue

Hi
I have asked a question fez days ago, I got my answer (thanks a lot) now I would like to use a CDATA and I have a huge issue
here is my XML

<?xml version="1.0" encoding="UTF-8"?>
<text>You have to pay
    <amount>18 000</amount > for this car
</text>

and my XSL

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" encoding="UTF-8" indent="yes" cdata-section-elements="data"/>
    <xsl:template match="text">
        <data>
            <xsl:apply-templates />
        </data>
    </xsl:template>

    <xsl:template match="amount">
            <xsl:apply-templates /> $
    </xsl:template>

</xsl:stylesheet>



I get this weird output:

<?xml version="1.0" encoding="UTF-8"?>
<data><![CDATA[You have to pay
        ]]><![CDATA[18 000]]><![CDATA[ $
    ]]><![CDATA[ for this car
]]></data>


but I would like to have


<data><![CDATA[You have to pay 18 000 $ for this car]]></data>


without all these CDATA and those whitespaces and return. Did I miss a parameter?

Thank you
Seb






Similar Threads
Thread Thread Starter Forum Replies Last Post
Nested Cdata Coolcampers XML 7 August 1st, 2008 03:07 PM
Add a CDATA section; add nodeset to CDATA section kssudhish XSLT 3 January 3rd, 2008 07:13 AM
question on CDATA rahulsinghania XML 1 January 9th, 2007 03:53 PM
CDATA haixia XSLT 0 August 7th, 2006 03:03 PM
CDATA section kai77 Beginning VB 6 0 October 31st, 2004 04:50 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.