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

Re: SAX2 Namespace Support

  • From: "Richard Anderson" <rja@a...>
  • To: "David Megginson" <david@m...>,"XMLDev list" <xml-dev-digest@i...>
  • Date: Mon, 20 Dec 1999 23:43:37 -0000

original prefixes
Why are you trying to complicate ours lifes :)

Please change these from:

>   public void startElement (String ns, String name,
>                             AttributeList atts)
>     throws SAXException;
>
>   public void endElement (String ns, String name)
>     throws SAXException;

to:

>   public void startElement (String nsPrefix, String ns, String name,
>                             AttributeList atts)
>     throws SAXException;
>
>   public void endElement (String nsPrefix,String ns, String name)
>     throws SAXException;

We can build ours DOM more easily this way dont have to buffer the other
namespace events.  I also would be surprised if at least 80% of SAX2 users
a) wouldnt mind this being present b) would probably use it

Anybody agree with me or am I standing in the dark all alone on this ?

Thanks,

Rich
----- Original Message -----
From: David Megginson <david@m...>
To: XMLDev list <xml-dev-digest@i...>
Sent: Monday, December 20, 1999 11:02 PM
Subject: SAX2 Namespace Support


> OK, here goes...
>
> Background
> ----------
>
> I accept Tim Bray's argument that Namespace-qualified names should be
> passed on in two parts and not one, and that Namespace-aware
> processing is the future of XML.
>
> I accept James Clark's argument that there must be a mechanism for
> passing on the original prefix if the parser supports doing so and the
> application desires it, if only for DOM2 support.
>
>
> General Rules
> -------------
>
> 1. By default, SAX2 parsers shall perform Namespace processing unless
>    explicitly requested not to do so.  There's no point having them
>    start in an indeterminate state, or in allowing SAX2 parsers not to
>    do Namespace processing.  I will provide a filter that can be
>    embedded in the driver for parsers that don't do NS processing
>    natively.
>
> 2. There will be features for (i) requesting that the original prefix
>    be prepended to each local name and (ii) turning off Namespace
>    processing altogether.  The default value for each of these
>    features will be false, and no parser is required to support either
>    of them.
>
> 3. If a LexicalHandler is set, the parser may use it to report the
>    scope of Namespace declarations.  Note that this is a little
>    brittle, and probably less useful than people think, but that it is
>    essential for XSLT.  Not all parsers will support LexicalHandler.
>
> 4. Namespace-qualified names are always reported as two separate
>    strings: the Namespace URI and the local name.  The local name may
>    have the original prefix prepended at client request, but the
>    prefix will not be there by default.
>
> The idea of all of this is that fully-cooked Namespace processing is
> the default behaviour and the normal, transparent operating mode for
> SAX2 -- most application writers need never know that other modes are
> available.
>
> However, there are optional, non-obtrusive mechanisms for passing on
> extra information (such as the original prefixes and the scope of NS
> declarations).  The presence or absence of support for these optional
> features can be determined by feature queries.
>
>
> Implementation
> --------------
>
> This implementation is based largely on suggestions from James Clark.
>
>
> [from org.xml.sax2.DocumentHandler]
>
>   public void startElement (String ns, String name,
>                             AttributeList atts)
>     throws SAXException;
>
>   public void endElement (String ns, String name)
>     throws SAXException;
>
>
> [org.xml.sax2.AttributeList]
>
>   public class AttributeList
>   {
>     public int getLength ();
>
>     public String getNamespaceURI (int i);
>     public String getName (int i);
>     public String getType (int i);
>     public String getValue (int i);
>
>     public String getType (String ns, String localName);
>     public String getValue (String ns, String localName);
>
>                     // For searching on prefixed names
>     public String getType (String name);
>     public String getValue (String name);
>   }
>
>
> [from org.xml.sax2.LexicalHandler]
>
>   public void startNamespaceDeclScope (String prefix, String uri)
>     throws SAXException;
>
>   public void endNamespaceDeclScope (String prefix)
>     throws SAXException;
>
>
> Unless someone shows a catastrophic problem with all this (not a
> purely aesthetic one), I plan to go ahead to other SAX2 problems now.
>
>
> All the best,
>
>
> David
>
> --
> David Megginson                 david@m...
>            http://www.megginson.com/
>
> xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev@i...
> Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/ and on
CD-ROM/ISBN 981-02-3594-1
> To unsubscribe, mailto:majordomo@i... the following message;
> unsubscribe xml-dev
> To subscribe to the digests, mailto:majordomo@i... the following
message;
> subscribe xml-dev-digest
> List coordinator, Henry Rzepa (mailto:rzepa@i...)
>


xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev@i...
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/ and on CD-ROM/ISBN 981-02-3594-1
To unsubscribe, mailto:majordomo@i... the following message;
unsubscribe xml-dev
To subscribe to the digests, mailto:majordomo@i... the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa@i...)



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-2011 All Rights Reserved.