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

*** shadow/2541 Tue Jul 10 09:33:27 2001
--- shadow/2541.tmp.25917       Tue Jul 10 09:33:27 2001
***************
*** 0 ****
--- 1,68 ----
+ +============================================================================+
+ | Parser does not report current node when there is a validation error in an |
+ +----------------------------------------------------------------------------+
+ |        Bug #: 2541                        Product: Xerces-J                |
+ |       Status: NEW                         Version: 1.4.1                   |
+ |   Resolution:                            Platform: All                     |
+ |     Severity: Major                    OS/Version: All                     |
+ |     Priority: Other                     Component: Core                    |
+ +----------------------------------------------------------------------------+
+ |  Assigned To: [EMAIL PROTECTED]                                  |
+ |  Reported By: [EMAIL PROTECTED]                                               |
+ |      CC list: Cc:                                                          |
+ +----------------------------------------------------------------------------+
+ |          URL:                                                              |
+ +============================================================================+
+ |                              DESCRIPTION                                   |
+ When handling a parser validation error, the method call 
+ 
+   parser.getProperty("http://apache.org/xml/properties/dom/current-element-
+ node"); 
+ 
+ normally returns the document node where the validation error occurs.
+ I say normally, because there is an exception to the rule which is probably a 
+ bug:
+ 
+ SCHEMA (schema.xsd)
+ ===================
+ <?xml version="1.0" encoding="UTF-8"?>
+ <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema";>
+       <xsd:element name="Root">
+               <xsd:complexType>
+                       <xsd:sequence>
+                               <xsd:element name="Element">
+                                         <xsd:complexType>
+                                             <xsd:attribute name="attr2" 
+ type="xsd:int" fixed="2"/>
+                                         </xsd:complexType>
+                                 </xsd:element>
+                       </xsd:sequence>
+                       <xsd:attribute name="attr1" type="xsd:int" fixed="1"/>
+               </xsd:complexType>
+       </xsd:element>
+ </xsd:schema>
+ 
+ DOCUMENT (doc.xml)
+ ==================
+ <?xml version="1.0" encoding="UTF-8"?>
+ <Root xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
+ xsi:noNamespaceSchemaLocation="schema.xsd" attr1="9">
+       <Element attr2="9"/>
+ </Root>
+ 
+ 
+ DESCRIPTION OF TEST
+ ===================
+ The sax errorhandler is called twice during validation of this code.
+ 
+ a. The "attr1" attribute of the Root element has the illegal value "9" (it is 
+ defined as "fixed=1" in the schema).
+ b. The "attr2" attribute" of the Element element has the illegal value "9" (it 
+ is defined as "fixed=2" in the schema).
+ 
+ Retrieval of the "http://apache.org/xml/properties/dom/current-element-node"; 
+ property during handling of the second error returns the current node (the 
+ Element element), as expected.
+ 
+ However, this property retrieval FAILS during handling of the first error, 
+ instead of returning the Root element as it should.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to