users@jaxb.java.net

How to specify what schema to use and where it is located

From: Jorge Medina <jmedina_at_on.com>
Date: Wed, 14 May 2003 21:11:34 +0200

I wonder if the following can be done:

      I have a set of XML files but with no reference to what schema is
being used or where to find it.

      Nevertheless, the documents were generated according to a XML schema.
      The documents look like:
                  <myTag attr1="abc">
                        <mySubElement attrX="xyz" attrY="abc"/>
                        ...
                  </myTag>
      Instead of something like:
            <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
            <ns1:myTag attr1="abc"
xsi:schemaLocation="http://www.acme.com/xml/schemas
http://www.acme.on/xml/schemas/MyTag.xsd"
                               xmlns:ns1="http://www.acme.com/xml/schemas "

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
                        <mySubElement attrX="xyz" attrY="abc"/>
                        ...
            <ns1:myTag>


a) I would like to validate the docuements against the schema, but if the
document itself does not contain what schema is using , Can I tell JAXB
what schema to use for validation ?
b) Can I tell JAXB where to find the schema ?

Thanks