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 March 2nd, 2006, 11:24 AM
Authorized User
 
Join Date: Dec 2005
Posts: 71
Thanks: 10
Thanked 0 Times in 0 Posts
Default cdata-section-elements in xsl:output

Hi All,

Greetings.

I would like to know some clarification on using cdata-section-elements.

Used XSL:

<xsl:output method="xml" encoding="iso-8859-1" indent="yes" cdata-section-elements="alt" />

XML Input:

<alt>$$\sqrt {b^2 - 4ac}$$ </alt>


Observed Output:
<equation format="display">
<alt type="Tex">
<![CDATA[û&dollar;ûû&dollar;û\sqrt {b^2 - 4acû&rcub;ûû&dollar;ûû&dollar;û ]]>
</alt>
</equation>

Requested Output:
<equation format="display">
<alt type="Tex">
<![CDATA[$$\sqrt {b^2 - 4ac}$$]]>
</alt>
</equation>

My document contains all sort of iso entity were a character-mapping is done to obtain
those entity as follows "<xsl:output-character character="$" string="&dollar;"/>"
during this process it also converts the "$" inside <alt> which was
declared as a CDATA element in XSLT as shown above.

My questions:
1. I want the CDATA elements as shown above
2. I want to convert all special characters to its entity values and not the entity inside CDATA element.

û - #369;
LATIN SMALL LETTER U WITH DOUBLE ACUTE
is token generated during conversion which is also look as ^@ for visibility only in episilon


Thanks & Regards
ROCXY


__________________
Thanks,
Rocxy.
 
Old March 2nd, 2006, 11:44 AM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

According to the XSLT 2.0 serialization spec, characters in elements listed in cdata-section-elements should not be subjected to character mapping. See

http://www.w3.org/TR/xslt-xquery-ser...ion/#serphases

However, this area of the spec is still undergoing some last minute refinement.

Which XSLT 2.0 processor/version are you using? It's probably best to raise this on the appropriate vendor list.

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference





Similar Threads
Thread Thread Starter Forum Replies Last Post
Add a CDATA section; add nodeset to CDATA section kssudhish XSLT 3 January 3rd, 2008 07:13 AM
CDATA Section using XSLT misanaka XSLT 2 March 29th, 2007 06:53 PM
XSD CDATA Section chrisjonmcdonald XML 4 July 12th, 2006 08:15 AM
Load CDATA Section into DataSet monuindia2002 XML 1 April 25th, 2006 05:14 AM
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.