GNU bug report logs -
#20339
sxml simple: sxml->xml mishandles namespaces?
Previous Next
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
Hi,
I've embellished my proposed patch a bit:
- use values resp. call-with-values instead of passing around
lists.
This was one thing I didn't like about my first patch candidate:
the namespace --> ns abbreviation lookup had two things to return,
for noe the abbreviation, and whether this abbreviation was "new"
(for convenience in the form of a (namespace . abbreviation) pair).
Instead of returning a list, now it returns multiple values.
- patch is now against current stable instead of against "whatever
Debian stable packages", i.e. against
d680713 2015-04-03 16:35:54 +0200 Ludovic Courtès (stable-2.0) doc: Update libgc URL.
I'm still not sure whether this is the way to go (i.e. mixing the
abbreviation stuff into the serialization), or whether a pre-pass
(replacing namespaces by abbreviations and generating the namespace
declaration "attributes") would be the way to go.
Besides, I'd like to have some input on whether it'd be worth to
follow the usual convention and to put the namespace declarations
before regular attributes (forcing us to do two passes on a tag
node's attribute list). The generated XML looks pretty weird as
is now.
What I'd still like to introduce is a "mapping preference" as an
optional argument by the user, possibly per-node (like "I'd like
'http://www.w3.org/1999/xlink' to be abbreviated as 'xlink' or
something like that). Other XML serializers offer that. I envision
this as a function, the library would fall back to generate the
abbreviation whenever the function returns #f.
The question on whether this patch (or whatever it evolves into)
has a chance of getting into Guile is still open: I'd have to
get my papers from the FSF in this case.
Inputs?
[abbreviate-and-declare-namespaces.patch (text/x-diff, attachment)]
[signature.asc (application/pgp-signature, 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.