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

RE: XML parsers and entity references (was RE: Using Entity

Subject: RE: XML parsers and entity references (was RE: Using Entity Reference s in XSL Templates)
From: Kay Michael <Michael.Kay@xxxxxxx>
Date: Mon, 24 Jan 2000 09:47:20 -0000
using entity xml
> I'm not that familiar with what parsers do, but I was under 
> the impression that a SAX based parser simply reports in a consistent
> "hey I found the beginning of an element 'foo'" and "hey I found an entity

> reference 'nbsp' which refers to the UCS character 160" and so on, and 
> it was up to the application using that information to decide whether or 
> not to preserve info about the entity references or their expanded values.

A SAX parser reports data to the registered DocumentHandler after resolving
entity references, so the DocumentHandler never gets to know whether the
text comes from the main document or from an entity that it references.

You also have the option of registering an EntityResolver which is called
when an external entity is referred to, the purpose of this is to allow you
application to locate the entity being referred to (e.g. it might be in a
database somewhere). This allows you, if you wish, to treat data in an
external entity differently from data in the main document, but you have to
work hard to achieve this.

Character references such as &#160; and internal entity references (IIRC)
are not notified to the application at all, the application just gets to see
the expanded text.

Mike Kay

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

Current Thread


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.
First Name
Last Name
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.