|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Comments and entities was:
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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








