• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

xml schema with xerces parser

 
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ]
 
author and deputy
Posts: 3150
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Just a general comment!..
XSD structure is same like XML , why don't read the incoming XSD and detect the relevant datatype ?
Rgds
Balaji
 
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
prashanth nagaraj
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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

prashanth
 
Balaji Loganathan
author and deputy
Posts: 3150
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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

prashanth


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.
 
The only thing that kept the leeches off of me was this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic