The moose likes XML and Related Technologies and the fly likes XML-XSD file creation Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Engineering » XML and Related Technologies
Reply Bookmark "XML-XSD file creation" Watch "XML-XSD file creation" New topic
Author

XML-XSD file creation

Abhi Venu
Ranch Hand

Joined: Jul 09, 2009
Posts: 61
I am creating a XML schema file I am struck at one point If any of you can help me please do it.

I have a element like this


<xs:element name="Country_name" minOccurs="1">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="50" />
</xs:restriction>
</xs:simpleType>
</xs:element>


Thing i wanted is that if this country_name element holds a value "GREECE" in the XML file another element i.e the one shown below
should be mandatory else it should not be mandatory

<xs:element name="University" minOccurs="1">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="50" />
</xs:restriction>
</xs:simpleType>
</xs:element>


Can it be done in scheam i.e ina .xsd file?

Aslo another need is that based on value on One element i need to choose one of the two elements

like if element type==kid

i should have a element ice cream

else if type = men

i should have a element noodles can this selection of element based on the data on tag be done in xsd file

I am a GreenHorn..so please help

A table, a chair, a bowl of fruit and a violin; what else does a man need to be happy?:Einstein
Bear Bibeault
Author and opinionated walrus
Marshal

Joined: Jan 10, 2002
Posts: 48843

Please take the time to choose the correct forum for your posts. This forum is for questions on JSP. For more information, please read this.

This post has been moved to a more appropriate forum.

[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
 
 
subject: XML-XSD file creation
 
developer file tools

cast iron skillet 49er

more from paul wheaton's glorious empire of web junk: cast iron skillet diatomaceous earth rocket mass heater sepp holzer raised garden beds raising chickens lawn care CFL flea control missoula heat permaculture