[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Can schemas be in the default namespace?

  • From: "G. Ken Holman" <gkholman@CraneSoftwrights.com>
  • To: Steinar Bang <sb@dod.no>,xml-dev@l...
  • Date: Tue, 05 May 2015 08:43:11 -0400

Re:  Can schemas be in the default namespace?
At 2015-05-05 14:15 +0200, Steinar Bang wrote:
Is it legal to do this?
  <schema xmlns="http://www.w3.org/2001/XMLSchema">
    ...
  </schema>
Yes.

I'm dealing with some schemas that don't use a namspace prefix for the
schema namespace, ie. they are defined like this:
<schema xmlns:xsd="http://www.w3.org/2001/XMLSchema.xsd" xmlns="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">

Ie. they have set xmlns="http://www.w3.org/2001/XMLSchema" (and
xmlns:xsd="http://www.w3.org/2001/XMLSchema.xsd" as well, though the
"xsd:" prefix isn't used anywhere I could see).
Not a problem.

XML Validator Buddy[1] didn't complain about this, but eclipse WTP[2]
(WTP 3.6.3 on Luna SR2) on
<import namespace="http://www.myorg.no/xmlstds" schemaLocation="../common/myorg.xsd"/>
gives the following error message
schema_reference.4: Failed to read schema document '../common/myorg.xsd', because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not <xsd:schema>. ER-M30-2014-12-01.xsd /MYProject/Myfolder line 13 XML Schema Problem
That sounds like a bug as if they were expecting prefix-based properties.

The XSLT-based XSD to RNG converter[3] says:
error on line 11 at column 37: xml namespace URI cannot be the default namespace
I understand the wording of that message to be talking about the namespace used for xml:space= and xml:lang=, not the namespace for XSD. One isn't allowed to declare the namespace for the "xml:" prefix.

Who are right?  Is it possible to tickle the schemas so that WTP and/or
the XSLT converter will accept them?
"Tickle"? No ... wholesale edit removing the use of the default namespace in order to accommodate a buggy validator.

Is the problem that both the outer schema and the imported schema uses "xmlns="?
It is difficult to understand the "bug emulation mode" of a non-conformant processor.

I hope this helps.

. . . . . . Ken

Thanks!


- Steinar

[1] http://www.xml-buddy.com/ValidatorBuddy.htm
[2] http://www.eclipse.org/webtools/phoenix/webtools/
[3] http://debeissat.nicolas.free.fr/XSDtoRNG.php

--
Check our site for free XML, XSLT, XSL-FO and UBL developer resources |
Free 5-hour lecture:  http://www.CraneSoftwrights.com/links/video.htm |
Crane Softwrights Ltd.             http://www.CraneSoftwrights.com/x/ |
G. Ken Holman                    mailto:gkholman@CraneSoftwrights.com |
Google+ profile:       http://plus.google.com/+GKenHolman-Crane/about |
Legal business disclaimers:     http://www.CraneSoftwrights.com/legal |


---
This email has been checked for viruses by Avast antivirus software.
http://www.avast.com



[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.