You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by bu...@apache.org on 2001/02/27 21:29:12 UTC

[Bug 739] New - xs:targetNamespace attribute not recognized

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=739

*** shadow/739	Tue Feb 27 12:29:12 2001
--- shadow/739.tmp.2064	Tue Feb 27 12:29:12 2001
***************
*** 0 ****
--- 1,47 ----
+ +============================================================================+
+ | xs:targetNamespace attribute not recognized                                |
+ +----------------------------------------------------------------------------+
+ |        Bug #: 739                         Product: Xerces-J                |
+ |       Status: NEW                         Version: 1.3.0                   |
+ |   Resolution:                            Platform: All                     |
+ |     Severity: Normal                   OS/Version: All                     |
+ |     Priority: Low                       Component: Schema-Structures       |
+ +----------------------------------------------------------------------------+
+ |  Assigned To: xerces-j-dev@xml.apache.org                                  |
+ |  Reported By: mhuffman@ca.ibm.com                                          |
+ |      CC list: Cc:                                                          |
+ +----------------------------------------------------------------------------+
+ |          URL:                                                              |
+ +============================================================================+
+ |                              DESCRIPTION                                   |
+ IBM Test Case: ibm4_1v28
+ 
+ When xmlns:xs="http://www.w3.org/2000/10/XMLSchema" is used in a schema instead 
+ of xmlns="http://www.w3.org/2000/10/XMLSchema", the attribute 
+ xs:targetNamespace is not processed properly.
+ 
+ Example Schema:
+ ===============
+ <?xml version="1.0"?>
+ <xs:schema xmlns:xs          ="http://www.w3.org/2000/10/XMLSchema"
+            xs:targetNamespace="http://www.schemaTest.org/ibm4_1v28">
+   <xs:element xs:name="root" xs:type="xs:string"/>
+ </xs:schema>
+ 
+ Example Instance Document:
+ ==========================
+ <?xml version="1.0"?>
+ <root xmlns:xsi         ="http://www.w3.org/2000/10/XMLSchema-instance"
+       xmlns             ="http://www.schemaTest.org/ibm4_1v28"
+       xsi:schemaLocation="http://www.schemaTest.org/ibm4_1v28
+                           ibm4_1v28.xsd">
+   This is a valid test.
+ </root>
+ 
+ The parser reports the following error:
+ 
+ General Schema Error: Schema in ibm4_1v28.xsd has a different target namespace 
+ from the one specified in the instance document: 
+ http://www.schemaTest.org/ibm4_1v28
+ 
+ Without using the xs: prefix (using xmlns= instead) no errors are produced.

Re: [Bug 739] New - xs:targetNamespace attribute not recognized

Posted by Ian Roberts <ir...@decisionsoft.com>.
On Tue, 27 Feb 2001 bugzilla@apache.org wrote:

> + When xmlns:xs="http://www.w3.org/2000/10/XMLSchema" is used in a schema instead 
> + of xmlns="http://www.w3.org/2000/10/XMLSchema", the attribute 
> + xs:targetNamespace is not processed properly.
> + 
> + Example Schema:
> + ===============
> + <?xml version="1.0"?>
> + <xs:schema xmlns:xs          ="http://www.w3.org/2000/10/XMLSchema"
> +            xs:targetNamespace="http://www.schemaTest.org/ibm4_1v28">
> +   <xs:element xs:name="root" xs:type="xs:string"/>
> + </xs:schema>

<snip />

> + 
> + Without using the xs: prefix (using xmlns= instead) no errors are produced.

Given that default namespace bindings don't apply to attributes, I'd guess
this is the correct behaviour: with no prefix you have a "schema" element
in the XMLSchema namespace, with a targetNamespace attribute in the null
namespace.  With prefixes the targetNamespace attribute is in the
XMLSchema namespace, so it's not recognised as a targetNamespace.

Ian

-- 
Ian Roberts, Software Engineer        DecisionSoft Ltd.
tel: +44-1865-203192                  http://www.decisionsoft.com