[xml] XML schema for empty NS failed to compile due to xmlns=""



Consider the following doc and schema:

  $ cat emptyns.xml
  <Urmel>33</Urmel>

  $ cat emptyns.xsd
  <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema";>
      <xsd:element name="Urmel" type="Urmel_T"/>
      <!-- Convoluted typing just for the sake of the example -->
      <xsd:simpleType name="Urmel_T">
          <xsd:restriction base="xsd:int"/>
      </xsd:simpleType>
  </xsd:schema>

  $ xmllint --noout --schema emptyns.xsd emptyns.xml
  emptyns.xml validates

Now let's make a stupid edit to the schema file, add a redundant
xmlns="" to the top-level element. This sets the empty namespace
as the default namespace. And it is redundant because the empty
namespace already *is* the default namespace.

  $ head -1 emptyns.xsd
  <xsd:schema xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema";>

  $ xmllint --noout emptyns.xsd # parses just fine

The schema now fails to compile:

  $ xmllint --noout --schema emptyns.xsd emptyns.xml
  Element '{http://www.w3.org/2001/XMLSchema}element', attribute
  'type': References from this schema to components in the namespace
  '' are not allowed, since not indicated by an import statement.
  WXS schema emptyns.xsd failed to compile

Should I add this to the bugtracker? Or is it just too stupid to
be worthy of further attention?

Michael
-- 
NEU: FreePhone - 0ct/min Handyspartarif mit Geld-zurÃck-Garantie!               
Jetzt informieren: http://www.gmx.net/de/go/freephone



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]