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/08/06 22:14:55 UTC

[Bug 3006] New: - Restricted type where the base type uses local element is not allowed

PLEASE DO NOT REPLY TO THIS MESSAGE. TO FURTHER COMMENT
ON THE STATUS OF THIS BUG PLEASE FOLLOW THE LINK BELOW
AND USE THE ON-LINE APPLICATION. REPLYING TO THIS MESSAGE
DOES NOT UPDATE THE DATABASE, AND SO YOUR COMMENT WILL
BE LOST SOMEWHERE.

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

*** shadow/3006	Mon Aug  6 13:14:55 2001
--- shadow/3006.tmp.8120	Mon Aug  6 13:14:55 2001
***************
*** 0 ****
--- 1,96 ----
+ +============================================================================+
+ | Restricted type where the base type uses local element is not allowed      |
+ +----------------------------------------------------------------------------+
+ |        Bug #: 3006                        Product: Xerces-J                |
+ |       Status: NEW                         Version: 1.4.2                   |
+ |   Resolution:                            Platform: PC                      |
+ |     Severity: Normal                   OS/Version: Windows NT/2K           |
+ |     Priority: Other                     Component: Schema-Structures       |
+ +----------------------------------------------------------------------------+
+ |  Assigned To: xerces-j-dev@xml.apache.org                                  |
+ |  Reported By: jslein@crt.xerox.com                                         |
+ |      CC list: Cc:                                                          |
+ +----------------------------------------------------------------------------+
+ |          URL:                                                              |
+ +============================================================================+
+ |                              DESCRIPTION                                   |
+ If my base type uses locally declared elements, an attempt to restrict that 
+ type gets a rcase-Recurse.2 error.  (I'm not completely sure that this is a 
+ bug, since the spec's language on restrictions is so difficult.  But the XML 
+ Schema Primer's example of restricted types uses local element declarations.)
+ 
+ Here is a schema that demonstrates the problem.  It has equivalent restricted 
+ types, one with a base type built of locally declared elements and the other 
+ with a base type built of globally declared elements:
+ 
+ <?xml version="1.0" encoding="utf-8"?>
+ <!-- edited with XML Spy v4.0 NT beta 2 build Jul 26 2001 
+ (http://www.xmlspy.com) by Oscar Garcia Mata (MAN Roland Druckmaschinen AG, 
+ Mühlheim) -->
+ <xsd:schema targetNamespace="http://www.CIP4.org/JDFSchema_1"
+  xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+  xmlns:jdf="http://www.CIP4.org/JDFSchema_1"
+  elementFormDefault="qualified" attributeFormDefault="unqualified">
+ 
+ <xsd:element name="MyElementLocals" type="jdf:RestrictedTypeLocals"/>
+ <xsd:element name="MyElementGlobals" type="jdf:RestrictedTypeGlobals"/>
+ 
+ <xsd:element name="AGlobalElement1" type="xsd:string"/>
+ <xsd:element name="AGlobalElement2" type="xsd:string"/>
+ 
+ <xsd:complexType name="BaseTypeGlobals">
+    <xsd:sequence>
+       <xsd:element ref="jdf:AGlobalElement1" minOccurs="0"/>
+       <xsd:element ref="jdf:AGlobalElement2" minOccurs="0"/>
+    </xsd:sequence>
+ </xsd:complexType>
+ 
+ <xsd:complexType name="RestrictedTypeGlobals">
+    <xsd:complexContent>
+       <xsd:restriction base="jdf:BaseTypeGlobals">
+          <xsd:sequence>
+             <xsd:element ref="jdf:AGlobalElement2"/>
+          </xsd:sequence>
+       </xsd:restriction>
+    </xsd:complexContent>
+ </xsd:complexType>
+ 
+ <xsd:complexType name="BaseTypeLocals">
+    <xsd:sequence>
+       <xsd:element name="ALocalElement1" type="xsd:string" minOccurs="0"/>
+       <xsd:element name="ALocalElement2" type="xsd:string" minOccurs="0"/>
+    </xsd:sequence>
+ </xsd:complexType>
+ 
+ <xsd:complexType name="RestrictedTypeLocals">
+    <xsd:complexContent>
+       <xsd:restriction base="jdf:BaseTypeLocals">
+          <xsd:sequence>
+             <xsd:element name="ALocalElement2"/>
+          </xsd:sequence>
+       </xsd:restriction>
+    </xsd:complexContent>
+ </xsd:complexType>
+ 
+ </xsd:schema>
+ 
+ 
+ Here is an instance document to go with it:
+ 
+ <?xml version="1.0" encoding="utf-8"?>
+ 
+ <MyElementLocals xmlns="http://www.CIP4.org/JDFSchema_1" 
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
+ xsi:schemaLocation="http://www.CIP4.org/JDFSchema_1 Restriction.xsd">
+    <ALocalElement2>Restricted type built from locally declared elements 
+ </ALocalElement2>
+ </MyElementLocals>
+ 
+ <!--
+ <MyElementGlobals xmlns="http://www.CIP4.org/JDFSchema_1" 
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
+ xsi:schemaLocation="http://www.CIP4.org/JDFSchema_1 Restriction.xsd">
+    <AGlobalElement2>Restricted type built from globally declared elements 
+ </AGlobalElement2>
+ </MyElementGlobals>
+ -->
\ No newline at end of file

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-dev-help@xml.apache.org