Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


RE: Imports and namespaces

From: "Michael Kay" <mike@--------.--->
To: "'Cesar Ariza \(gmd\)'" <cesarariza@-----.--->, <xmlschema-dev@--.--->
Date: 6/25/2008 1:05:00 AM
The schema composition rules give a lot of freedom to implementations to =
do
different things in this kind of situation. In particular, the rules for
xs:import hint quite strongly that if you import a namespace that the
processor thinks it already knows about, then it is entitled to assume =
that
you are probably loading two copies of the same schema from different =
places
and it can ignore one of them. I don't know exactly what the rules =
applied
by XSV are, but as a general rule it's probably best to import only one
schema document for each namespace; if necessary that can be a document =
that
does nothing other than xs:include your two existing schema documents.

Michael Kay
http://www.saxonica.com/


> -----Original Message-----
> From: xmlschema-dev-request@w... 
> [mailto:xmlschema-dev-request@w...] On Behalf Of Cesar Ariza (gmd)
> Sent: 24 June 2008 05:55
> To: xmlschema-dev@w...
> Subject: Imports and namespaces
> 
> 
> Dear All,
> 
> I have some questions about using imports with the same namepace.
> 
> In the code below I have two imports, both files have the 
> same namespace inside.  I don=B4t want to import the container 
> library because I'll use only two elements.
> 
> Then, at "parsing time" some parser (XSV version: XSV 3.1-1 
> of 2007/12/11
> 16:20:05) I receive a message "
> Attempt to load a schema document from
> http://www.foo.com/schemas/Proyectos/THECOP/Core/tipoCodAdjudi
> cacion.xsd
> (source: import) for
> http://www.foo2.com/THE-XML/schemas/Proyectos/THECOP/Core-v1, 
> skipped, other docs already loaded for this namespace:
> http://www.foo.com/schemas/Proyectos/THECOP/Core/tipoNumResolu
> cion.xsd"
> 
> It is clear the error from the parser, but the XML Schema 
> language allows to do that, isn=92t it?
> 
> Any clue to solve this problem?
> 
> Cheers,
> 
> Cesar Ariza
> 
> 
> <?xml version="1.0" encoding="ISO-8859-1" ?>
> - <xsd:schema elementFormDefault="qualified" id="adjudicacion"
> targetNamespace="http://www.foo2.com/THE-XML/schemas/Proyectos
/THECOP/Adquis
> icion-v1" version="1.0" xmlns:dc="http://purl.org/dc/terms/"
> xmlns:secadq="http://www.foo2.com/THE-XML/schemas/Proyectos/TH
ECOP/Adquisici
> on-v1"
> xmlns:seccor="http://www.foo2.com/THE-XML/schemas/Proyectos/TH
ECOP/Core-v1"
> xmlns:xsd="http://www.w3.org/2001/XMLSchema">
>   <xsd:include schemaLocation="tipoResolucionAdjudicacion.xsd" />
>   <xsd:include schemaLocation="tipoCabeceraAdjudicacion.xsd" />
>   <xsd:include schemaLocation="tipoLineaItemAdj.xsd" />
>   <xsd:import
> namespace="http://www.foo2.com/THE-XML/schemas/Proyectos/THECO
P/Core-v1"
> schemaLocation="../Core/tipoListaDocumentoAdjunto.xsd" />
>   <xsd:import
> namespace="http://www.foo2.com/THE-XML/schemas/Proyectos/THECO
P/Core-v1"
> schemaLocation="../Core/tipoListaParte.xsd" />
> - <xsd:complexType name="tipoAdjudicacion">
> - <xsd:annotation>
> - <xsd:appinfo>
>  
> <dc:identifier>http://www.foo2.com/THE-XML/schemas/Proyectos/T
HECOP/Adquisic
> ion-v1/tipoAdjudicacion</dc:identifier>
>   <dc:date>2008-01-30</dc:date>
>   <dc:description xml:lang="es">Es el acto mediante el cual 
> se determinan a los aceptantes y/o adjudicatarios, de un acto 
> jur=EDdico generador de obligaciones, celebrado por una entidad 
> estatal.</dc:description>
>   <dc:hasVersion>1.0</dc:hasVersion>
>   </xsd:appinfo>
>   </xsd:annotation>
> - <xsd:sequence>
>   <xsd:element ref="secadq:resolucionAdjudicacion" />
>   <xsd:element ref="secadq:cabeceraAdjudicacion" />
>   <xsd:element ref="secadq:detalleAdjudicacion" />
>   <xsd:element minOccurs="0" ref="seccor:documentosAdjuntos" />
>   <xsd:element minOccurs="0" ref="seccor:proveedoresNoAdjudicados" =
/>
>   </xsd:sequence>
>   </xsd:complexType>
>   </xsd:schema>
> 
> 
> 
> 
> 


From boris@c... Wed Jun 25 08:25:05 2008
Received: from maggie.w3.org ([193.51.208.68])
	by frink.w3.org with esmtp (Exim 4.63)
	(envelope-f


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent