Simon Righley
Simon Righley

Reputation: 4969

XSD validation tool

I'm a complete newbie to XSD, so please forgive me if this question is plain stupid. I'm writing my XML Schema in Eclipse (Kepler). There, in particular, I can validate my .xsd file directly by simple right-click on the .xsd file in my project, and selecting 'Validate'. Everything was going OK until I realized that I would like to use XSD 1.1 (in particular, for assertions) which Eclipse does not support. I did some googling to find that Notepad++ has this nice 'XML Tools' plugin that one can use to validate an XML file against an existing schema (XSD). My problem is that (for the time being) I don't want to validate an XML but rather validate my XSD itself, and thus I do not have a schema against which I would like to validate. So, how can I validate an actual xml schema 1.1 file? Any tools for that? Can I use the 'XML tools' plugin for that?

Note added: by validation (which I maybe used incorrectly) I understand all sort of checks for syntax (?) correctness.

Any help greatly appreciated.

Upvotes: 1

Views: 3717

Answers (1)

Mathias Müller
Mathias Müller

Reputation: 22617

There is no difference between validating an arbitrary XML file against your XML schema document and validating your XML schema against another schema.

This is because an XML schema is a regular XML file in its own right. As such, it must be well-formed and valid (both criteria can apply to all XML documents). It is well-formed if it adheres to the XML specification and it is valid if it adheres to the XML Schema specification.

Now, I assume that by all sorts of checks for syntactical correctness you mean that well-formedness should be ensured (a single root element, all tags properly closed etc.) and the document should be a proper XML schema.

You have several options:

  • find an online service to check the validity of your XML schema
  • find an IDE that is similar to Eclipse, but supports XML Schema 1.1
  • continue to use the tool you are working with, but treat your XML schema as the XML file you'd usually validate against a schema. Validate it against the official W3C XML Schema for Schema documents (or the official DTD).

I won't elaborate on the first two options since asking for tools is off-topic on Stackoverflow.

Upvotes: 2

Related Questions