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

[SAX] How to keep entities unresolved in the result ?

  • To: <xml-dev@l...>
  • Subject: [SAX] How to keep entities unresolved in the result ?
  • From: "Aurelien Pernoud" <apernoud@s...>
  • Date: Wed, 8 Jan 2003 09:07:52 +0100
  • Importance: Normal
  • Reply-to: <apernoud@s...>

xslt keep entities
Hi there,

I'm using Sax in Java to parse an XHTML document.
Everything works fine, except that the entities found are always translated
by the parser to their equivalent in the characters() method :
&amp; becomes &
&nbsp; becomes space
&eacute; becomes é
This is fine, but how do I get the ref back ? I must in my case keep the
existant otherwise I get errors in the XHTML generated.

Moreover, depending of encoding issue, some entities such as &#8217; are
translated to "?". I've set the encoding to ISO-8859-1, and didn't find
which one to use to get back the &#8217; ...

I found a way to get the entity (startEntity / endEntity) using my own
handler for everything (DTD, Content, Error, lexical...), but it seems the
characters() method is called after all entities contained between two
elements are translated, so I don't know how to do what I want...
I've searched the xml-dev archive, there was an old thread about this, but
didn't end as I wanted it too :)
http://lists.xml.org/archives/xml-dev/200005/msg00211.html

I simply want to keep the #8217 or whatever was the entity, in the
characters() method.

Even more, if it's possible, I'd like not to resolve entities at all, cause
I don't work with it and it's causing me more troubles than solutions
(typical error is "Undefined entity...").

Thanks in advance,
Aurelien


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
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

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.