W3C home > Mailing lists > Public > xmlschema-dev@w3.org > August 2009

RE: Unqualified elment - but still have prefix at the root

From: Simon Cox <simon.cox@jrc.ec.europa.eu>
Date: Tue, 25 Aug 2009 14:18:22 +0200
To: "'Michael Kay'" <mike@saxonica.com>, "'Avihaimar'" <avihaimar@yahoo.com>, <xmlschema-dev@w3.org>
Message-ID: <4B52A5216C904A96A8810A7DCEECEFE5@H07.jrc.it>
The Libray and Book elements are declared in different namespaces. 
The instance document has to distinguish between the namespaces in use
somehow. 
So one of them must have a prefix to achieve this.  


--------------------------------------------------------
Simon Cox

European Commission, Joint Research Centre, 
Institute for Environment and Sustainability, 
Spatial Data Infrastructures Unit, TP 262 
Via E. Fermi, 2749, I-21027 Ispra (VA), Italy 
Tel: +39 0332 78 3652
Fax: +39 0332 78 6325
mailto:simon.cox@jrc.ec.europa.eu 
http://ies.jrc.ec.europa.eu/simon-cox 

SDI Unit: http://sdi.jrc.ec.europa.eu/ 
IES Institute: http://ies.jrc.ec.europa.eu/
JRC: http://www.jrc.ec.europa.eu/
--------------------------------------------------------

-----Original Message-----
From: xmlschema-dev-request@w3.org [mailto:xmlschema-dev-request@w3.org] On
Behalf Of Michael Kay
Sent: Tuesday, 25 August 2009 13:32
To: 'Avihaimar'; xmlschema-dev@w3.org
Subject: RE: Unqualified elment - but still have prefix at the root

The instance document is valid against your schema. I don't know whether the
Altova tool gives you any choice over the use of namespace prefixes, you
will have to consult the Altova documentation or support. But any user of
this XML document shouldn't care about the allocation of prefixes - it's
only the namespaces that are significant. So the question is: why does it
matter? Because if it does matter, then there is something wrong with your
application requirement.

Regards,

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



> -----Original Message-----
> From: xmlschema-dev-request@w3.org
> [mailto:xmlschema-dev-request@w3.org] On Behalf Of Avihaimar
> Sent: 25 August 2009 11:54
> To: xmlschema-dev@w3.org
> Subject: Re: Unqualified elment - but still have prefix at the root
> 
> 
> Exampel :  lib.xsd import book.xsd (both with unqualified)
> 
> ------   LIB -------
> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
> xmlns="http://www.library.org" xmlns:b="http://www.book.org"
> targetNamespace="http://www.library.org" 
> elementFormDefault="unqualified"
> attributeFormDefault="unqualified">
> 	<xs:import namespace="http://www.book.org" 
> schemaLocation="Book.xsd"/>
> 	<xs:element name="Library" type="Library"/>
> 	<xs:complexType name="Library">
> 		<xs:sequence>
> 			<xs:element name="BookCatalogue">
> 				<xs:complexType>
> 					<xs:sequence>
> 						<xs:element
> name="test" type="b:BookType" maxOccurs="unbounded"/>
> 					</xs:sequence>
> 				</xs:complexType>
> 			</xs:element>
> 		</xs:sequence>
> 	</xs:complexType>
> </xs:schema>
> 
> 
> 
> ---------------------   Book  --------------
> <?xml version="1.0"?>
> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
> xmlns="http://www.book.org" targetNamespace="http://www.book.org"
> elementFormDefault="unqualified" attributeFormDefault="unqualified">
> 	<xs:complexType name="BookType">
> 		<xs:sequence>
> 			<xs:element name="Title" type="xs:string"/>
> 		</xs:sequence>
> 	</xs:complexType>
> </xs:schema>
> 
> 
> 
> When i generate xml in xmlspy i get the following xml (with
> n1 prefix , but i dont want prefix!!!!)
> 
> ------------------------ XML ------------------- <?xml version="1.0" 
> encoding="UTF-8"?> <!--Sample XML file generated by XMLSpy v2008 sp1 
> (http://www.altova.com)--> <n1:Library 
> xsi:schemaLocation="http://www.library.org lib.xsd"
> xmlns:n1="http://www.library.org"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
> 	<BookCatalogue>
> 		<test>
> 			<Title>String</Title>
> 		</test>
> 	</BookCatalogue>
> </n1:Library>
> 
> 
> 
> 
> Thank you!!!!!!
> --
> View this message in context: 
> http://www.nabble.com/Unqualified-elment---but-still-have-pref
> ix-at-the-root-tp25123070p25132221.html
> Sent from the w3.org - xmlschema-dev mailing list archive at 
> Nabble.com.
> 
> 
Received on Tuesday, 25 August 2009 12:19:08 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 11 January 2011 00:15:14 GMT