1
votes

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.

1
An XSD schema is an XML file like any other. What do you mean by validating your XSD file? Any validation tool will output warnings and errors about your schema if it does not follow the rules laid out by the Schema specification.Mathias Müller
It does not make sense to validate one single file, you have to validate it against something else. If your intent is really to validate your XSD schema, yes, there are schemas and a DTD from W3C for that.Mathias Müller
Thanks for the comment, I edited my question. As mentioned, I'm very new to this, so maybe used the word 'validation' incorrectly.Simon Righley

1 Answers

2
votes

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.