You defined the attributes to have a default value. Since they are optional, they don't have to appear in the physical document. Since they have a default value, they assume the default value if they are missing from the document. If you don't want them to appear in the document as it is parsed, remove the default value from the schema.
Thanks, Donald Holliday -----Original Message----- From: Jing Tao [mailto:[EMAIL PROTECTED] Sent: Thursday, October 30, 2003 5:50 PM To: [EMAIL PROTECTED]; [email protected] Subject: SAX parser feature for attribute-default-value Hello, everyone: I am using xerces 1.4 sax parser to validate a xml document base on a schema. In the schema, there are some attributes defined as optional and have default value. After parsing the xml document, those attributes having default value are added to original xml document even though original xml doesn't have the attribute. For example: element "dataset" has an attribute "scope" is an optional and default value is "document". The orginal xml is: <dataset>dataset1</dataset> After parsing xml is: <dataset scope="document">dataset1</dataset> I don't want the xml will be modified by sax parser. So I am wondering if there is a feature can be set to turn off it. I searched in google and find some constant class have a feature named http://apache.org/xml/features/validation/default-attribute-values. But I tried and it seemed xerces doesn't have it now. Thanks for your help in advance. Jing --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
