OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

ANN: SAX Filters for Namespace Processing

Last week at XTech (part of the O'Reilly Open Source Conference), Aaron
Skonnard gave an excellent presentation on Namespaces.  He brought up a
couple of issues which continue to bother me, but which have pretty much
no single (imposable) solution.

The first problem was the case of unqualified elements inside of
namespace-qualified elements:
<p:person xmlns:p="http://simonstl.com/person">

I'd really prefer to see things like this written as:
<p:person xmlns:p="http://simonstl.com/person">

So, I wondered, why not write a filter that would convert from the first
form to the second form?

The other case involves unqualified attributes.  It's clear that the
default namespace does not apply to attributes, but unqualified
attributes remain somewhat anomalous themselves, not part of the element
containing them but not necessarily a participant in the namespace.
Things like:

<p:person givenName="Chip" familyName="Skillet" />

While I'm not as troubled by this as by the element issue, there are
times (notably in RDF) where it's clearer to say:
<p:person p:givenName="Chip" p:familyName="Skillet" />

So again, why not write a filter?  (Thanks to Leigh Dodds for a push on

The two problems are very similar, and the code for the two filters is
only slightly different.  They share a simple pair of classes for
storing rules, and the code for the two is only slightly different.

More details, and version 0.01 of the filters, is available at:

This is a version 0.01, but the code is simple enough that the odds are
good it's a solid foundation.  (Yes, I need to work on more unit
testing.)  Version 0.02 will include RDDL documents at all the
namespaces used.

Also, I'm developing these filters and the Regular Fragmentations
filters as rule-based tools running from XML vocabularies.  I'm hoping
to modify the rule-loaders to be SAX filters, which would permit the
combination of multiple rule sets into single documents read at a single

Simon St.Laurent
Associate Editor
O'Reilly & Associates