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

Re: How to ??

  • From: "Bill la Forge" <b.laforge@j...>
  • To: <xml-dev@i...>
  • Date: Wed, 17 Mar 1999 13:08:24 -0500

setspecified all attributes
>If so, my reading is that those are deviations from the DOM Recommendation -- in
>other words, bugs.


Frankly, I think the problem is more with the fact that they are SAX-based. 

Complicating matters is the lack of a method for setSpecified (DOM is somewhat
incomplete from the perspective of an application) and a particular DOM implementation
which uses a private variable for the specified variable. (I haven't looked at the
JavaSoft implementation yet. This was true for just one DOM implementation.) 

But subclassing was still viable. We just had to define a second specified variable
and override the isSpecified method to use it. This will all be included in the upcoming
(and still open source) production release of MDSAX.

Adding specified to SAX is really pretty simple--no changes to any interfaces is needed.
Its just a matter of subclassing the existing AttributeList interface in either the parser or 
a filter which has access to default values. The DOM builder then can check for the use
of this extended interface to access the specified value.

I've appended the AttributeList and Attribute interfaces to this email. This is what we're
working with now, though your input would be welcome. In my mind, including these
interfaces (or something similar) in ModSAX/OpenSAX/SAX2 would be the best of all
worlds.

Bill

public interface MDAttributeList extends AttributeList
{
 /*
  * Make this attribute list a copy of another
  */
  public void
 copy(AttributeList attList);

 /*
  * Get an attribute object (by name)
  */
  public MDAttribute
 getMDAttribute(String name);

 /*
  * Get an attribute object (by position)
  */
  public MDAttribute
 getMDAttribute(int i);

 /*
  * Add an attribute
  */
  public void
 putMDAttribute(MDAttribute att);

 /*
  * Remove all attributes
  */
  public void
 clear();

 /*
  * Remove an attribute
  */
  public void
 removeMDAttribute(MDAttribute att);

 /*
  * Remove an attribute by name
  */
  public void
 removeMDAttribute(String name);

 /*
  * Remove an attribute by position
  */
  public void
 removeMDAttribute(int i);

 /**
  * Returns the specified property for the ith attribute.
  */
 public boolean getSpecified(int i);

 /**
  * Returns the specified property for the named attribute.
  */
 public boolean getSpecified(String name);
}


public interface MDAttribute
{
 /*
  * Make this attribute list another, except
  * that the name of the attribute is not changed.
  */
  public void
 copy(MDAttribute att);

  public String
 getName();

  public String
 getType();

  public void
 setType(String type);

  public String
 getValue();

  public void
 setValue(String value);

  public boolean
 getSpecified();

  public void
 setSpecified(boolean specified);
}



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 (un)subscribe, mailto:majordomo@i... the following message;
(un)subscribe 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-2013 All Rights Reserved.