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

Including schema with target namespace from schema with no target namespace

From: Bob Kline <bkline@rksystems.com>
Date: Mon, 09 Feb 2009 12:07:13 -0500
Message-ID: <499062C1.7050204@rksystems.com>
To: xmlschema-dev@w3.org

We've got XML documents which look (greatly simplified) like this:

<?xml version='1.0' encoding='utf-8'?>
<TopLevelElement cdr:ref='...' otherAttribute='...'>...</TopLevelElement>

None of the element names and few of the attribute names in the 
documents include colons.  The structures for the documents evolved well 
before the w3c bodies released their recommendations on namespaces and 
schemas.  The use of colons in some of the attribute names was done to 
accomplish in a DTD-based, pre-namespace-aware world roughly the same 
thing which the namespace rec gives as its motivation (avoid stepping on 
names which would be the same without 'cdr:' part).  When the namespace 
rec was released we added xmlns:cdr='...' to the top-level elements of 
the documents so namespace-aware processors wouldn't choke on the documents.

In an attempt to migrate from DTD validation to XML Schema validation, 
we're running into a stumbling block.  Since each schema document can 
have at most only one target namespace, we've put the definitions for 
the cdr prefixed attributes in one schema document, which has a target 
namespace.  We then include that document in the schema document for the 
rest of the elements and types.  Schema processors won't accept this, 
complaining that  "[t]he target namespace of the included/redefined 
schema 'CdrNamespaceAttributes.xml' has to be absent, since the 
including/redefining schema has no target namespace."

If that's so, how do we go about validating a document which looks like 
the one above using XML Schema?

Bob Kline
Received on Tuesday, 10 February 2009 10:45:01 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:56:15 UTC