You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by PHDB _ <ph...@hotmail.com> on 2004/07/21 16:10:31 UTC

Element default values question

Hi,

I have a question about element default values defined in the schema. How 
can we get them when parsing the file ?

I have the foolowing part of a schema
<xs:complexType name="TaxData_Type">
<xs:complexContent>
  <xs:extension base="Data_Type">
   <xs:sequence>
    <xs:element name="DateApplication" default="TRV" minOccurs="0">
     <xs:simpleType>
      <xs:restriction base="xs:string">
       <xs:enumeration value="SGT"/>
       <xs:enumeration value="TRV"/>
      </xs:restriction>
     </xs:simpleType>
    </xs:element>
   </xs:sequence>
  </xs:extension>
</xs:complexContent>
</xs:complexType>

With TRV as default value in the type, I expected to receive TRV if I don't 
put a DateApplication tag in TaxData.
But I receive nothing :-(

http://apache.org/xml/features/validation/schema/element-default is set to 
true, and so are schema validation and validation features.

It doesn't call characters() for DateApplication (I printed it on screen). 
Any idea ?

Additional question : why should it call characters() for element default 
values, whereas it calls startElement() for attribute default values ?
How can we know to which tag the default value sent to characters() refers 
to ?
By the way it works well for attribute default values for me.


By the way I'm using the latest Xerces 2_6_2.

Many thks in advance,

_________________________________________________________________
MSN Search, le moteur de recherche qui pense comme vous !  
http://search.msn.fr/


---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-dev-help@xml.apache.org