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/07/27 14:51:24 UTC
[Bug 2856] New: - XML validation against Schema doesn't work for Xerces parsers 1.4 and 2_0 alpha
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=2856
*** shadow/2856 Fri Jul 27 05:51:24 2001
--- shadow/2856.tmp.27658 Fri Jul 27 05:51:24 2001
***************
*** 0 ****
--- 1,85 ----
+ +============================================================================+
+ | XML validation against Schema doesn't work for Xerces parsers 1.4 and 2_0 |
+ +----------------------------------------------------------------------------+
+ | Bug #: 2856 Product: Xerces-J |
+ | Status: NEW Version: 1.4.1 |
+ | Resolution: Platform: All |
+ | Severity: Critical OS/Version: All |
+ | Priority: Other Component: Other |
+ +----------------------------------------------------------------------------+
+ | Assigned To: xerces-j-dev@xml.apache.org |
+ | Reported By: KenQYang@yahoo.com |
+ | CC list: Cc: |
+ +----------------------------------------------------------------------------+
+ | URL: |
+ +============================================================================+
+ | DESCRIPTION |
+ here is the sample code:
+
+ Using your xerces J 2_0 alpha, give following exception:
+ org.apache.xerces.dom.DOMExceptionImpl: DOM003 Namespace error
+
+ Using your xerces 1.4.1, it complains all sorts of error in xml documents which
+ are perfectly fine.
+
+ import java.io.*;
+ import org.w3c.dom.Attr;
+ import org.w3c.dom.Document;
+ import org.w3c.dom.Element;
+ import org.w3c.dom.NamedNodeMap;
+ import org.w3c.dom.Node;
+ import org.w3c.dom.NodeList;
+ import org.xml.sax.InputSource;
+ import org.w3c.dom.NamedNodeMap;
+ import org.xml.sax.Locator;
+ import org.xml.sax.helpers.*;
+ import org.apache.xerces.dom.NodeImpl;
+ //import org.apache.xerces.framework.XMLAttrList;
+ import org.apache.xerces.parsers.DOMParser;
+ //import org.apache.xerces.utils.QName;
+
+ //import org.apache.xerces.dom.*;
+ //import org.apache.xerces.validators.common.*;
+ //import org.apache.xerces.validators.schema.*;
+
+ public class SchemaValidate2 extends DOMParser {
+
+ /** Print writer. */
+ private PrintWriter out;
+ private static boolean NotIncludeIgnorableWhiteSpaces = false;
+ private static final String INDENT = " ";
+
+ public SchemaValidate2( String inputName ) {
+ //fNodeExpansion = FULL; // faster than: this.setFeature
+ ("http://apache.org/xml/features/defer-node-expansion", false);
+
+ try {
+ //this.setFeature( "http://apache.org/xml/features/dom/defer-node-
+ expansion", true );
+
+ this.setFeature( "http://apache.org/xml/features/validation/schema",
+ true );
+ this.setFeature( "http://xml.org/sax/features/validation", true );
+
+ this.parse( inputName );
+ out = new PrintWriter(new OutputStreamWriter(System.out, "UTF8"));
+ } catch ( IOException e ) {
+ System.err.println( "except" + e );
+ } catch ( org.xml.sax.SAXException e ) {
+ System.err.println( "except" + e );
+ }
+ }
+
+ public static void main(String argv[]) {
+ if ( argv.length == 0 ) {
+ printUsage();
+ System.exit(1);
+ }
+ SchemaValidate2 sv = new SchemaValidate2( argv[0] );
+ Document doc = sv.getDocument();
+ }
+
+ private static void printUsage() {
+ System.err.println("usage: jre SchemaValidate [filename]");
+ }
+ }
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-dev-help@xml.apache.org