Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > xsd condition

Reply
Thread Tools

xsd condition

 
 
Lucia
Guest
Posts: n/a
 
      10-22-2003
Hello,

I'd like to write an XML-Schema which has the following structure:

<xsd: complexType name="example">
<xsd: element name="variablename" type="xsd:string"/>
<xsd: element name="variabletype" type="xsd:string"/>
<xsd: element name="variablevalue" type=?????????? />
</xsd:complexType>

My problem is that the type of the element "variablevalue" depends on
the content of the element "variabletype".

e.g. when variablevalue=long, the type of variablevalue should be
"xsd: long";
when variablevalue=string, the type of variablevalue should be
"xsd: string";

How can solve this problem? Have you any idea?

Thanks

lucia
 
Reply With Quote
 
 
 
 
Martin Boehm
Guest
Posts: n/a
 
      10-22-2003
"Lucia" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) om

> e.g. when variablevalue=long, the type of variablevalue should be
> "xsd: long";
> when variablevalue=string, the type of variablevalue should be
> "xsd: string";
>
> How can solve this problem? Have you any idea?


Create a simpleType for each of the possible variable types and then use
xsd:union or xsd:choice to combine them.

Martin


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with while condition OR condition Bill W. Ruby 13 05-09-2011 09:42 PM
XML + XSD: Is it possible to get all errors against the XSD? Markus Java 1 11-22-2005 02:53 PM
Condition outside loop or separate loop for different condition? - Java 12 06-15-2005 08:50 AM
referencing another XSD file within an XSD file JavaDeveloper@nowhere.com XML 1 01-14-2004 05:22 PM
XSD document for XSD defintion Rick Razzano XML 1 09-26-2003 12:41 AM



Advertisments