SAX2: Namespace Processing and NSUtils helper class

Ray Waldin rwaldin at
Thu Dec 16 08:23:12 GMT 1999

I'm only a user of SAX and not an implementor, but I've always expected SAX 2 to include
namespace scoping events.  It seems a bit restrictive to completely hide these events from
an application.  For example:

<element1 xmlns="uri1" xmlns:p2="uri2">
  <ns2:element2 foo="bar" xmlns:p3="uri3" p3:whiz="bang"/>

would produce the following stream of events:

  startNamespace( prefix=null, uri="uri1" );
  startNamespace( prefix="p2", uri="uri2" );
  startElement( name="element1", attrList=null );
  startNamespace( prefix="p3", uri="uri3" );
  startElement( name="p2:element2", attrList={ foo="bar", p3:whiz="bang" });
  endElement( name="p2:element2" )
  endNamespace( prefix="p3" );
  endElement( name="element1" );
  endNamespace( prefix="p2" );
  endNamespace( prefix="p1" );

Simple management of these namespaces can be provided for in some helper class like the
NSUtils example, and can even be handled automatically for the most part in a new
HandlerBase2 class, but this decision of how (or whether) to handle namespaces could be
left to the application author.  Anyone else feel this way?


xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev at
Archived as: and on CD-ROM/ISBN 981-02-3594-1
To unsubscribe, mailto:majordomo at the following message;
unsubscribe xml-dev
To subscribe to the digests, mailto:majordomo at the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa at

More information about the Xml-dev mailing list