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


Help: OASIS Mailing Lists Help | MarkMail Help



   Encoding default attribute values at a higher level element?

[ Lists Home | Date Index | Thread Index ]

Is there any preferred way to allow encoding of a changed default attribute 
value at a higher level element?

For example:

Say I have a instance fragment that looks like this:

   <Waypoint UOM="other"> ...</Waypoint>  

Where Waypoint has an attribute called UOM which defaults to the value 
"degrees". eg <Waypoint UOM="degrees"> is the default.

Is there an good way to do specify the following in an XMLSchema:

<GPSData defaultUOM="radians">	
   <Waypoint UOM="other"> ...</Waypoint>  

And have the default UOM for each Waypoint EXCEPT the last now be 

My gut feel is that you could only do this in the processing application, but the 
question is how? I'm showing my ignorance of DOM/SAX validating parsers 
here so please bear with me

The problem I see is that a validating parser will build the tree using the default 
value of UOM (degrees) for all the Waypoints that do not explicitly specify a 
value.  But is there any way to check in an application program to know that 
this value was specified by default rather than explicitly and thus should really 
be "radians" as defined at the parent GPSData element level if it was allowed 
to default?  

Thanks for any insight you can offer.
Andrzej Jan Taramina
Chaeron Corporation: Enterprise System Solutions


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

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