Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > [XML] XSD Schema Validation

Reply
Thread Tools

[XML] XSD Schema Validation

 
 
Roedy Green
Guest
Posts: n/a
 
      09-30-2005
On 30 Sep 2005 00:29:49 -0700, "oziris" <>
wrote or quoted :

>Merci beaucoup à tout le monde.

translation: many thanks to everyone.
--
Canadian Mind Products, Roedy Green.
http://mindprod.com Again taking new Java programming contracts.
 
Reply With Quote
 
 
 
 
Martin Honnen
Guest
Posts: n/a
 
      09-30-2005


Roedy Green wrote:


> I was enshrining a heavily commented variant of your code as an
> example at http://mindprod.com/jgloss/xsd.html


That has

// get the custom xsd schema describing the required format for my XML
files.
Schema schemaXSD = schemaFactory.newSchema( new File ( "myschema.xsd" ) );

// hook up org.xml.sax.ErrorHandler implementation.
schemaFactory.setErrorHandler( myErrorHandler );

but you should set up the error handler first on the schema factory and
then call newSchema e.g.

// hook up org.xml.sax.ErrorHandler implementation.
schemaFactory.setErrorHandler( myErrorHandler );

// get the custom xsd schema describing the required format for my XML
files.
Schema schemaXSD = schemaFactory.newSchema( new File ( "myschema.xsd" ) );

if the aim is to have the error handler report any problems found while
parsing and compiling myschema.xsd.

--

Martin Honnen
http://JavaScript.FAQTs.com/
 
Reply With Quote
 
 
 
 
oziris
Guest
Posts: n/a
 
      09-30-2005
I guessed everybody knows the word "merci"

 
Reply With Quote
 
Roedy Green
Guest
Posts: n/a
 
      09-30-2005
On Fri, 30 Sep 2005 13:46:09 +0200, Martin Honnen <>
wrote or quoted :

>but you should set up the error handler first on the schema factory and
>then call newSchema e.g.


of course. Thanks for picking that up. Now corrected.
--
Canadian Mind Products, Roedy Green.
http://mindprod.com Again taking new Java programming contracts.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Validation with XSD using XML::LibXML::Schema, and XML::Validator::Schema huntingseasonson@gmail.com Perl Misc 5 11-29-2006 12:37 PM
Validation of XSD (XML Schema) against XSD Rushi XML 1 12-09-2005 08:12 AM
XML schema - Make xsd include another xsd stiank81 XML 4 06-26-2005 05:11 PM
[XML Schema] Including a schema document with absent target namespace to a schema with specified target namespace Stanimir Stamenkov XML 3 04-25-2005 09:59 AM
XML validation with schema xsd in JAVA Mavrick Java 1 09-09-2004 12:22 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57