Newsgroups: comp.lang.java.programmer
From: Piotr Kobzda <pi...@gazeta.pl>
Date: Tue, 24 Jul 2007 02:11:15 +0200
Local: Tues, Jul 24 2007 10:11 am
Subject: Re: JNLP xsd schema
Roedy Green wrote: Interestingly, theirs DTD for 6 seems to be invalid (in both, Sun site, > 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 and in Appendix C of JNLP specification). Corrections needed (my guess): <!ELEMENT update> and: <!ELEMENT shortcut (desktop? menu?)> DTD for 1.5 seems to be correct. If you want convert them automatically to XSD (as Andrew suggested (about a year ago I successfully used XMLSpy for that) However, instead of validating against XSD, there is also possibility to piotr import java.io.*; import javax.xml.parsers.*; import org.xml.sax.*; public class ValidateJNLP { public static void main(String[] args) throws Exception { // rewrite input file... StringWriter rewrite_out = new StringWriter(); XMLInputFactory xif = XMLInputFactory.newInstance(); XMLEventReader er = xif.createXMLEventReader( while (er.hasNext()) { if (e.isStartElement()) { // System.out.println(rewrite_out.toString()); // validate... SAXParserFactory spf = SAXParserFactory.newInstance(); SAXParser sp = spf.newSAXParser(); InputSource is = new InputSource(rewritten_in); } class JNLPErrorHandler extends DefaultHandler { @Override @Override @Override }
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||