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

*** shadow/2634 Sun Jul 15 12:54:06 2001
--- shadow/2634.tmp.26549       Sun Jul 15 12:54:07 2001
***************
*** 0 ****
--- 1,74 ----
+ +============================================================================+
+ | simple use of substitutionGroup fails                                      |
+ +----------------------------------------------------------------------------+
+ |        Bug #: 2634                        Product: Xerces-C++              |
+ |       Status: NEW                         Version: 1.5                     |
+ |   Resolution:                            Platform: PC                      |
+ |     Severity: Major                    OS/Version: Windows NT/2K           |
+ |     Priority: Other                     Component: Validating Parser (Sche |
+ +----------------------------------------------------------------------------+
+ |  Assigned To: [EMAIL PROTECTED]                                  |
+ |  Reported By: [EMAIL PROTECTED]                                                |
+ |      CC list: Cc:                                                          |
+ +----------------------------------------------------------------------------+
+ |          URL:                                                              |
+ +============================================================================+
+ |                              DESCRIPTION                                   |
+ Here's a simple XML document:
+ 
+ <?xml version='1.0' encoding='UTF-8' standalone='no'?>
+ <foo xmlns='http://www.foo.com'
+     xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
+     xsi:schemaLocation='http://www.foo.com file:///dev/Bug.xsd' version='1.0'>
+ </foo>
+ 
+ Here's its schema:
+ 
+ <!-- Bug schema -->
+ <schema targetNamespace="http://www.foo.com"; xmlns:foo="http://www.foo.com"; 
+ xmlns="http://www.w3.org/2001/XMLSchema"; elementFormDefault="qualified" 
+ version="1.0">
+     <!-- Abstract element to serve as a template for child elements of 'foo.' --
+ >
+     <element name="foo-base" abstract="true"/>
+     <!-- Global root 'foo' element.  Define substitution groups in sub-schemas 
+ for 'foo-base' to
+        add child elements to 'foo.' -->
+     <element name="foo" substitutionGroup="foo:foo-base">
+         <complexType>
+             <sequence>
+                 <!-- <element ref="foo:foo-base" minOccurs="0"/> -->
+                 <element name="fred" minOccurs="0"/>
+             </sequence>
+             <attribute name="version" type="string" use="required"/>
+         </complexType>
+     </element>
+ </schema>
+ 
+ Here's how I parse it:
+ 
+     DOMParser parser;
+ 
+     parser.setErrorHandler(&m_errHandler);
+ 
+     parser.setIncludeIgnorableWhitespace(false);
+     parser.setDoValidation(true);
+     parser.setDoSchema(true);
+     parser.setValidationScheme(DOMParser::Val_Auto);
+     parser.setDoNamespaces(true);
+ 
+     parser.setCreateEntityReferenceNodes(false);
+     parser.setToCreateXMLDeclTypeNode(false);
+ 
+     try
+     {
+         parser.parse(wszFilename);
+         .
+         .
+         .
+ 
+ The result is a SAXParseException from which I extract the following 
+ information:
+ 
+ "Error parsing file 'D:\dev\Moonwatcher\Dev\NPS\xml\Bug.xml', line 4, column 
+ 103:  Type not found in http://www.foo.com:foo-base.";

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

Reply via email to