W3C home > Mailing lists > Public > xmlschema-dev@w3.org > April 2007

multiple namespaces

From: Andrew Welch <andrew.j.welch@gmail.com>
Date: Mon, 23 Apr 2007 14:48:42 +0100
Message-ID: <74a894af0704230648j20eb9c2g75a733c4f455602f@mail.gmail.com>
To: xmlschema-dev@w3.org

With this XML:

  <ns1:foo>some text</ns1:foo>
  <ns2:bar>some text</ns2:bar>

Am I right in thinking I need two schemas - one for each namespace?

Also, if I define a simple type of non-empty-string:

    <xs:simpleType name="non-empty-string">		
		<xs:restriction base="xs:string">		
			<xs:minLength value="1"/>		
		</xs:restriction>		
    </xs:simpleType>	 	

...when I refer to that type it seems I have to use the prefix defined
in the schema, for example to use the simple type above I need:

<xs:element name="foo" type="ns1:non-empty-string"/>

The same applies to groups:

<xs:group name="someGroup">

and

<xs:group ref="ns1:someGroup">

It seems odd that groups and simple types require the prefix, as if
they are in a default namespace.  Am I missing something here?

thanks
andrew
Received on Monday, 23 April 2007 13:48:45 GMT

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