Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
    Bookmark Topic Watch Topic
 
friki data migration
Ranch Hand
Posts: 772
  • Mark post as helpful
  • send pies
  • Report post to moderator
First of all, make sure that your XML parser supports schema validation. Not all do, yet.

Note that by adapting the first setAttribute call this code can also validate against a DTD or Relax-NG schema. Consult JavaDoc:javax.xml.XMLConstants for the corresponding attribute value.

Here's a quick sample for schema validation using JAXP 1.2.




XmlFaq CategoryCodeSamples
 
    Bookmark Topic Watch Topic
  • New Topic