[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] 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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|