Thanks for your answer.....I will use the serialization (first solution) and
then I will imagine the solution to overtax my brain recompiling Xerces with
DOM3 feature and using this feature. Seems to be a big challenge !

Regards. Yvan


-----Original Message-----
From: Doug Helton [mailto:[EMAIL PROTECTED]
Sent: mercredi, 7. mai 2003 16:48
To: [EMAIL PROTECTED]
Subject: RE: DOM and schema validation


I did not want to overtax his brain and make him recompile xerces with the
DOM level 3 stuff.

Thanks,

Douglas P. Helton
Lockheed Martin/STRICOM IDE
3045 Technology Parkway
Orlando, FL 32826
(321)235-7728

-----Original Message-----
From: Rob Outar [mailto:[EMAIL PROTECTED]
Sent: Wednesday, May 07, 2003 10:37 AM
To: [EMAIL PROTECTED]
Subject: RE: DOM and schema validation


http://xml.apache.org/xerces2-j/faq-dom.html#faq-7

Thanks,

Rob

-----Original Message-----
From: Doug Helton [mailto:[EMAIL PROTECTED]
Sent: Wednesday, May 07, 2003 10:18 AM
To: [EMAIL PROTECTED]
Subject: RE: DOM and schema validation


Yvan,
        Try this.  Serialize out the Dom.  once you do this you can create
an input
source and hand it to a sax parser.  Don't forget to create an error handler
for the parser.

here is the code to serialize the DOM:

          OutputFormat outputFormat = new OutputFormat();
        StringWriter  stringOut   = new StringWriter();

        outputFormat.setIndenting(true);
        outputFormat.setOmitComments(false);
        outputFormat.setOmitDocumentType(false);
        outputFormat.setOmitXMLDeclaration(false);
        outputFormat.setEncoding("US-ASCII");
        /*creating new xmlserializer and telling it to use stringOut and the
        format*/
        XMLSerializer serial = new XMLSerializer(stringOut, outputFormat);
        serial.asDOMSerializer();
        serial.serialize(doc);

            /* Creating an input source that the parser will accept
             and passing it as the parameter to validateFile*/
        StringReader strReader = new StringReader(stringOut.toString());
        InputSource source = new InputSource(strReader);


Doug

-----Original Message-----
From: Hess Yvan [mailto:[EMAIL PROTECTED]
Sent: Wednesday, May 07, 2003 9:46 AM
To: '[EMAIL PROTECTED]'
Subject: DOM and schema validation


Hi,

I have a DOM document that I already have parsed. Now I would like to
validate it against an XML schema.
Does anyone know how I can procede ? Do you have an code sample for this
operation ?

Thanks in advance.

Yvan Hess



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to