[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: CData escaping

Subject: Re: CData escaping
From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx>
Date: Wed, 06 Feb 2002 12:54:04 -0500
xml cdata escaping
Paul,

Before we tell you how to do this, tell us why you want to so we can put on our Thought Police uniforms to tell you why it's not a good idea.

Really -- 99 times out of a hundred, this is a very poor solution to a common problem that has better solutions. And it's a FAQ.

For example -- let's say your problem is that your input

<one>1</one>
<two>2</two>
<one>3</one>
<two>4</two>
<one>5</one>
<two>6</two>

needs to come back as

<pair>
  <one>1</one>
  <two>2</two>
</pair>
<pair>
  <one>3</one>
  <two>4</two>
</pair>
<pair>
  <one>5</one>
  <two>6</two>
</pair>

A clean, conformant solution is

<xsl:template match="one">
  <pair>
    <xsl:copy-of select="."/>
    <xsl:copy-of select="following-sibling::two[1]"/>
  </pair>
</xsl:template>

<xsl:template match="two"/>

But what you want to do will not work in all XSL implementations, and is not required by the spec to be supported by a processor.

Cheers,
Wendell

Cheers,
Wendell

At 12:33 PM 2/6/02, you wrote:
Hi all,
 Very simply, I'm trying to do the following:

<![CDATA[</i>]]>

but the < and > are being escaped as &lt; and &gt; in the output which is
not what I want. How do output the symbols themselves? My output method is
html and I'm using xalan 1.2.

Thanks in advance,
Paul Brady.




XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list


======================================================================
Wendell Piez                            mailto:wapiez@xxxxxxxxxxxxxxxx
Mulberry Technologies, Inc.                http://www.mulberrytech.com
17 West Jefferson Street                    Direct Phone: 301/315-9635
Suite 207                                          Phone: 301/315-9631
Rockville, MD  20850                                 Fax: 301/315-8285
----------------------------------------------------------------------
  Mulberry Technologies: A Consultancy Specializing in SGML and XML
======================================================================


XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list



Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.