Win a copy of Succeeding with AI this week in the Artificial Intelligence and Machine Learning forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
  • Junilu Lacar
Sheriffs:
  • Tim Cooke
  • Jeanne Boyarsky
  • Knute Snortum
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:
  • salvin francis
  • fred rosenberger
  • Frits Walraven

XML verifying

 
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.
 
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
 
Ranch Hand
Posts: 2308
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just validate D2 against the DTD of D1.
    Bookmark Topic Watch Topic
  • New Topic