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 am using xerces4 java for validating xml with xml schema. Xml schema are stored in xsd files. I have defined the datatypes of values in xsd files. After validating the input xml with that of xsd files, I need to get the datatype of the value from xsd. Suppose in the input xml user passes some value like <Age>25</Age>. The xsd has datatype for this value as int. Is there any way from which I can get the datatype of Age element's value from xsd using the xerces. I can also pass the datatype information in the input xml. but in our applications we are using schemas provided by different team where the datatype info is provided in xsd files. Please suggest if there is any solutions for this . Thanks in adv prashanth
[ December 23, 2002: Message edited by: Prashanth Nagaraj ]
Prashanth, One of the great advantages of XML Schemas over DTDs is precisely its XML format. This means that you can parse the XSD file as you would do with any XML file. Cheers
Joined: Mar 11, 2002
Thanks for replying, I have tried in this way. In xsd's we are including other xsds. Because of this it is too complex for parsing the xsds. If there is any better solution ,pls let me know
author and deputy
Joined: Jul 13, 2001
Originally posted by Prashanth Nagaraj: Thanks for replying, I have tried in this way. In xsd's we are including other xsds. Because of this it is too complex for parsing the xsds. If there is any better solution ,pls let me know
hi, if you professional xml schema book from wrox with you, then in chapter 10 has an example which read xsd including imported and included and producess html. may be that could help you a bit.you can also download the source code of this chapter from wrox site.just run the sample,you may get some idea.