[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

ANN: SAX Filters for Namespace Processing

  • From: "Simon St.Laurent" <simonstl@s...>
  • To: xml-dev@l...
  • Date: Mon, 30 Jul 2001 20:35:27 -0400

ann sax
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">
<givenName>Chip</givenName>
<familyName>Skillet</familyName>
</p:person>

I'd really prefer to see things like this written as:
<p:person xmlns:p="http://simonstl.com/person">
<p:givenName>Chip</p:givenName>
<p:familyName>Skillet</p:familyName>
</p: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
this.)

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:
http://simonstl.com/projects/namespace/docs

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
parse.

Simon St.Laurent
Associate Editor
O'Reilly & Associates


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.