This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Hi, I would like to create a schema such that an element should represent either of the one option tag. for example the XML document can be either <Book> <authorname>John</authorname> <Book> (or) <Book> <authorId>3423<authorId> <Book> but it should not be like this <Book> <authorname>John</authorname> <authorId>4323<authorId> <Book> Please tell me whether it is possible to specify this is Schema file (.XSD).due i need to use <xs:choice> tag ??
I found the answer.. Below is the answer. <xs:element name="Book"> <xs:annotation> <xs ocumentation>Root Element</xs ocumentation> </xs:annotation> <xs:complexType> <xs:choice> <xs:element name="AuthorName"/> <xs:element name="AuthorID"/> </xs:choice> </xs:complexType> </xs:element> Please delete if this message,if unnecessary.