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/03/02 21:48:36 UTC
[Bug 822] New - xsi:type ignored for wildcard element in instance
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=822
*** shadow/822 Fri Mar 2 12:48:36 2001
--- shadow/822.tmp.26959 Fri Mar 2 12:48:36 2001
***************
*** 0 ****
--- 1,66 ----
+ +============================================================================+
+ | xsi:type ignored for wildcard element in instance |
+ +----------------------------------------------------------------------------+
+ | Bug #: 822 Product: Xerces-J |
+ | Status: NEW Version: 1.3.0 |
+ | Resolution: Platform: All |
+ | Severity: Normal OS/Version: All |
+ | Priority: Medium 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_3_7v24
+
+ If an element appears in an instance document in place of a wildcard <any
+ processContents="strict"/> in the schema, either:
+
+ "There must be a global declaration for the item available, OR it must have an
+ xsi:type, and it must be valid as appropriate." (XML Schema Structures Spec
+ (CR) - Oct. 24, 2000)
+
+ The validation works OK if the element HAS a global declaration in the schema,
+ but fails when using xsi:type for an element that DOES NOT.
+
+ Example schema (wild.xsd)
+ =========================
+ <?xml version="1.0"?>
+ <schema xmlns="http://www.w3.org/2000/10/XMLSchema">
+
+ <simpleType name="strType">
+ <restriction base="string"/>
+ </simpleType>
+
+ <element name="element" type="strType"/>
+
+ <element name="root">
+ <complexType>
+ <sequence>
+ <any/>
+ </sequence>
+ </complexType>
+ </element>
+
+ </schema>
+
+ Example instance (wild.xml)
+ ===========================
+ <?xml version="1.0"?>
+ <root xmlns:xsi="http://www.w3.org/2000/10/XMLSchema-instance"
+ xsi:noNamespaceSchemaLocation="wild.xsd">
+
+ <elem xsi:type="strType">string</elem>
+
+ </root>
+
+ The test should be valid, but the parser produces the error:
+ "Element type "elem" must be declared."
+
+ If the instance document line: <elem xsi:type="strType">string</elem>
+ is replaced with: <element>string</element>
+
+ the test passes OK.