Re: How to use ENTITY declarations and references?

Subject: Re: How to use ENTITY declarations and references?
From: David Carlisle <davidc@xxxxxxxxx>
Date: Wed, 5 May 1999 10:35:08 +0100 (BST)
> 1. If you declare an entity, shouldn't the XSL document have access to those
> entities? XT seems to think so, but LotusXSL differs.

The document will be parsed as XML so at that point the entities will be
recognised and expanded and, in this case, the character data will
go into the text node. The XSL processor itself won't know whether
you entered the character via an entity or by direct character input.

> 2. Why the &cent; in the output from XT?

You specified that your result tree should use the HTML4 namespace.
XSL processors can (and xt does) use the result tree namespace to
control the way in which the result tree is linearised. In this case
the result tree is not linearised as XML; it is written out as HTML.
Hence it gets a DOCTYPE declaration and then xt chooses to write
out certain characters as entities. Note it does this just because
the character is in a text node in the result tree. The character may
come from the stylesheet or the source document, and may or may not have
been entered as an entity, that does not matter.


> 3. Are the parsers simply looking for specific URIs when they determine
> whether the namespace declarations are valid? Is this really necessary?

Not sure what you mean. If the namespace declaration is syntactically
correct then it is valid. The processor does not try to look up that
URL. The processors may `know' certain namespaces and take special
action, here xt recognises the html4 namespace.

> 4. Where is the <!DOCTYPE> coming from in the output?
because you asked the result tree be written out as HTML4.

> And then if I change the stylesheet to use this (now invalid) namespace URI
> so that XT will parse it...
>   xmlns:xsl="http://www.w3.org/XSL/Transform/1.0";

Why do you say (now invalid)? That is the correct namespace for the
current draft of XSL. The one you changed from is the namespace for the
`now invalid' earlier drafts.

David


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


Current Thread