RE: Selective element based on attribute

Not in XML Schema 1.0 (a well-known restriction, which is lifted in XML
Schema 1.1, currently available as a last-call working draft.)
 
Michael Kay
http://www.saxonica.com/


  _____  

From: xmlschema-dev-request@w3.org [mailto:xmlschema-dev-request@w3.org] On
Behalf Of Muthuvelan.Swaminathan@dds.net
Sent: 04 October 2007 20:33
To: xmlschema-dev@w3.org
Subject: Selective element based on attribute



Hi  there, 

How can I define an xsd for the following scenario? 

<parenttag attr="add | del | chg"> 
     <childtag1>chidvalue1</childtag1> 
     <childtag2>chidvalue2</childtag2> 
     <childtag3>chidvalue3</childtag3> 
</parenttag> 

Is it possible to create an xsd where childtag3 will have a value null if
the parenttag  attr equals add else a nonnull-String when the parenttag attr
is del/chg? 

Thanks 
Muthu

Received on Friday, 5 October 2007 08:29:24 UTC