W3C home > Mailing lists > Public > xmlschema-dev@w3.org > February 2004

default namespace

From: Rolf Schumacher <rolf.schumacher@hamburg.de>
Date: Mon, 16 Feb 2004 23:38:48 +0100
Message-ID: <40314678.8050404@hamburg.de>
To: xmlschema-dev@w3.org
I run an xml editor that's able to validate against xml schema.
I have this very simple schema:

<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema elementFormDefault="qualified"
  targetNamespace="http://www.example.org/testNamespace"
  xmlns="http://www.example.org/testNamespace"
  xmlns:xsd="http://www.w3.org/2001/XMLSchema"
 >
  <xsd:element name="root" type="xsd:string"/>
</xsd:schema>

It perfectly validates this instantiation:

<?xml version="1.0" encoding="UTF-8"?>
<ns:root xmlns:ns="http://www.example.org/testNamespace">
    the string
</ns:root>

But it does not validate this one:

<?xml version="1.0" encoding="UTF-8"?>
<root xmlns="http://www.example.org/testNamespace">
    the string
</root>

To be honest, I can't find a significant difference.
I do not understand the error message: >unexpected attribute "xmlns"<
that comes from a validation against the above schema.

Just to make it very clear: Where is the error?
In my input or in the validation?

Thanks for help

Rolf

Received on Wednesday, 18 February 2004 16:02:29 GMT

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