Re: JNLP xsd schema
Andrew Thompson wrote:
Piotr Kobzda wrote:
However, instead of validating against XSD, there is also possibility to
validate JNLP file against DTD directly.
Sure there is, but why would you bother?
Because DTD is only officially available definition?
XSD can check eveything specified in a DTD,
plus a whole lot more besides.
Yes, XSD can do a lot more than DTD can, but unfortunately, not all what
DTD can do, is possible with XSD. For example, there is internal and
external DTD, and a lot of tricky features of DTD possible, e.g.
entities, definitions overriding, etc., which by design are not a
features of XSD. DTD is tightly bound into XML document parsing, and,
in general, can not be converted into fully equivalent XSD. Of course,
as we know, there is nothing tricky in DTD for JNLP, and assuming
non-tricky use of it, we can easily convert it into equivalent XSD. But
since JNLP is defined using DTD only, we do not need any extra features
that XSD offer (using them, we could possibly change the definition).
Moreover, to use XSD, we must in our own risk convert the original DTD
(there is no support for that in standard Java), which puts additional
layer, possibly error prone, into validation process. As the result,
making the validation less trust-worthy than direct use of the definition.
piotr