The two main advantages of XSD over DTD for specifying an XML grammar are:
| Sample XSD Schemas | Extracting data from an XML file |
| Understanding an XSD Schema | Learning More |
| Validating an XML file conforming to an XSD schema | Links |
XSD allows you to specify the minimum and maximum number of times a field may appear with the minOccurs="0" maxOccurs="unbounded".
You can specify the types of fields with: type="xsd:positiveInteger" type="xsd:string" type="xsd:anyURI" options.
You can specify the allowable low and high bounds on a numeric field with: mininclusive and maxinclusive.
There is a scheme to insist a data value be unique.
Sometimes the files are peppered with xs: and sometimes with xsd:. This is an arbitary string to abbreviate the xmlns name space defined at http://www.w3.org/2001/XMLSchema. You can make it anything you like so long as it you use it consistently. It lets the parser know that a word is a keyword. This way you can accidentally use keywords for field names without confusion.
rem Validate a JNLP file with CMP ValidateJNLP utility java.exe ValidateJNLP jnlp6.xsd C:\mydir\myapp.jnlp
The above validator is not user friendly. If all is ok, it prints nothing. If there is problem, you get a cryptic exception. You can get a good idea what it is looking for by reading the XSD file. I have composed three schemas for it jnlp1.xsd, jnlp5.xsd and jnlp6.xsd. Use the one that corresponds to the version of your JNLP. XSDs are a bit like a BNF (Backus-Naur Form) description of JNLP, written by someone with a terrible lexical stutter.
|
|
You can get the freshest copy of this page from: | or possibly from your local J: drive (Java virtual drive/mindprod.com website mirror) |
| http://mindprod.com/jgloss/xsd.html | J:\mindprod\jgloss\xsd.html | |
![]() | Please email your feedback for publication,
letters to the editor, errors, omissions, typos, formatting errors, ambiguities, unclear wording,
broken/redirected link reports, suggestions to improve this page or comments to
Roedy Green :
| |
| Canadian Mind Products | ||
| mindprod.com IP:[65.110.21.43] | ||
| view Blog | Your face IP:[38.107.179.211] | |
| Feedback | You are visitor number 23,693. | |