Lists Home |
Date Index |
- From: John Cowan <email@example.com>
- To: XML Dev <firstname.lastname@example.org>
- Date: Wed, 05 Aug 1998 10:23:19 -0400
Peter Murray-Rust wrote:
> Since namespaces are so fundamental I think it's very important that we
> outline the various ways forward. AIUI your filter sits on top of SAX
> whereas I suspect others (including at least myself privately) want SAX to
> do as much as possible. We don't want these to be incompatible.
ParserFilters sit on top of SAX, but in a SAX-compliant way:
a ParserFilter is a (SAX) Parser. This is deliberately analogous
to the way in which you can "push" modules onto a Java InputStream,
OutputStream, Reader, or Writer, and still have something that
conforms to that interface but can do new things as well.
So you instantiate your SAX parser of choice, instantiate
a NamespaceFilter, connect the two with a single call, and then
just use the NamespaceFilter as a Parser, because it is one.
The rest of your application doesn't change at all (except,
of course, that it gets QNames in universal format).
> This isn't much fun. It would be a very easy mistake to make. Can we
> package the NS stuff in a single file and do something like:
> <!DOCTYPE ABC SYSTEM "abc.dtd" [
> <!ENTITY % namespace1 SYSTEM "namespace1.ent">
> <!ENTITY % namespace2 SYSTEM "namespace2.ent">
> This makes sure it gets included.
Alas, no. Only if your parser is validating (and in SAX, there isn't
even a way to *ask* if a parser is validating) are you guaranteed to
process this. A NVP is free to treat the above as a comment.
> >> - IBTWSH
> >IBTWSH is non-namespace rather than single-namespace.
> My point was that if I use it in (say) VHG - as I intend to - it has to
> acquire a namespace. Thus:
> <VHG:termEntry xmlns:VHG="urn:vhg.co.uk:schema"> <!-- please tell me if
> this is wrong -->
> <VHG:term xml:lang="en" xmlns:xml="http://w3.org">XYZZY</VHG:term>
> <IB:P xmlns:IB="http://john.cowan.some.where">A magic word</IB:P>
> unless you intend that it should always have the null namespace xmlns="". I
> wouldn't think that a good idea.
I intend that IBTWSH always have the same ns as HTML, which is currently
the null namespace. So above, make it:
<P xmlns="">A magic word</P>
I am considering modifying the current IBTWSH DTD to define "xmlns" as
the null string in all elements. This is not strictly HTML-compatible,
but people usually feel free to extend HTML with new attributes.
John Cowan http://www.ccil.org/~cowan email@example.com
You tollerday donsk? N. You tolkatiff scowegian? Nn.
You spigotty anglease? Nnn. You phonio saxo? Nnnn.
Clear all so! 'Tis a Jute.... (Finnegans Wake 16.5)
xml-dev: A list for W3C XML Developers. To post, mailto:firstname.lastname@example.org
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/
To (un)subscribe, mailto:email@example.com the following message;
To subscribe to the digests, mailto:firstname.lastname@example.org the following message;
List coordinator, Henry Rzepa (mailto:email@example.com)