Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to define default value in XSD schema?
Message
De
10/01/2008 09:11:06
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
XML, XSD
Versions des environnements
Visual FoxPro:
VFP 9 SP1
Divers
Thread ID:
01280851
Message ID:
01280855
Vues:
20
This message has been marked as the solution to the initial question of the thread.
Of course it is possible.
Just define attribute default for element.
<xsd:element name="MYVALUE" type="xsd:int" default="0">
>I don't know if this is possible but I would like to define a default value in case the value of an element in XML is empty.
>
>Here is an example.
>
>XML file has an element MYVALUE as
>
>
><MYVALUE>2</MYVALUE>
>
>
>In XSD file this element has type INT. But if the element MYVALUE has nothing as in
>
>
><MYVALUE></MYVALUE>
>
>
>Error occurs (unable to parse or something to that effect).
>
>It would be nice if in the XSD file I could specify that in case the element is empty put value 0. And therefore, prevent an error from occuring. Can it be done?
>
>Thank you.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform