Hi,

I am trying to use the Castor unmarshaller to build my java data objects
from an XML stream. The XML stream that I receive does not have a reference
to schema. When I receive the XML stream, I need to validate the XML stream
against the schema and if the XML data is valid, the java data objects have
to be built. (I have a mapping file)

Right now I am using the xerces SAX parser and using
parser.setProperty("http://apache.org/xml/properties/schema/external-schemaL
ocation", SCHEMA_LOCATION) and then parser.parse() to validate the XML. If
there are no parse errors, I am then using the unmarshaller to map the XML
data to java objects.

I know this involves a double overhead. Is there a better way to use the
unmarshaller, to load the schema, validate the XML data against the schema
and build the data objects if there are no errors. Also if there are parse
errors, I need to log them.

Any help is greatly appreciated.

Thanks in advance

Reddy
Sr Software Engineer
C-Cor.net

----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-dev

Reply via email to