extraneous :'s?
Jonathan A Rees <[email protected]> Fri, 8 Dec 2006 09:13:06 -0500
| Newsgroups | gmane.lisp.scheme.ssax-sxml |
|---|---|
| Message-ID | <[email protected]> |
I don't really understand the rationale for the :'s introduced when
reading Qnames, and for my application (reading RDF/XML) they're an
inconvenience.
Input file:
<rdf:RDF xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#'
xmlns:x="http://mumble.net/">
<x:thing>
<x:verb resource="http://mumble.net/thing" />
</x:thing>
</rdf:RDF>
(call-with-input-file "loser.rdf"
(lambda (in) (ssax:xml->sxml in '()))))
=>
(*top* (http://www.w3.org/1999/02/22-rdf-syntax-ns#:RDF
(http://mumble.net/:thing
(http://mumble.net/:verb
(@ (resource "http://mumble.net/thing"))))))
My understanding of Qnames is that the namespace prefix is
concatenated with the name part of the Qname. The : as far as I know
is idiosyncratic to the SXML specification. In the case of rdf/xml
this makes a difference, since anyone processing the above rdf/xml
will want the URI representing the x:thing Qname to be the same
string as the value of the resource= attribute.
I can work around this by replacing Qnames with URI's that have :
spliced out. I would need to re-insert the :'s on output.
I'm writing so that someone can explain the SXML philosophy that led
to the :'s in the first place, so that I can tell whether this is a
bug or a feature.
I haven't recently looked at the XML spec to see what it has dictates
about the relations between namespaces, Qnames, and URI's - I was
hoping someone here would save me the trouble. Is concatenation
strictly required by XML? E.g. if you write xmlns:foo=abc and
xmlns:bar=abcde, are the Qnames foo:defg and bar:fg *required* to be
considered interchangeable?
Thanks
Jonathan
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV