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

Re: Confused about entities

Subject: Re: Confused about entities
From: "andrew welch" <andrew.j.welch@xxxxxxxxx>
Date: Tue, 14 Mar 2006 13:50:15 +0000
html entities pipeline
On 3/14/06, Gary Stewart <the.stewarg@xxxxxxxxx> wrote:
> Hi there,
>
> I've been trying to search for a solution, in XSLT, to convert HTML
> encoded entities (such as &nbsp;) into the unicode entity (such as
> &#A0;) while going through the pipeline. Basically an XML document to
> be processed includes the HTML entities but I want to change them for
> the target document. The document is later put into another XSL
> template and that's where it reports that "he entity "nbsp" was
> referenced, but not declared". I've tried declaring a DTD in the first
> document for the stylesheet hoping that would do the conversion but it
> doesn't seem to have. Is there a way to do this in XSLT or to get the
> second stylesheet to understand the entities even if they aren't
> included with the XML document passed to it.
>
> Thanks, sorry that my brain doesn't seem to be able to get around
> this; I looked at a few search results and they didn't seem to make
> much sense.

If you are outputting HTML and you want to re-transform it later, then
you'll need to either convert that HTML into XML using something like
Tidy, or don't output HTML in the first place.

Ideally, if you know you are going to reparse the output of a
transform then don't output HTML - use the XML output method if you
are using XSLT 1.0 or the XHTML output method if you are using 2.0.
Only ever use the HTML output method at the very end of the processing
chain.

cheers
andrew

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.