xml-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Simon Tyler" <tylersi...@hotmail.com>
Subject Removing attributes and XML Schemas
Date Thu, 18 Jan 2001 12:13:01 GMT


I've been using Xerces-J 1.2.3 with XML Schemas and the DOM parser; and I've 
come across a slight oddity. I was wondering if anyone else had noticed this 
and whether it is a bug or not.

I have a number of attributes specified in my XML Schema with default 
values. When I read an XML document they quite correctly get the default 
value if not specified and the getSpecified() method returns false as 
expected. If they are specifed then getSpecified() returns true and I see 
the specified value. OK so far.

Now if I delete (using removeAttribute()) a specified (or un-specified for 
that matter) attribute which has a default specified in the schema, I was 
hoping that the getSpecified() method would return false and I would be able 
to see the default value in the DOM. Certainly the documentation for 
getSpecified() states this for DTDs as it says:

"To re-specify the attribute as the default value from the DTD, the user 
must delete the attribute. The implementation will then make a new attribute 
available with specified set to false and the default value (if one exists)"

Is this a bug, a feature or have I mis-understood something? Any got any 
work arounds for it?

Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

View raw message