[jdom-interest] Attribute defaults

Tom Dimock tad1 at cornell.edu
Tue Nov 20 11:29:43 PST 2001


At 01:48 PM 11/20/2001 -0400, Elliotte Rusty Harold wrote:
>At 8:41 AM -0800 11/20/01, Jason Hunter wrote:
>>I would very much like Attributes to have that ability.  I think it's a
>>feature we could have using an XNI-based builder.  It's only because SAX
>>doesn't provide it that you can't get this information from SAXBuilder.
>>Interestingly, it would be available using DOMBuilder.
>>
>
>SAX 2.1 is scheduled to provide this. API is still uncertain but see 
>http://www.saxproject.org/apidoc/org/xml/sax/ext/Attributes2.html

Ok, so using that I could look at each attribute as it was read and test
isSpecified. Whenever it returned false, I have "discovered" a default
value and could save it.  I guess I was hoping for a more direct way to
discover the defaults - this relies on reading an existing XML file in
which each attribute is defaulted at least once.  It would be useless if I
had built the tree programatically and then went to output it.  What is
really needed is to have the schema available through some API.

----------------------------------------------------------------------------
       Tom Dimock  ----  Cornell University  ----  tad1 at cornell.edu
"There go my people.  I must follow them, for I am their leader."  M. Gandhi



More information about the jdom-interest mailing list