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

Re: escaping

Subject: Re: escaping
From: Mike Brown <mike@xxxxxxxx>
Date: Wed, 18 Jun 2003 18:58:38 -0600 (MDT)
Re:  escaping
Guy McArthur wrote:
> The description element of a RSS 2.0 item may contain entity-encoded 
> html. Is there an easy way to "escape" a block of input xhtml, when the 
> output is xml? Small example of what the output should look like:
> 
> <?xml version="1.0"?>
> <rss version="2.0">
>    <item>
>      <description>
>         &lt;p&gt; This is a paragraph of html. &lt;/p&gt;
>      </description>
>    </item>
> </rss>
> 
> Which is pretty silly, don't know why they didn't allow it to be xhtml, 
> and/or use namespaces.

Tags and other artifacts of serialization are nonexistent in the XPath/XSLT
data model, since XML parsers are designed to sift through all that and
tell applications such as XSLT processors only about the important logical
constructs (elements, attributes, character data, and their relationships
to one another).

So what you are asking for is a way to serialize this parsed data (nodes in
the source or result tree) during processing, putting the serialized markup
and text into a text node child of the description element. This is painful to
do in XSLT but not impossible. Have a look at

 http://www.xmlportfolio.com/xml-to-string/

In your stylesheet you just need to call the xml-to-string template, passing
the node-set parameter that contains the top of the XHTML nodes you want to
serialize.

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


Current Thread
  • escaping
    • Guy McArthur - Wed, 18 Jun 2003 19:34:35 -0400 (EDT)
      • Mike Brown - Wed, 18 Jun 2003 20:58:39 -0400 (EDT) <=
      • Michael Kay - Thu, 19 Jun 2003 09:45:57 -0400 (EDT)

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.