SAX2 RFD: LexicalHandler draft v.1.1

David Megginson david at megginson.com
Tue Mar 23 22:33:21 GMT 1999


Don Park writes:

[dpm]

 > >  public interface AttributeValueHandler
 > >  {
 > >    public abstract void startEntity (String name)
 > >      throws SAXException;
 > >    public abstract void endEntity (String name)
 > >      throws SAXException;
 > >    public abstract void characters (char ch[], int start, int length)
 > >      throws SAXException;
 > >  }
 > >
 > >  public interface AttributeValue2 extends AttributeValue
 > >  {
 > >    public abstract boolean isSpecified (String name);
 > >    public abstract void accept (AttributeValueHandler handler)
 > >      throws SAXException;
 > >  }

[Don]

 > I don't think event-based interface is appropriate for this
 > purpose.  Why not introduce an interator or an array-like
 > interface?

Perhaps -- personally, I'm a little annoyed at having to do this at
all.  XML messed up a little here by making attribute values too
difficult to process.  

The problem is that even if you don't care about entity boundaries,
the XML 1.0 REC requires reporting of any entities that are not
expanded (in the case, for example, of a non-validating parser that
hasn't read the declaration in the external DTD subset).  As a result,
in a literal reading of the spec, a fully-conformant XML 1.0 API can
*never* treat attribute values simply as strings.  SAX 1.0 does so,
and no one has ever minded, but conformance is conformance...


All the best,


David

-- 
David Megginson                 david at megginson.com
           http://www.megginson.com/

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 (un)subscribe, mailto:majordomo at ic.ac.uk the following message;
(un)subscribe 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