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/16 17:24:28 UTC

[Bug 995] New - Errors not reported by the parser for an invalid pattern match in an instance document

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

*** shadow/995	Fri Mar 16 08:24:28 2001
--- shadow/995.tmp.23405	Fri Mar 16 08:24:28 2001
***************
*** 0 ****
--- 1,64 ----
+ +============================================================================+
+ | Errors not reported by the parser for an invalid pattern match in an insta |
+ +----------------------------------------------------------------------------+
+ |        Bug #: 995                         Product: Xerces-J                |
+ |       Status: NEW                         Version: 1.3.0                   |
+ |   Resolution:                            Platform: PC                      |
+ |     Severity: Normal                   OS/Version:                         |
+ |     Priority: Medium                    Component: Schema-Datatypes        |
+ +----------------------------------------------------------------------------+
+ |  Assigned To: xerces-j-dev@xml.apache.org                                  |
+ |  Reported By: nddelima@ca.ibm.com                                          |
+ |      CC list: Cc:                                                          |
+ +----------------------------------------------------------------------------+
+ |          URL:                                                              |
+ +============================================================================+
+ |                              DESCRIPTION                                   |
+ Consider the following scenario:
+ A schema with a simple type derived by restriction from a primitive/derived 
+ datatype.  A complex type in the same schema that uses the simple type to 
+ specify the datatype of an attribute. An instance document that uses the 
+ schema.  The parser does not report an error for an invalid instance in the 
+ following situation:
+ 
+ The simpleType in the schema makes use of the primitive type "ID" with the 
+ facet "pattern". The attribute's value in the instance does not conform to the 
+ pattern specified by the "pattern" facet in the schema.
+ IBM schema invalid test case: ibmd3_2_10ii04
+ 
+ A sample schema and instance are as below:
+ Sample schema:  TestSchema.xsd
+ <?xml version="1.0"?>
+ <schema xmlns="http://www.w3.org/2000/10/XMLSchema"
+ 	targetNamespace="http://www.schemaTest.org/Test"
+ 	xmlns:dv="http://www.schemaTest.org/Test">
+ 
+ <simpleType name="id1">
+ 	<restriction base="ID">
+ 		<pattern value="[A-Z]{2}_\d{4}"/>
+ 	</restriction>
+ </simpleType>
+ 
+ 
+ <element name="root">
+ 	<complexType mixed="true">
+ 		<sequence>
+ 			<element name="element1">
+ 				<complexType>
+ 					 <attribute name="attr1" type="dv:id1"/>
+ 				</complexType>
+ 			</element>
+ 		</sequence>
+ 	</complexType>
+ </element>
+ </schema>
+ 
+ Sample Instance:  TestSchema.xml
+ <?xml version="1.0" encoding="UTF-8"?>
+ <idv1:root xmlns:idv1="http://www.schemaTest.org/Test"
+ 	xmlns:xsi="http://www.w3.org/2000/10/XMLSchema-instance"
+ 	xsi:schemaLocation="http://www.schemaTest.org/Test 
+ 	TestSchema.xsd">
+ 	
+ 	<element1 attr1="A1-1234_AAA"/>
+ </idv1:root>

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