[xsd-users] Schema server

Boris Kolpackov boris at codesynthesis.com
Tue Feb 13 03:54:56 EST 2007


Hi Hans,

I've CC'ed xsd-users so that others can benefit from this information.
Please keep xsd-users in the CC list in your future replies.

Loyen, Hans H (NSC) <Hans.Loyen at ns.nl> writes:

> We have created a number of nested xsd-files which are used on a
> interfaces between some systems. In the xsd-files there is a reference
> to the schemaLocation. Until now we saved the xsd's on the local
> filesystem. All our systems have to do so. It must be possible to get
> them from a schema server like "http://www.w3.org/2001/XMLSchema". Maybe
> I am not using the right terms here, but I hope that you do understand
> me now.

Any http server would do (e.g., apache). Note, however, that if you
are parsing a lot of XML documents and every time the parser has
to fetch the schema over the network, then you can end up with
a pretty poor performance. One way to address this would be to
cache the schema.


>
> Top of one of the xsd-files
>
>   <?xml version="1.0" encoding="ISO-8859-1" ?>
> - <xs:schema
> targetNamespace="http://schemaserver/schemas/1.0/ik_tds_dmt"
> xmlns:xs="http://www.w3.org/2001/XMLSchema"
> xmlns:ik_tds_dmt="http://schemaserver/schemas/1.0/ik_tds_dmt"
> xmlns:ik_vprod="http://schemaserver/schemas/1.0/ik_vprod"
> xmlns:ik_dmt="http://schemaserver/schemas/1.0/ik_dmt"
> attributeFormDefault="qualified" elementFormDefault="qualified"
> version="1.0">
> - <xs:annotation>
>   <xs:documentation>CVS Id: $Id: TDS_DOMAIN_TYPES.xsd,v 1.13 2007/02/12
> 15:45:57 hans Exp $ Hier worden de domeinen beschreven, die binnen de
> TicketDistributionService worden gehanteerd.</xs:documentation>
>   </xs:annotation>
>   <xs:import namespace="http://schemaserver/schemas/1.0/ik_dmt"
> schemaLocation="INET_DOMAIN_TYPES.xsd" />
>   <xs:import

I think you are confusing namespace and schemaLocation attributes
above. Normally you would place all your schemas on a web server
somewhere, say "http://schemaserver/". Then in an instance
document you will add the xsi:schemaLocation attribute like this:

xsi:schemaLocation="http://www.company.com/foo http://schemaserver/foo.xsd"

Here is "http://www.company.com/foo" is a vocabulary namespace and
"http://schemaserver/foo.xsd" is the schema location. Note that in
xs:import declarations you would normally use relative paths which
will be automatically prefixed with the URI prefix (e.g.,
"http://schemaserver/").


hth,
-boris
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 652 bytes
Desc: Digital signature
Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20070213/7db088a1/attachment.pgp


More information about the xsd-users mailing list