SAX2: Namespace Processing and NSUtils helper class
Ray Waldin
rwaldin at pacbell.net
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"/>
</element1>
would produce the following stream of events:
startDocument();
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" );
endDocument();
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?
-Ray
xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev at ic.ac.uk
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/ and on CD-ROM/ISBN 981-02-3594-1
To unsubscribe, mailto:majordomo at ic.ac.uk the following message;
unsubscribe xml-dev
To subscribe to the digests, mailto:majordomo at ic.ac.uk the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa at ic.ac.uk)
More information about the Xml-dev
mailing list