• 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
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

Howto validate xml schema?

 
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Guys, I want to programatically validate xml schema files.. can someone point me in the right direction. I dont want to validate xml files against a schema, but moreso to validate the schema itself.

Cheers
 
Ranch Hand
Posts: 1780
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Isn't that supposed to be the beauty of schemas versus DTDs? If you know how to validate an xml document against a schema, do that to your schema document: validate myschema.xsd against schema http://www.w3.org/2001/XMLSchema.xsd
[ February 13, 2006: Message edited by: Jeff Albertson ]
 
Ranch Hand
Posts: 884
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Write a schema to validate a schema, since a schema is an XML?
 
Chengwei Lee
Ranch Hand
Posts: 884
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Jeff Albertson:
Isn't that supposed to be the beauty of schemas versus DTDs? If you know how to validate an xml document against a schema, do that to your schema document: validate myschema.xsd against schema http://www.w3.org/2001/XMLSchema.xsd

[ February 13, 2006: Message edited by: Jeff Albertson ]



Hi Jeff,

I think Alan wanted to validate a schema rather than the actual XML data file. But if I'm mistaken, Jeff's way is correct.

Cheers!
 
Alan Mc Kernan
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hrm, yeah that makes sense.

But what about sub files that the XSD imports/links to?

Basically Ill have a directory with a tree of XSD's, some have common elements which are contained in their own XSD and then the top level XSD's import those.

So basically I want to programically (or by some automated means) ensure that they are all valid. i.e there may be cases where the command element XSD's are missing.. or not valid for some reason.
 
Alan Mc Kernan
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This technique.. semi works. It will validate that the XSD is well formed, but when I remove an import, which is used in the schema, it still passes with no problems.

Anyone any ideas?
 
Forget Steve. Look at this tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic