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

SAX-ext proposal #2: Attribute isSpecified

  • From: David Brownell <david-b@p...>
  • To: xml-dev@l..., sax-devel@l...
  • Date: Wed, 01 Aug 2001 17:56:56 -0700

sax attribute
Attributes infoset extensions [ sax-Feature Requests-446713 ]

- One of the infoset properties for attributes is not supported by
  the current SAX2 API (including extensions):  a flag saying if
  a given attribute value was specified, or instead was defaulted.

- DOM expects this information, and building a DOM from a pure SAX2
  parser means that it can't expose this information

PROPOSAL

    - This is a slight modification of one from David Meggionson
      (see the RFE above for more information)

    - Define a new org.xml.sax.ext interface:

   public interface Attributes2 extends Attributes
   {
     public boolean isSpecified (int index);
     public boolean isSpecified (String uri, String localName);
     public boolean isSpecified (String qName);
   }
    
      That would be implemented by Attributes objects provided in
      startElement() callbacks, to expose this information.

    - Define a new org.xml.sax.ext class implementing that
      interface, inheriting from org.xml.sax.helpers.AttributesImpl

    - Define a new standard feature ID:

 http://xml.org/sax/features/use-attributes2
   Read-only

   If true, the Attributes object passed in startElement events
   will also implement the Attributes2 interface, and can be
   cast to it.
    
      Note that because of the way Java typing works, testing that
      feature would be optional:  applications could always try to
      cast (if they were willing to take the performance hit).

QUESTIONS:

    - Is there a better convention to use for extending interfaces
      than the numeric suffix?  (Meta-1)
    
    - Is the new implementation class really needed?  Alternative:
      update AttributesImpl.  (Meta-2)





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.