GNU bug report logs - #20339
sxml simple: sxml->xml mishandles namespaces?

Previous Next

Package: guile;

Reported by: tomas <at> tuxteam.de

Date: Wed, 15 Apr 2015 19:48:02 UTC

Severity: normal

Full log


View this message in rfc822 format

From: John Cowan <cowan <at> ccil.org>
To: Ricardo Wurmus <rekado <at> elephly.net>
Cc: Andy Wingo <wingo <at> pobox.com>, 20339 <at> debbugs.gnu.org
Subject: bug#20339: sxml simple: sxml->xml mishandles namespaces?
Date: Mon, 4 Feb 2019 17:55:14 -0500
[Message part 1 (text/plain, inline)]
On Mon, Feb 4, 2019 at 3:45 PM Ricardo Wurmus <rekado <at> elephly.net> wrote:

\I changed name->sxml to use only the namespace aliases / abbreviations
> instead of the namespace URIs.


The trouble with that is that XML rnamespaces are lexically scoped, like
Scheme
local variables.  It is perfectly valid to map a prefix to more than one
URL,
as long as the namespace declarations are in either disjoint or nested
elements.  So you don't know what the absolute name of the element
or attribute is from just the prefix and the local part.

Furthermore, it is also legal to define more than one prefix for
the same URL, in which case names using either prefix are normally
treated as equivalent (however, you can't have elements like
<a:foo>...</b:foo>
even if a and b map to the same namespace).

* Is the value for “namespaces” that’s passed in to the
>   FINISH-ELEMENT procedure always the same?
>
> * Will the second return value of the final call to FINISH-ELEMENT
>   really always be the complete list of *all* namespaces that have been
>   encountered?
>

Definitely not, only the namespaces that are currently in scope.

* Are there valid XML documents for which the match patterns to inject
>   namespace declarations would not apply?  (e.g. documents with a PI
>   element and two separate XML trees)
>

That's not well-formed: you can only have a single element tree per XML
document, although you can have any number of PIs, comments, and
whitespace (which is normally ignored) before and after.

-- 
John Cowan          http://vrici.lojban.org/~cowan        cowan <at> ccil.org
If I have seen farther than others, it is because I was looking through a
spyglass with my one good eye, with a parrot standing on my shoulder. --"Y"
[Message part 2 (text/html, inline)]

This bug report was last modified 6 years and 43 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.