This week's book giveaway is in the OCAJP forum.
We're giving away four copies of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) and have Khalid A Mughal & Rolf W Rasmussen on-line!
See this thread for details.
Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

XMLBeans parsing question

 
Md Fizal
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a XML schema which I compiled to generate the XMLBean jar file. In my Java code, I'm using this bean and trying to parse an XML instance.
Say, if my XML root tag is "AddressDetails", then I'm parsing it like this


Problem here is that, the above parse method just validates the xml file, but does not check the conformity of the XML with the schema. How do I do that?
 
Rashmi Banthia
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This method validates XML document based on the schema : XmlObject.validate().

(Api Docs: http://xmlbeans.apache.org/docs/reference/org/apache/xmlbeans/XmlObject.html)

--Rashmi
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic