Re: [xslt] Bug in exclude-result-prefixes?
- From: Daniel Veillard <veillard redhat com>
- To: xslt gnome org
- Subject: Re: [xslt] Bug in exclude-result-prefixes?
- Date: Sun, 8 Jul 2001 18:47:55 -0400
On Sun, Jul 08, 2001 at 05:46:24PM +0200, Thomas Broyer wrote:
> Le 08/07/01 02:28:20, Daniel Veillard a écrit :
> > This section is unclear.
>
> On the contrary, I think it's quite clear.
Well I finally found a detailed explanation in Mike Kay's book
and it take no less than 4 pages and two graphics to explain the
issue ... I would not say the problem is clear :-\ though Mike
made a really good description (pp. 282-286 in the first edition)
> Only namespace nodes are concerned.
And you are right
> > Also I don't see how you can output the node if your are not allowed to
> > generate a declaration for its namespace.
>
> The output tree must be a well-formed external entity. One may want files
> like these:
> doc1.xml
> <!DOCTYPE doc [
> <!ENTITY e SYSTEM "doc2.xml">
> ]>
> <doc xmlns:pre="prefix-URI">&e;</doc>
>
> doc2.xml
> <pre:elt/>
>
> The resulting doc is a well-formed XML document and conforms to the XML
> Names spec:
> <...strip the doctype...>
> <doc xmlns:pre="prefix-URI"><pre:elt/></doc>
>
> doc2.xml is a well-formed external entity even without namespace
> declaration.
It's a very bad idea to have an entity not being self contained
w.r.t namespace declarations.
<book>
<doc xmlns:pre="prefix-URI">&e;</doc>
<doc xmlns:pre="prefix-URI2">&e;</doc>
</book>
Becomes an horrible mess to handle, makes implementing DOM really hard
and honnestly have very little gain. And if you check libxml will warn
about those. Entities well-formedness in presence of namespace ought to
have a "self-contained" clause, this is not the case and have made enough
harm already.
I think I prefer dropping the possibility of doing this than enabling
it.
> None of these XSLT processors strips element nodes, either they exclude the
> namespace declaration (as I expected them to do) or they perform some
> "namespace fixup" (adding back the removed namespace declaration, as the
> dropped XSLT 1.1 WD said).
> That's the way I interpret these results...
yep, thanks, I'm gonna clean this up. Sounds to me that actually the
original implementation ignoring the namespace declarations and generating
only the ones needed was the cleanest, but I can see cases where one
don't want to have thousands of declarations on individual nodes but
rather keep them on the parent.
Will try to fix this.
Daniel
--
Daniel Veillard | Red Hat Network http://redhat.com/products/network/
veillard@redhat.com | libxml Gnome XML XSLT toolkit http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
Sep 17-18 2001 Brussels Red Hat TechWorld http://www.redhat-techworld.com
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]