Win a copy of The Business Blockchain this week in the Cloud forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

XML verifying

 
Genefer Bruns
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I have a problem described as following:
Let a XML document called D1, now, if a have another XML document called D2, I need a mechanism for verifying that D2 is derived from D1, in other words how we can verify (tool, mechanism, algorithm, etc) that D2 respect the DTD (Document Type Definition) of D1.

Thanks in advance.
 
vipul patel
Ranch Hand
Posts: 146
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you can use XML parsers to validate your xml instance document against either DTD or Schema.

xerces is best example of such parser. Try running sax.Counter which will validate your xml document.

you might have to download xerces jar package from www.apache.com.

java sax.Counter example.xml
 
Rahul Bhattacharjee
Ranch Hand
Posts: 2308
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just validate D2 against the DTD of D1.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic