← Prev in month ← Prev in thread
Next in thread → Next in month →

Solved: Default attribute values at a higher level element?

From
Andrzej Jan Taramina <>
To
Date
2002-02-11T15:01:58Z
ID
<3C679696.27835.E946498@localhost>
Thread
Solved: Default attribute values at a higher level element?
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
← Prev in month ← Prev in thread
Next in thread → Next in month →