Andy,
      thanks for the reply...I do have to disagree with using "absolute"
uri's for a namespace...I always thought that a namespace was just a unique
identifier for elements within a document...they MAY point to something but
for the most part they are not....Does Xerces make the assumption that the
namespaces it parses actually point to something?  This is the first time
I've heard that some parser actually makes assumptions about a namespace
being a valid something....In our current Web Service our clients do not
need to know exaclty where the "mesapi/schemas/version1.0/getsomedata"
is...we have a publicly viewable vir directory that the client may browse
our schemas to determine what is required to be sent to us if they want to
call some business function...all we require is that the namespace on their
incoming document and the schema that "guards" this method be the same....

so by "relative" and "absolute" do you mean?

realative = "cartoon-scooby-do"
absolute = "http://myserver/cartoon/scoobydo.xsd";

If so that's disappointing...it's just a name...what if the document moves
to "http://yourserver/cartoon/scoobydo.xsd"...do all the clients sending in
documents have to change?




                                                                                       
                             
                      Andy Clark                                                       
                             
                      <[EMAIL PROTECTED]>       To:       [EMAIL PROTECTED]   
                             
                                               cc:       (bcc: Doug 
Swanson/US-Corporate/3M/US)                     
                      05/07/2002 03:06         Subject:  Re: Basic Schema 
Validation..HELP!                         
                      AM                                                               
                             
                      Please respond to                                                
                             
                      xerces-j-dev                                                     
                             
                                                                                       
                             
                                                                                       
                             





[EMAIL PROTECTED] wrote:
> does NOT have the xsi:location attribute...What I want to do is decide at
> RUN time which Schema to validate this "document" against....load the
> schema, load the document and call some method to say "validate this
> document against this schema"....Does such a thing exist?

Check out the documentation for the properties supported by
Xerces, located at the following URL:

  http://xml.apache.org/xerces2-j/properties.html

The property identifiers that will probably help you out are
the following:

  http://apache.org/xml/properties/schema/external-schemaLocation

http://apache.org/xml/properties/schema/external-noNamespaceSchemaLocation

You might also want to consider using a custom EntityResolver
to do the redirection from the schema specified in the document.
Since the xsi: attributes that point to the location of the
XML Schema are merely "hints", they are not strictly required
(and your documents don't have them anyway). In this case,
Xerces uses the namespace URI as a way to try to locate the
associated XML Schema grammar -- hence the use of a custom
EntityResolver.

>     - <xsd:schema targetNamespace="mesapi/schemas/version1.0/getsomedata"

Namespace URIs should NOT be relative. You should ALWAYS try
to use absolute URIs when defining a namespace. While not
strictly disallowed, relative URIs are strongly discouraged
and are not considered a "best practice".

--
Andy Clark * [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