I would like to update that with a JNLP 1.5+ schema. Google seems to think nobody but me has a schema. Is here one? I could I suppose write one, but I would be nervous since I don't have language lawyer genes, and I would hate to send people astray misinterpreting the spec. -- Roedy Green Canadian Mind Products The Java Glossary http://mindprod.com
Maybe there are no logical links (as parsed by Google) to other 'naked' DTD's and XSD's (vague shrug).
>..Is here one? I could I suppose >write one, but I would be nervous since I don't have language lawyer >genes, and I would hate to send people astray misinterpreting the >spec.
.issue a version with 'all disclaimers - use at own risk' in the comments at the top, and be done with it - is my 'IANAL response'.
As an aside, I had also been thinking of making an XSD of the JNLP DTD, since I know there are tools which will convert a DTD to a simple XSD (I don't know off-hand what they are). I developed a DTD for the XScreenSaver GUI config. files, somebody converted it to a XSD, and we quickly abandoned the DTD and instead refined the XSD.
I changed the link shortly after I posted.. I have moved the JNLP stuff out of the java webstart.html link. -- Roedy Green Canadian Mind Products The Java Glossary http://mindprod.com
On Mon, 23 Jul 2007 03:24:01 GMT, Roedy Green <see_webs...@mindprod.com.invalid> wrote, quoted or indirectly quoted someone who said :
>I would like to update that with a JNLP 1.5+ schema. Google seems to >think nobody but me has a schema. Is here one? I could I suppose >write one, but I would be nervous since I don't have language lawyer >genes, and I would hate to send people astray misinterpreting the >spec.
I got an email from Sun. They said they post a DTD for 1.5 and 6, but no xsd or other advanced schemas. I have the URLS at http://mindprod.com/jgloss/jnlp.html -- Roedy Green Canadian Mind Products The Java Glossary http://mindprod.com
On Mon, 23 Jul 2007 08:21:48 GMT, "Andrew Thompson" <u32984@uwe> wrote, quoted or indirectly quoted someone who said :
>As an aside, I had also been thinking of making an XSD >of the JNLP DTD, since I know there are tools which will >convert a DTD to a simple XSD (I don't know off-hand >what they are)
Perhaps you might create a tool that takes an EXAMPLE XML file with all possible options, and it creates an XSD you then polish by hand. -- Roedy Green Canadian Mind Products The Java Glossary http://mindprod.com
Roedy Green wrote: > I got an email from Sun. They said they post a DTD for 1.5 and 6, but > no xsd or other advanced schemas. I have the URLS at > http://mindprod.com/jgloss/jnlp.html
Interestingly, theirs DTD for 6 seems to be invalid (in both, Sun site, and in Appendix C of JNLP specification).
Corrections needed (my guess):
<!ELEMENT update> should be: <!ELEMENT update EMPTY>
and:
<!ELEMENT shortcut (desktop? menu?)> should be: <!ELEMENT shortcut (desktop?, menu?)>
DTD for 1.5 seems to be correct.
If you want convert them automatically to XSD (as Andrew suggested earlier) some tools you can find there: http://www.w3.org/XML/Schema#Tools
(about a year ago I successfully used XMLSpy for that)
However, instead of validating against XSD, there is also possibility to validate JNLP file against DTD directly. That usually requires an addition (or rewriting) of DTD in that file. But hopefully, we can perform that on the fly -- an example using StAX (from Java 6) is below.
Piotr Kobzda wrote: >> I got an email from Sun. They said they post a DTD for 1.5 and 6, but >> no xsd or other advanced schemas. I have the URLS at >> http://mindprod.com/jgloss/jnlp.html
>Interestingly, theirs DTD for 6 seems to be invalid (in both, Sun site, >and in Appendix C of JNLP specification).
<grumble>Unfortunate, but not that surpsising for Sun.</grumble> ..
>(about a year ago I successfully used XMLSpy for that)
.XMLSpy but while waiting for the page to load, saw dtd2xss, looked at their page, 'liked the price', and had it mostly donwloaded before I decided I could not be bothered waiting any longer for the other page to arrive. ;-)
Here is the XSD that xss2dtd produces, based on Piotr's corrections, above - with a comment in the header . It's only 270 odd lines..
Oh.. and note that every reference to xss2dtd in that post, should actually have been a reference to dtd2xss (ya' complete moron, Andrew).
In fact, it seems they've dropped the final 's' - 'dtd2xs'. Maybe because it sounds 'kewl' (Shop till you drop? DTD 2 XS!). Their site is.. <http://www.lumrix.net/dtd2xs.php>
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.
Andrew Thompson wrote: > Here is the XSD that xss2dtd produces, based on Piotr's > corrections, above - with a comment in the header > . It's only 270 odd lines..
Possibly "copying & pasting" it caused loosing of some important parts of the XSD -- now it's invalid (69 errors :) ).
Piotr Kobzda wrote: >> Here is the XSD that xss2dtd produces, based on Piotr's >> corrections, above - with a comment in the header >> . It's only 270 odd lines..
>Possibly "copying & pasting" it caused loosing of some important parts >of the XSD -- now it's invalid (69 errors :) ).
Perhaps! Whatever happened, it happened to my local copy as well. :-(
>The "DTD to XML Schema" tool seems to produce correct XSD equivalents >for all DTDs I tried it with, all in just a few clicks.
Spot on! I'm now working with an XSD developed using that page* and based upon the corrections you suggested to Sun's DTD. It is the first time I've been able to see a 'valid JNLP' (checking against a valid XSD) message in a little validator I'm putting together.
Once I've finished checking and refining the XSD, I'll upload it and give the URL.
* I was also considering trying to download Altova's 'trial ware' packs - but at 100 meg, that blows my entire month's limit of downloads before being bandwidth throttled!