OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   Re: SAX: towards a solution

[ Lists Home | Date Index | Thread Index ]
  • From: Tyler Baker <tyler@infinet.com>
  • To: James Clark <jjc@jclark.com>
  • Date: Sun, 28 Sep 1997 19:41:54 -0400



James Clark wrote:

> /**
>  * An XmlAttributeSet is a set of named attributes each
>  * with a string value.
>  * Both specified and defaulted values are included
>  * and are not distinguished.
>  * Implied attributes are not included.
>  * The XML processor is free to modify the AttributeSet after the
>  * application returns from startElement.
>  * The application can use clone to make a copy of the AttributeSet
>  * which will not be modified by the XML processor.
>  */
>
> public interface XmlAttributeSet extends Cloneable {
>   /**
>    * Return the value of the attribute with this name, or null is the
>    * set does not include an attribute.
>    */
>   String get(String name);
>
>   /**
>    * Return the number of attributes in the set.
>    */
>   int getSize();
>
>   /**
>    * Get the name of the i-th attribute, where i is greater than or
>    * equal to 0 and less than the number of attributes in the set.
>    * The order of the attributes is not defined.
>    */
>   String getName(int i);
>
>   /**
>    * Get the value of the i-th attribute, where i is greater than or
>    * equal to 0 and less than the number of attributes in the set.
>    */
>   String getValue(int i);
> }
>
> You could use an Iterator or Enumeration instead of
> getSize/getName/getValue, but I think it would probably be more
> complicated and less efficient.
>
> James

For those looking at an OMG IDL language independent solution this might work...

module XMLParser {
  interface XMLAttributeSet {
    string get(in string name);

    long getSize();

    string getValue(in int i);
  };
};

CORBA 2.0 BTW will be a standard part of the JDK 1.2.

Tyler


xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev@ic.ac.uk
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/
To (un)subscribe, mailto:majordomo@ic.ac.uk the following message;
(un)subscribe xml-dev
To subscribe to the digests, mailto:majordomo@ic.ac.uk the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa@ic.ac.uk)





 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS