neeraj 2003/11/06 01:18:23
Modified: java/src/org/apache/xerces/dom CoreDocumentImpl.java
Log:
Fixing another bug. NOT_SUPPORTED_ERR: Raised if the version is set to a value that
is not supported by this Document.
We only support XML version 1.0 and 1.1
Revision Changes Path
1.50 +12 -2 xml-xerces/java/src/org/apache/xerces/dom/CoreDocumentImpl.java
Index: CoreDocumentImpl.java
===================================================================
RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/dom/CoreDocumentImpl.java,v
retrieving revision 1.49
retrieving revision 1.50
diff -u -r1.49 -r1.50
--- CoreDocumentImpl.java 1 Nov 2003 18:55:27 -0000 1.49
+++ CoreDocumentImpl.java 6 Nov 2003 09:18:23 -0000 1.50
@@ -808,7 +808,17 @@
* the version number of this document. This is null when unspecified
*/
public void setXmlVersion(String value) {
- version = value;
+ if(version.equals("1.0") || version.equals("1.1"){
+ version = value;
+ }
+ else{
+ //NOT_SUPPORTED_ERR: Raised if the vesion is set to a value that is not
supported by
+ //this document
+ //we dont support any other XML version
+ String msg =
DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NOT_SUPPORTED_ERR",
null);
+ throw new DOMException(DOMException.NOT_SUPPORTED_ERR, msg);
+
+ }
}
/**
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]