[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?

  • To: xml-dev@l...
  • Subject: Solved: Default attribute values at a higher level element?
  • From: "Andrzej Jan Taramina" <andrzej@c...>
  • Date: Mon, 11 Feb 2002 10:01:58 -0500
  • Organization: Chaeron Consulting Corporation
  • Priority: normal
  • Reply-to: andrzej@c...

xml tc attribute
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!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.