You might try updating to Xerces 2.5 to see if it supports the feature and
does what you want.  If it doesn't, the final answer will probably be that
optional elements should not have default values--those values would need
to be inserted elsewhere in the system.

David Shontz
ExxonMobil Exploration UTC
Application Support/Application and Data Integration
CORP-RR-603
281-654-7214
Email: David Shontz/U-Houston/ExxonMobil
Internet Email: [EMAIL PROTECTED]


|---------+----------------------------->
|         |           Jing Tao          |
|         |           <[EMAIL PROTECTED]|
|         |           u>                |
|         |                             |
|         |                             |
|         |           10/30/03 06:49 PM |
|         |           Please respond to |
|         |           xerces-j-user     |
|         |                             |
|---------+----------------------------->
  
>---------------------------------------------------------------------------------------------------------------------|
  |                                                                             
                                        |
  |       To:      <[EMAIL PROTECTED]>, <[email protected]>           
                             |
  |       cc:                                                                   
                                        |
  |       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]

Reply via email to