[jdom-interest] JDOM SAXBuilder validation schema with Java

Christian Avril christian.avril at dpma.finances.gouv.fr
Tue Dec 28 02:34:57 PST 2004


Thank you . It works.
I have now a example with a file XML without a schema's reference ( But  I keep also the other example with the reference inside )
I don't know if one solution or the other is the best standard. 

File countriesbuild_test.xml
<?xml version="1.0" encoding="UTF-8"?>
 <country name="England" capital="London"/>
 <country name="Wales" capital="Cardiff"/>
 <country name="Scotland" capital="Edinburgh"/>

And I use the setProperty() in Java 

And the validation is OK
xml/countriesbuild_test.xml is well formed

OR , 
if I delete an attribute ( for example : name="England" )
I have : Error on line 3 of document file:///C:/Projets/Jdom-1-0/xml/countriesbuild_test.xml: cvc-complex-type.4: Attribute 'name' must appear on element 'country'.
The validation works.



-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.jdom.org/pipermail/jdom-interest/attachments/20041228/db8b41c2/attachment.htm

More information about the jdom-interest mailing list