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

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   Solved: Default attribute values at a higher level element?

[ Lists Home | Date Index | Thread Index ]

I finally found out the answer to my question about defaulting of attribute 
values and overriding the defaults in a higher level element after a bit of 
digging into the SAX2 API.

Turns out the SAX2 Extensions specification (which Xerces supports) provides 
an alternative implementation of the Attributes interface, called Attributes2.  
Included in this extension is a method called isSpecified() that returns true if 
the attribute was actually specified in the tag rather than defaulting from a 
DTD/Schema.

This is exactly what I need for the semantics I want to use in GPSml.  By being 
able to determine whether an attribute was actually specified or defaulted, I 
can then take action to use a higher level default in the appropriate case (eg. 
Higher level default WAS specified, but lower level attribute was defaulted).

Awesome!  This makes the structure of GPSml more "intuitive" and "natural" in 
it's behaviour.

Thought I would pass this on since no-one else seemed to know the answer.  
Might save others some research.


Andrzej Jan Taramina
Chaeron Corporation: Enterprise System Solutions
http://www.chaeron.com





 

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

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