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

Re: Comments and entities was:

Subject: Re: Comments and entities was:
From: James Clark <jjc@xxxxxxxxxx>
Date: Wed, 13 Jan 1999 11:49:01 +0700
comment entities
David Carlisle wrote:
> 
> > The XML spec leans heavily in the direction of Entity References being
> > resolved and flattened as the document is read in, which is fine for
> > browsers but may not be acceptable for earlier stages of processing.
> 
> With the (on the face of it) equivalent concept of internal entities in
> SGML one is (I think) forced to do that as there is no `internal entity'
> node in the grove model (as used by dsssl for example). It seems to be a
> great shame that this is not specified in XML.  I would have preferred
> it to be specified that they are always resolved, but leaving it
> unspecified seems to be the worst possible outcome.

Section 5.1 of the XML spec says clearly that all parsers are required
to resolve internal entity references.  (XML does gives flexibility on
external entity references, perhaps a little more than is necessary.)

> The DOM also specifies a slightly odd behaviour of keeping comments
> (which means they are not comments any more). Could  you confirm what
> happens in a DOM based XSL system if I go
> 
>  <xsl:template match="apply">
>    <!-- hello world: this is a comment in my stylesheet -->
>  <xsl:apply-templates
>      .....
> 
> Does the comment node find its way into the template and then into the
> output document?

If it does, then it's a bug in that XSL implementation. XSL specifies
that such a comment would not find its way into the output document. (In
2.4, "Neither processing instruction nodes nor comment nodes are
included in the tree for the stylesheet".) If you are implementing XSL
on top of the DOM, then you need to ignore comment nodes and PI nodes in
the stylesheet.

James



 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.