468,267 Members | 1,847 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,267 developers. It's quick & easy.

xsd as contract, best practice for access (searched)

Hi XML-gurus,

imagine a provider of some information in XML format and
a client who reads this data.
Both sides share a XSD as a contract.
I think this is quite common.

Now the client wants to validate the XML data.
Unfortunatly the provider of the XML data is not able
to offer XSD access at a webserver
(e.g. he wants not afford the maintenance of a webserver)
and he wants also not refer to a XSD location at client side(e.g.
he has much clients with different local XSD locations).

However the offerer of the XML data is willing to refer to
a generic XSD placeholder in the XML which could the client map
to a XSD at a local webserver or to a XSD file at client side.
Is this possible ? If yes, a example/link would be great.

Or is it possible to omit the reference to the XSD entirly and
the client is still possible to validate the XML against a XSD
which is not refered within the XML ?
Again an example would fine.

Best regards,
Thomas

May 10 '06 #1
1 1343
Both cases are possible. If you decide to have the documents refer to a
schema location then you can use an XML catalog to map that schema
location to a local copy of the file. In general it is good to have the
schema available also at that location to allow also the clients that
do not use the catalog to validate the document. For examples see
Xerces XML catalog support:
http://xerces.apache.org/xerces2-j/faq-xcatalogs.html
The second case is also possible, you can ignore what schemas the
document provides and perform a validation against a specified schema.
See
http://xerces.apache.org/xerces2-j/properties.html
the "http://apache.org/xml/properties/schema/external-schemaLocation"
and
"http://apache.org/xml/properties/schema/external-noNamespaceSchemaLocation"
properties and also see
http://xerces.apache.org/xerces2-j/faq-grammars.html

Best Regards,
George
---------------------------------------------------------------------
George Cristian Bina
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com

May 10 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Joe Bloggs | last post: by
8 posts views Thread by Fredrik Melin | last post: by
reply views Thread by NPC403 | last post: by
reply views Thread by kermitthefrogpy | last post: by
reply views Thread by zattat | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.