You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by el...@apache.org on 2002/07/25 21:16:11 UTC

cvs commit: xml-xerces/java/src/org/apache/xerces/dom ASDOMImplementationImpl.java ASModelImpl.java AttrImpl.java AttrNSImpl.java AttributeMap.java CharacterDataImpl.java CoreDOMImplementationImpl.java CoreDocumentImpl.java

elena       2002/07/25 12:16:11

  Modified:    java/src/org/apache/xerces/dom ASDOMImplementationImpl.java
                        ASModelImpl.java AttrImpl.java AttrNSImpl.java
                        AttributeMap.java CharacterDataImpl.java
                        CoreDOMImplementationImpl.java
                        CoreDocumentImpl.java
  Log:
  DOM error message localization.
  
  Revision  Changes    Path
  1.3       +3 -3      xml-xerces/java/src/org/apache/xerces/dom/ASDOMImplementationImpl.java
  
  Index: ASDOMImplementationImpl.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/dom/ASDOMImplementationImpl.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ASDOMImplementationImpl.java	3 Apr 2002 23:48:26 -0000	1.2
  +++ ASDOMImplementationImpl.java	25 Jul 2002 19:16:10 -0000	1.3
  @@ -135,8 +135,8 @@
        * @return  a DOMASWriter
        */
       public DOMASWriter createDOMASWriter(){
  -        throw new DOMException(DOMException.NOT_SUPPORTED_ERR, 
  -                                   "ASWriter is not implemented.");
  +        String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NOT_SUPPORTED_ERR", null);
  +        throw new DOMException(DOMException.NOT_SUPPORTED_ERR, msg);
       }
       
   
  
  
  
  1.4       +63 -32    xml-xerces/java/src/org/apache/xerces/dom/ASModelImpl.java
  
  Index: ASModelImpl.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/dom/ASModelImpl.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ASModelImpl.java	29 Jan 2002 01:15:06 -0000	1.3
  +++ ASModelImpl.java	25 Jul 2002 19:16:10 -0000	1.4
  @@ -121,7 +121,8 @@
        * A code representing the underlying object as defined above.
        */
       public short getAsNodeType() {
  -    	throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Not supported");
  +        String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NOT_SUPPORTED_ERR", null);
  +        throw new DOMException(DOMException.NOT_SUPPORTED_ERR, msg);
       }
   
       /**
  @@ -130,7 +131,8 @@
        * is <code>null</code>. 
        */
       public ASModel getOwnerASModel() {
  -    	throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Not supported");
  +        String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NOT_SUPPORTED_ERR", null);
  +        throw new DOMException(DOMException.NOT_SUPPORTED_ERR, msg);
       }
       
       /**
  @@ -139,7 +141,8 @@
        * is <code>null</code>. 
        */
       public void setOwnerASModel(ASModel ownerASModel) {
  -    	throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Not supported");
  +        String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NOT_SUPPORTED_ERR", null);
  +        throw new DOMException(DOMException.NOT_SUPPORTED_ERR, msg);
       }
   
       /**
  @@ -147,7 +150,8 @@
        * <code>ASObject</code> type.
        */
       public String getNodeName() {
  -    	throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Not supported");
  +        String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NOT_SUPPORTED_ERR", null);
  +        throw new DOMException(DOMException.NOT_SUPPORTED_ERR, msg);
       }
       
       /**
  @@ -155,7 +159,8 @@
        * <code>ASObject</code> type.
        */
       public void setNodeName(String nodeName) {
  -    	throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Not supported");
  +        String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NOT_SUPPORTED_ERR", null);
  +        throw new DOMException(DOMException.NOT_SUPPORTED_ERR, msg);
       }
   
       /**
  @@ -163,7 +168,8 @@
        * unspecified.
        */
       public String getPrefix() {
  -    	throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Not supported");
  +        String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NOT_SUPPORTED_ERR", null);
  +        throw new DOMException(DOMException.NOT_SUPPORTED_ERR, msg);
       }
       
       /**
  @@ -171,7 +177,8 @@
        * unspecified.
        */
       public void setPrefix(String prefix) {
  -    	throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Not supported");
  +        String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NOT_SUPPORTED_ERR", null);
  +        throw new DOMException(DOMException.NOT_SUPPORTED_ERR, msg);
       }
   
       /**
  @@ -179,7 +186,8 @@
        * <code>ASObject</code>.
        */
       public String getLocalName() {
  -    	throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Not supported");
  +        String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NOT_SUPPORTED_ERR", null);
  +        throw new DOMException(DOMException.NOT_SUPPORTED_ERR, msg);
       }
       
       /**
  @@ -187,7 +195,8 @@
        * <code>ASObject</code>.
        */
       public void setLocalName(String localName) {
  -    	throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Not supported");
  +        String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NOT_SUPPORTED_ERR", null);
  +        throw new DOMException(DOMException.NOT_SUPPORTED_ERR, msg);
       }
   
       /**
  @@ -196,7 +205,8 @@
        * components.
        */
       public String getNamespaceURI() {
  -    	throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Not supported");
  +        String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NOT_SUPPORTED_ERR", null);
  +        throw new DOMException(DOMException.NOT_SUPPORTED_ERR, msg);
       }
       
       /**
  @@ -205,7 +215,8 @@
        * components.
        */
       public void setNamespaceURI(String namespaceURI) {
  -   	throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Not supported");
  +        String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NOT_SUPPORTED_ERR", null);
  +        throw new DOMException(DOMException.NOT_SUPPORTED_ERR, msg);
       }
   
       /**
  @@ -218,7 +229,8 @@
        * @return Cloned <code>ASObject</code>.
        */
       public ASObject cloneASObject(boolean deep) {
  -    	throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Not supported");
  +        String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NOT_SUPPORTED_ERR", null);
  +        throw new DOMException(DOMException.NOT_SUPPORTED_ERR, msg);
       }
       
       //
  @@ -241,35 +253,40 @@
        * subset. 
        */
       public short getUsageLocation() {
  -    	throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Not Supported");
  +        String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NOT_SUPPORTED_ERR", null);
  +        throw new DOMException(DOMException.NOT_SUPPORTED_ERR, msg);
       }
   
       /**
        *  The URI reference. 
        */
       public String getAsLocation() {
  -    	throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Not Supported");
  +        String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NOT_SUPPORTED_ERR", null);
  +        throw new DOMException(DOMException.NOT_SUPPORTED_ERR, msg);
       }
       
       /**
        *  The URI reference. 
        */
       public void setAsLocation(String asLocation) {
  -    	throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Not Supported");
  +        String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NOT_SUPPORTED_ERR", null);
  +        throw new DOMException(DOMException.NOT_SUPPORTED_ERR, msg);
       }
   
       /**
        *  The hint to locating an ASModel. 
        */
       public String getAsHint() {
  -    	throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Not Supported");
  +        String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NOT_SUPPORTED_ERR", null);
  +        throw new DOMException(DOMException.NOT_SUPPORTED_ERR, msg);
       }
       
       /**
        *  The hint to locating an ASModel. 
        */
       public void setAsHint(String asHint) {
  -    	throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Not Supported");
  +        String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NOT_SUPPORTED_ERR", null);
  +        throw new DOMException(DOMException.NOT_SUPPORTED_ERR, msg);
       }
       
       /**
  @@ -288,7 +305,8 @@
        * equivalent is thrown). 
        */
       public ASNamedObjectMap getElementDeclarations() {
  -    	throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Not Supported");
  +        String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NOT_SUPPORTED_ERR", null);
  +        throw new DOMException(DOMException.NOT_SUPPORTED_ERR, msg);
       }
   
       /**
  @@ -299,7 +317,8 @@
        * equivalent is thrown). 
        */
       public ASNamedObjectMap getAttributeDeclarations() {
  -    	throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Not Supported");
  +        String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NOT_SUPPORTED_ERR", null);
  +        throw new DOMException(DOMException.NOT_SUPPORTED_ERR, msg);
       }
   
       /**
  @@ -310,7 +329,8 @@
        * equivalent is thrown). 
        */
       public ASNamedObjectMap getNotationDeclarations() {
  -    	throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Not Supported");
  +        String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NOT_SUPPORTED_ERR", null);
  +        throw new DOMException(DOMException.NOT_SUPPORTED_ERR, msg);
       }
   
       /**
  @@ -321,7 +341,8 @@
        * equivalent is thrown). 
        */
       public ASNamedObjectMap getEntityDeclarations() {
  -    	throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Not Supported");
  +        String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NOT_SUPPORTED_ERR", null);
  +        throw new DOMException(DOMException.NOT_SUPPORTED_ERR, msg);
       }
   
       /**
  @@ -332,7 +353,8 @@
        * equivalent is thrown). 
        */
       public ASNamedObjectMap getContentModelDeclarations() {
  -    	throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Not Supported");
  +        String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NOT_SUPPORTED_ERR", null);
  +        throw new DOMException(DOMException.NOT_SUPPORTED_ERR, msg);
       }
   
       /**
  @@ -349,7 +371,8 @@
        * @return A list of ASModels. 
        */
       public ASObjectList getASModels() {
  -    	throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Not Supported");
  +        String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NOT_SUPPORTED_ERR", null);
  +        throw new DOMException(DOMException.NOT_SUPPORTED_ERR, msg);
       }
   
       /**
  @@ -368,7 +391,8 @@
        *   <code>false</code> otherwise.
        */
       public boolean validate() {
  -    	throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Not Supported");
  +        String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NOT_SUPPORTED_ERR", null);
  +        throw new DOMException(DOMException.NOT_SUPPORTED_ERR, msg);
       }
   
       /**
  @@ -376,7 +400,8 @@
        * @param asobject  <code>ASObject</code> to be imported. 
        */
       public void importASObject(ASObject asobject) {
  -    	throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Not Supported");
  +        String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NOT_SUPPORTED_ERR", null);
  +        throw new DOMException(DOMException.NOT_SUPPORTED_ERR, msg);
       }
   
       /**
  @@ -384,7 +409,8 @@
        * @param asobject  <code>ASObject</code> to be inserted. 
        */
       public void insertASObject(ASObject asobject) {
  -    	throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Not Supported");
  +        String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NOT_SUPPORTED_ERR", null);
  +        throw new DOMException(DOMException.NOT_SUPPORTED_ERR, msg);
       }
       
       /**
  @@ -406,7 +432,8 @@
       public ASElementDeclaration createASElementDeclaration(String namespaceURI, 
                                                              String name)
                                                              throws DOMException {
  -    	throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Not Supported");
  +        String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NOT_SUPPORTED_ERR", null);
  +        throw new DOMException(DOMException.NOT_SUPPORTED_ERR, msg);
       }
   
       /**
  @@ -424,7 +451,8 @@
       public ASAttributeDeclaration createASAttributeDeclaration(String namespaceURI, 
                                                                  String name)
                                                                  throws DOMException {
  -    	throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Not Supported");
  +        String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NOT_SUPPORTED_ERR", null);
  +        throw new DOMException(DOMException.NOT_SUPPORTED_ERR, msg);
       }
   
       /**
  @@ -446,7 +474,8 @@
       public ASNotationDeclaration createASNotationDeclaration(String namespaceURI, String name, 
                                                                String systemId, String publicId)
                                                                throws DOMException {
  -    	throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Not Supported");
  +        String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NOT_SUPPORTED_ERR", null);
  +        throw new DOMException(DOMException.NOT_SUPPORTED_ERR, msg);
       }
       
       /**
  @@ -460,7 +489,8 @@
        */
       public ASEntityDeclaration createASEntityDeclaration(String name)
                                                            throws DOMException {
  -	throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Not Supported");
  +        String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NOT_SUPPORTED_ERR", null);
  +        throw new DOMException(DOMException.NOT_SUPPORTED_ERR, msg);
       }
   
       /**
  @@ -479,7 +509,8 @@
        */
       public ASContentModel createASContentModel(int minOccurs, int maxOccurs, 
                                                  short operator) throws DOMASException {
  -        throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Not Supported");
  +        String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NOT_SUPPORTED_ERR", null);
  +        throw new DOMException(DOMException.NOT_SUPPORTED_ERR, msg);
       }
   
   
  
  
  
  1.46      +19 -22    xml-xerces/java/src/org/apache/xerces/dom/AttrImpl.java
  
  Index: AttrImpl.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/dom/AttrImpl.java,v
  retrieving revision 1.45
  retrieving revision 1.46
  diff -u -r1.45 -r1.46
  --- AttrImpl.java	20 Jun 2002 01:29:04 -0000	1.45
  +++ AttrImpl.java	25 Jul 2002 19:16:10 -0000	1.46
  @@ -334,8 +334,8 @@
       public void setValue(String newvalue) {
   
       	if (isReadOnly()) {
  -            throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, 
  -                                   "DOM001 Modification not allowed");
  +            String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NO_MODIFICATION_ALLOWED_ERR", null);
  +            throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, msg);
           }
           CoreDocumentImpl ownerDocument = ownerDocument();
           Element ownerElement = getOwnerElement();
  @@ -703,9 +703,8 @@
                        kid != null; kid = kid.getNextSibling()) {
   
                       if (!ownerDocument.isKidOK(this, kid)) {
  -                        throw new DOMException(
  -                                           DOMException.HIERARCHY_REQUEST_ERR, 
  -                                           "DOM006 Hierarchy request error");
  +                        String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "HIERARCHY_REQUEST_ERR", null);
  +                        throw new DOMException(DOMException.HIERARCHY_REQUEST_ERR, msg);
                       }
                   }
               }
  @@ -730,22 +729,21 @@
   
           if (errorChecking) {
               if (isReadOnly()) {
  -                throw new DOMException(
  -                                     DOMException.NO_MODIFICATION_ALLOWED_ERR, 
  -                                       "DOM001 Modification not allowed");
  +                String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NO_MODIFICATION_ALLOWED_ERR", null);
  +                throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, msg);
               }
               if (newChild.getOwnerDocument() != ownerDocument) {
  -                throw new DOMException(DOMException.WRONG_DOCUMENT_ERR, 
  -                                       "DOM005 Wrong document");
  +                String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "WRONG_DOCUMENT_ERR", null);
  +                throw new DOMException(DOMException.WRONG_DOCUMENT_ERR, msg);
               }
               if (!ownerDocument.isKidOK(this, newChild)) {
  -                throw new DOMException(DOMException.HIERARCHY_REQUEST_ERR, 
  -                                       "DOM006 Hierarchy request error");
  +                String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "HIERARCHY_REQUEST_ERR", null);
  +                throw new DOMException(DOMException.HIERARCHY_REQUEST_ERR, msg);
               }
               // refChild must be a child of this node (or null)
               if (refChild != null && refChild.getParentNode() != this) {
  -                throw new DOMException(DOMException.NOT_FOUND_ERR,
  -                                       "DOM008 Not found");
  +                String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NOT_FOUND_ERR", null);
  +                throw new DOMException(DOMException.NOT_FOUND_ERR, msg);
               }
   
               // Prevent cycles in the tree
  @@ -757,8 +755,8 @@
                   treeSafe = newChild != a;
               }
               if (!treeSafe) {
  -                throw new DOMException(DOMException.HIERARCHY_REQUEST_ERR, 
  -                                       "DOM006 Hierarchy request error");
  +                String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "HIERARCHY_REQUEST_ERR", null);
  +                throw new DOMException(DOMException.HIERARCHY_REQUEST_ERR, msg);
               }
           }
   
  @@ -866,13 +864,12 @@
           CoreDocumentImpl ownerDocument = ownerDocument();
           if (ownerDocument.errorChecking) {
               if (isReadOnly()) {
  -                throw new DOMException(
  -                                     DOMException.NO_MODIFICATION_ALLOWED_ERR, 
  -                                     "DOM001 Modification not allowed");
  +                String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NO_MODIFICATION_ALLOWED_ERR", null);
  +                throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, msg);
               }
               if (oldChild != null && oldChild.getParentNode() != this) {
  -                throw new DOMException(DOMException.NOT_FOUND_ERR, 
  -                                       "DOM008 Not found");
  +                String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NOT_FOUND_ERR", null);
  +                throw new DOMException(DOMException.NOT_FOUND_ERR, msg);
               }
           }
   
  
  
  
  1.28      +23 -25    xml-xerces/java/src/org/apache/xerces/dom/AttrNSImpl.java
  
  Index: AttrNSImpl.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/dom/AttrNSImpl.java,v
  retrieving revision 1.27
  retrieving revision 1.28
  diff -u -r1.27 -r1.28
  --- AttrNSImpl.java	20 Jun 2002 01:29:04 -0000	1.27
  +++ AttrNSImpl.java	25 Jul 2002 19:16:11 -0000	1.28
  @@ -124,9 +124,8 @@
               if (ownerDocument().errorChecking &&
                   qualifiedName.equals("xmlns") &&
                   (namespaceURI == null || !namespaceURI.equals(xmlnsURI))) {
  -
  -                throw new DOMException(DOMException.NAMESPACE_ERR, 
  -                                       "DOM003 Namespace error");
  +                String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NAMESPACE_ERR", null);
  +                throw new DOMException(DOMException.NAMESPACE_ERR, msg);
               }
           }
           else {
  @@ -137,21 +136,21 @@
                   if (this.namespaceURI == null
                       || (localName.length() == 0)
                       || (localName.indexOf(':') >= 0)) {
  -                    throw new DOMException(DOMException.NAMESPACE_ERR, 
  -                                           "DOM003 Namespace error");
  +                    String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NAMESPACE_ERR", null);
  +                    throw new DOMException(DOMException.NAMESPACE_ERR, msg);
                   } else if (prefix.equals("xml")) {
                       if (!namespaceURI.equals(xmlURI)) {
  -                        throw new DOMException(DOMException.NAMESPACE_ERR, 
  -                                               "DOM003 Namespace error");
  +                        String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NAMESPACE_ERR", null);
  +                        throw new DOMException(DOMException.NAMESPACE_ERR, msg);
                       }
                   } else if (prefix.equals("xmlns")) {
                       if (!namespaceURI.equals(xmlnsURI)) {
  -                        throw new DOMException(DOMException.NAMESPACE_ERR, 
  -                                               "DOM003 Namespace error");
  +                        String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NAMESPACE_ERR", null);
  +                        throw new DOMException(DOMException.NAMESPACE_ERR, msg);
                       }
                   } else if (index == 0) {
  -                    throw new DOMException(DOMException.NAMESPACE_ERR, 
  -                                           "DOM003 Namespace error");
  +                    String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NAMESPACE_ERR", null);
  +                    throw new DOMException(DOMException.NAMESPACE_ERR, msg);
                   }
               }
           }
  @@ -277,31 +276,30 @@
           }
           if (ownerDocument().errorChecking) {
               if (isReadOnly()) {
  -                throw new DOMException(
  -                                     DOMException.NO_MODIFICATION_ALLOWED_ERR, 
  -                                     "DOM001 Modification not allowed");
  +                String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NO_MODIFICATION_ALLOWED_ERR", null);
  +                throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, msg);
               }
               if (!CoreDocumentImpl.isXMLName(prefix)) {
  -                throw new DOMException(DOMException.INVALID_CHARACTER_ERR, 
  -                                       "DOM002 Illegal character");
  +                String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "INVALID_CHARACTER_ERR", null);
  +                throw new DOMException(DOMException.INVALID_CHARACTER_ERR, msg);
               }
               if (namespaceURI == null || prefix.indexOf(':') >=0) {
  -                throw new DOMException(DOMException.NAMESPACE_ERR, 
  -                                       "DOM003 Namespace error");
  +                String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NAMESPACE_ERR", null);
  +                throw new DOMException(DOMException.NAMESPACE_ERR, msg);
               } else if (prefix != null) {
                   if (prefix.equals("xmlns")) {
                       if (!namespaceURI.equals(xmlnsURI)){
  -                        throw new DOMException(DOMException.NAMESPACE_ERR, 
  -                                               "DOM003 Namespace error");
  +                        String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NAMESPACE_ERR", null);
  +                        throw new DOMException(DOMException.NAMESPACE_ERR, msg);
                       }
                   } else if (prefix.equals("xml")) {
                       if (!namespaceURI.equals(xmlURI)) {
  -                        throw new DOMException(DOMException.NAMESPACE_ERR, 
  -                                               "DOM003 Namespace error");
  +                        String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NAMESPACE_ERR", null);
  +                        throw new DOMException(DOMException.NAMESPACE_ERR, msg);
                       }
                   }else if (name.equals("xmlns")) {
  -                        throw new DOMException(DOMException.NAMESPACE_ERR,
  -                               "DOM003 Namespace error");
  +                    String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NAMESPACE_ERR", null);
  +                    throw new DOMException(DOMException.NAMESPACE_ERR, msg);
                   }
               }
           }
  
  
  
  1.21      +28 -32    xml-xerces/java/src/org/apache/xerces/dom/AttributeMap.java
  
  Index: AttributeMap.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/dom/AttributeMap.java,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- AttributeMap.java	20 Jun 2002 01:29:04 -0000	1.20
  +++ AttributeMap.java	25 Jul 2002 19:16:11 -0000	1.21
  @@ -68,7 +68,7 @@
    * specifics of storing attributes. These are:
    * <ul>
    *  <li>managing ownership of attribute nodes
  - *  <li>managing default attributes
  + *  <li>managing default attributes       
    *  <li>firing mutation events
    * </ul>
    * <p>
  @@ -107,25 +107,24 @@
           throws DOMException {
   
       	if (isReadOnly()) {
  -            throw
  -                new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR,
  -                                     "DOM001 Modification not allowed");
  +            String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NO_MODIFICATION_ALLOWED_ERR", null);
  +            throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, msg);
           }
       	if(arg.getOwnerDocument() != ownerNode.ownerDocument()) {
  -            throw new DOMException(DOMException.WRONG_DOCUMENT_ERR,
  -                                       "DOM005 Wrong document");
  +            String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "WRONG_DOCUMENT_ERR", null);
  +            throw new DOMException(DOMException.WRONG_DOCUMENT_ERR, msg);
           }
           if (arg.getNodeType() != arg.ATTRIBUTE_NODE) {
  -            throw new DOMException(DOMException.HIERARCHY_REQUEST_ERR, 
  -                                   "DOM006 Hierarchy request error");
  +            String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "HIERARCHY_REQUEST_ERR", null);
  +            throw new DOMException(DOMException.HIERARCHY_REQUEST_ERR, msg);
           }
   
           AttrImpl argn = (AttrImpl)arg;
   
       	if (argn.isOwned()){
               if (argn.getOwnerElement() != ownerNode) {
  -                throw new DOMException(DOMException.INUSE_ATTRIBUTE_ERR,
  -                                       "DOM009 Attribute already in use");
  +                   String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "INUSE_ATTRIBUTE_ERR", null);
  +                   throw new DOMException(DOMException.INUSE_ATTRIBUTE_ERR, msg);
               } 
               // replacing an Attribute with itself does nothing
               return arg;
  @@ -175,26 +174,25 @@
           throws DOMException {
   
       	if (isReadOnly()) {
  -            throw
  -                new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR,
  -                                     "DOM001 Modification not allowed");
  +            String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NO_MODIFICATION_ALLOWED_ERR", null);
  +            throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, msg);            
           }
       
       	if(arg.getOwnerDocument() != ownerNode.ownerDocument()) {
  -            throw new DOMException(DOMException.WRONG_DOCUMENT_ERR,
  -                                       "DOM005 Wrong document");
  +            String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "WRONG_DOCUMENT_ERR", null);
  +            throw new DOMException(DOMException.WRONG_DOCUMENT_ERR, msg);
           }
   
           if (arg.getNodeType() != arg.ATTRIBUTE_NODE) {
  -            throw new DOMException(DOMException.HIERARCHY_REQUEST_ERR, 
  -                                   "DOM006 Hierarchy request error");
  +            String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "HIERARCHY_REQUEST_ERR", null);
  +            throw new DOMException(DOMException.HIERARCHY_REQUEST_ERR, msg);
           }
           AttrImpl argn = (AttrImpl)arg;
   
       	if (argn.isOwned()){
               if (argn.getOwnerElement() != ownerNode) {
  -                throw new DOMException(DOMException.INUSE_ATTRIBUTE_ERR,
  -                                       "DOM009 Attribute already in use");
  +                String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "INUSE_ATTRIBUTE_ERR", null);
  +                throw new DOMException(DOMException.INUSE_ATTRIBUTE_ERR, msg);
               } 
               // replacing an Attribute with itself does nothing
               return arg;
  @@ -294,8 +292,8 @@
               }
           }
           if (index < 0) {
  -            throw new DOMException(DOMException.NOT_FOUND_ERR,
  -                                   "DOM008 Not found");
  +            String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NOT_FOUND_ERR", null);
  +            throw new DOMException(DOMException.NOT_FOUND_ERR, msg);
           }
           
           return remove((AttrImpl)item, index, addDefault);
  @@ -306,16 +304,15 @@
        * must be thrown if the specified name is not found.
        */
       final protected Node internalRemoveNamedItem(String name, boolean raiseEx){
  -    	if (isReadOnly()) {
  -            throw
  -                new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR,
  -                                     "DOM001 Modification not allowed");
  +    	if (isReadOnly()) {            
  +                String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NO_MODIFICATION_ALLOWED_ERR", null);
  +                throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, msg);            
           }
       	int i = findNamePoint(name,0);
       	if (i < 0) {
               if (raiseEx) {
  -                throw new DOMException(DOMException.NOT_FOUND_ERR,
  -                                           "DOM008 Not found");
  +                String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NOT_FOUND_ERR", null);
  +                throw new DOMException(DOMException.NOT_FOUND_ERR, msg);
               } else {
                   return null;
               }
  @@ -415,15 +412,14 @@
                                                      String name,
                                                      boolean raiseEx) {
       	if (isReadOnly()) {
  -            throw
  -                new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR,
  -                                     "DOM001 Modification not allowed");
  +            String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NO_MODIFICATION_ALLOWED_ERR", null);
  +            throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, msg);            
           }
       	int i = findNamePoint(namespaceURI, name);
       	if (i < 0) {
               if (raiseEx) {
  -                throw new DOMException(DOMException.NOT_FOUND_ERR,
  -                                           "DOM008 Not found");
  +                String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NOT_FOUND_ERR", null);
  +                throw new DOMException(DOMException.NOT_FOUND_ERR, msg);
               } else {
                   return null;
               }
  
  
  
  1.19      +21 -24    xml-xerces/java/src/org/apache/xerces/dom/CharacterDataImpl.java
  
  Index: CharacterDataImpl.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/dom/CharacterDataImpl.java,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- CharacterDataImpl.java	24 May 2002 00:00:53 -0000	1.18
  +++ CharacterDataImpl.java	25 Jul 2002 19:16:11 -0000	1.19
  @@ -138,10 +138,10 @@
        *  type if the client simply calls setNodeValue(value).
        */
       protected void setNodeValueInternal(String value) {
  -    	if (isReadOnly())
  -    		throw new DOMException(
  -    			DOMException.NO_MODIFICATION_ALLOWED_ERR, 
  -    			"DOM001 Modification not allowed");
  +    	if (isReadOnly()) {
  +            String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NO_MODIFICATION_ALLOWED_ERR", null);
  +            throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, msg);
  +        }
           // revisit: may want to set the value in ownerDocument.
       	// Default behavior, overridden in some subclasses
           if (needsSyncData()) {
  @@ -214,10 +214,9 @@
        */
       public void appendData(String data) {
   
  -        if (isReadOnly()) {
  -        	throw new DOMException(
  -        		DOMException.NO_MODIFICATION_ALLOWED_ERR,
  -        		"DOM001 Modification not allowed");
  +    	if (isReadOnly()) {
  +            String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NO_MODIFICATION_ALLOWED_ERR", null);
  +            throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, msg);
           }
           if (data == null) {
               return;
  @@ -245,15 +244,14 @@
       public void deleteData(int offset, int count) 
           throws DOMException {
   
  -        if (isReadOnly()) {
  -        	throw new DOMException(
  -        		DOMException.NO_MODIFICATION_ALLOWED_ERR, 
  -        		"DOM001 Modification not allowed");
  +    	if (isReadOnly()) {
  +            String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NO_MODIFICATION_ALLOWED_ERR", null);
  +            throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, msg);
           }
   
           if (count < 0) {
  -        	throw new DOMException(DOMException.INDEX_SIZE_ERR, 
  -        	                           "DOM004 Index out of bounds");
  +            String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "INDEX_SIZE_ERR", null);
  +            throw new DOMException(DOMException.INDEX_SIZE_ERR, msg);
           }
   
           if (needsSyncData()) {
  @@ -272,8 +270,8 @@
               ownerDocument().deletedText(this, offset, count);
           }
           catch (StringIndexOutOfBoundsException e) {
  -        	throw new DOMException(DOMException.INDEX_SIZE_ERR, 
  -        	                           "DOM004 Index out of bounds");
  +            String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "INDEX_SIZE_ERR", null);
  +            throw new DOMException(DOMException.INDEX_SIZE_ERR, msg);
           }
   
       } // deleteData(int,int)
  @@ -291,9 +289,8 @@
           throws DOMException {
   
           if (isReadOnly()) {
  -        	throw new DOMException(
  -        		DOMException.NO_MODIFICATION_ALLOWED_ERR, 
  -        		"DOM001 Modification not allowed");
  +            String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NO_MODIFICATION_ALLOWED_ERR", null);
  +            throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, msg);
           }
   
           if (needsSyncData()) {
  @@ -309,8 +306,8 @@
               ownerDocument().insertedText(this, offset, data.length());
           }
           catch (StringIndexOutOfBoundsException e) {
  -        	throw new DOMException(DOMException.INDEX_SIZE_ERR, 
  -        	                           "DOM004 Index out of bounds");
  +            String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "INDEX_SIZE_ERR", null);
  +            throw new DOMException(DOMException.INDEX_SIZE_ERR, msg);
           }
   
       } // insertData(int,int)
  @@ -392,8 +389,8 @@
           
           int length = data.length();
           if (count < 0 || offset < 0 || offset > length - 1) {
  -            throw new DOMException(DOMException.INDEX_SIZE_ERR, 
  -                                       "DOM004 Index out of bounds");
  +            String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "INDEX_SIZE_ERR", null);
  +            throw new DOMException(DOMException.INDEX_SIZE_ERR, msg);
           }
   
           int tailIndex = Math.min(offset + count, length);
  
  
  
  1.16      +11 -13    xml-xerces/java/src/org/apache/xerces/dom/CoreDOMImplementationImpl.java
  
  Index: CoreDOMImplementationImpl.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/dom/CoreDOMImplementationImpl.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- CoreDOMImplementationImpl.java	19 Jun 2002 18:32:24 -0000	1.15
  +++ CoreDOMImplementationImpl.java	25 Jul 2002 19:16:11 -0000	1.16
  @@ -174,15 +174,15 @@
                                                    String systemID)
       {
           if (!CoreDocumentImpl.isXMLName(qualifiedName)) {
  -            throw new DOMException(DOMException.INVALID_CHARACTER_ERR, 
  -                                   "DOM002 Illegal character");
  +            String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "INVALID_CHARACTER_ERR", null);
  +            throw new DOMException(DOMException.INVALID_CHARACTER_ERR, msg);
           }
           int index = qualifiedName.indexOf(':');
           int lastIndex = qualifiedName.lastIndexOf(':');
           // it is an error for NCName to have more than one ':'
           if (index == 0 || index == qualifiedName.length() - 1 || lastIndex!=index) {
  -            throw new DOMException(DOMException.NAMESPACE_ERR, 
  -                                   "DOM003 Namespace error");
  +            String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NAMESPACE_ERR", null);
  +            throw new DOMException(DOMException.NAMESPACE_ERR, msg);
           }
           return new DocumentTypeImpl(null, qualifiedName, publicID, systemID);
       }
  @@ -212,8 +212,8 @@
       throws DOMException
       {
           if (doctype != null && doctype.getOwnerDocument() != null) {
  -            throw new DOMException(DOMException.WRONG_DOCUMENT_ERR, 
  -                                   "DOM005 Wrong document");
  +            String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "WRONG_DOCUMENT_ERR", null);
  +            throw new DOMException(DOMException.WRONG_DOCUMENT_ERR, msg);
           }
           CoreDocumentImpl doc = new CoreDocumentImpl(doctype);
           Element e = doc.createElementNS( namespaceURI, qualifiedName);
  @@ -239,10 +239,8 @@
        *   <code>DOMImplementation</code>
        */
       public DOMImplementation getInterface(String feature){
  -
  -        throw new DOMException(DOMException.NOT_SUPPORTED_ERR, 
  -                               "getInterface() is not implemented");
  -        
  +        String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NOT_SUPPORTED_ERR", null);
  +        throw new DOMException(DOMException.NOT_SUPPORTED_ERR, msg);        
       }
   
       // DOM L3 LS
  @@ -253,8 +251,8 @@
                                          String schemaType)
                                          throws DOMException{        
           if (mode == DOMImplementationLS.MODE_ASYNCHRONOUS) {
  -            throw new DOMException(DOMException.NOT_SUPPORTED_ERR, 
  -                                   "Asynchronous mode is not supported");
  +            String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NOT_SUPPORTED_ERR", null);
  +            throw new DOMException(DOMException.NOT_SUPPORTED_ERR, msg);        
           }
           if (schemaType !=null && schemaType.equals("http://www.w3.org/TR/REC-xml")) {
               return new DOMBuilderImpl("org.apache.xerces.parsers.DTDConfiguration", schemaType);
  
  
  
  1.26      +61 -45    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.25
  retrieving revision 1.26
  diff -u -r1.25 -r1.26
  --- CoreDocumentImpl.java	10 Jul 2002 19:21:58 -0000	1.25
  +++ CoreDocumentImpl.java	25 Jul 2002 19:16:11 -0000	1.26
  @@ -324,8 +324,8 @@
               try {
                   doctypeImpl = (DocumentTypeImpl) doctype;
               } catch (ClassCastException e) {
  -                throw new DOMException(DOMException.WRONG_DOCUMENT_ERR,
  -                                       "DOM005 Wrong document");
  +                String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "WRONG_DOCUMENT_ERR", null);
  +                throw new DOMException(DOMException.WRONG_DOCUMENT_ERR, msg);
               }
               doctypeImpl.ownerDocument = this;
               appendChild(doctype);
  @@ -432,8 +432,8 @@
           if (errorChecking) {
               if((type == Node.ELEMENT_NODE && docElement != null) ||
                  (type == Node.DOCUMENT_TYPE_NODE && docType != null)) {
  -                throw new DOMException(DOMException.HIERARCHY_REQUEST_ERR,
  -                                           "DOM006 Hierarchy request error");
  +                String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "HIERARCHY_REQUEST_ERR", null);
  +                throw new DOMException(DOMException.HIERARCHY_REQUEST_ERR, msg);
               }
           }
           // Adopt orphan doctypes
  @@ -597,8 +597,8 @@
           throws DOMException {
   
           if (errorChecking && !isXMLName(tagName)) {
  -            throw new DOMException(DOMException.INVALID_CHARACTER_ERR,
  -                                   "DOM002 Illegal character");
  +            String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "INVALID_CHARACTER_ERR", null);
  +            throw new DOMException(DOMException.INVALID_CHARACTER_ERR, msg);
           }
           return new ElementImpl(this, tagName);
   
  @@ -618,8 +618,8 @@
           throws DOMException {
   
           if (errorChecking && !isXMLName(name)) {
  -            throw new DOMException(DOMException.INVALID_CHARACTER_ERR,
  -                                   "DOM002 Illegal character");
  +            String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "INVALID_CHARACTER_ERR", null);
  +            throw new DOMException(DOMException.INVALID_CHARACTER_ERR, msg);
           }
           return new EntityReferenceImpl(this, name);
   
  @@ -643,8 +643,8 @@
           throws DOMException {
   
           if (errorChecking && !isXMLName(target)) {
  -            throw new DOMException(DOMException.INVALID_CHARACTER_ERR,
  -                                   "DOM002 Illegal character");
  +            String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "INVALID_CHARACTER_ERR", null);
  +            throw new DOMException(DOMException.INVALID_CHARACTER_ERR, msg);
           }
           return new ProcessingInstructionImpl(this, target, data);
   
  @@ -884,8 +884,8 @@
                              throws DOMException{
   
   	if (n.getOwnerDocument() != this) {
  -	    throw new DOMException(DOMException.WRONG_DOCUMENT_ERR, 
  -				   "DOM005 Wrong document");
  +            String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "WRONG_DOCUMENT_ERR", null);
  +            throw new DOMException(DOMException.WRONG_DOCUMENT_ERR, msg);
   	}
           switch (n.getNodeType()) {
               case ELEMENT_NODE: {
  @@ -1003,9 +1003,9 @@
   		
   		return at;
   	    }
  -	    default: {
  -                throw new DOMException(DOMException.NOT_SUPPORTED_ERR,
  -                                       "cannot rename this type of node.");
  +	    default: { 
  +                String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NOT_SUPPORTED_ERR", null);
  +                throw new DOMException(DOMException.NOT_SUPPORTED_ERR, msg);
   	    }
   	}
   
  @@ -1115,16 +1115,25 @@
                      name.equals(Constants.DOM_CANONICAL_FORM) ||
                      name.equals(Constants.DOM_VALIDATE_IF_SCHEMA)) {
                   if (state) { // true is not supported
  -                    throw new DOMException(DOMException.NOT_SUPPORTED_ERR,"Feature \""+name+"\" cannot be set to \""+state+"\"");
  +                    String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, 
  +                                                                   "FEATURE_NOT_SUPPORTED", 
  +                                                                   new Object[]{name});
  +                    throw new DOMException(DOMException.NOT_SUPPORTED_ERR, msg);
                   }
           } else if (name.equals(Constants.DOM_NAMESPACE_DECLARATIONS) ||
                      name.equals(Constants.DOM_WHITESPACE_IN_ELEMENT_CONTENT)) {
                   if (!state) { // false is not supported
  -                    throw new DOMException(DOMException.NOT_SUPPORTED_ERR,"Feature \""+name+"\" cannot be set to \""+state+"\"");
  +                    String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, 
  +                                                                   "FEATURE_NOT_SUPPORTED", 
  +                                                                   new Object[]{name});
  +                    throw new DOMException(DOMException.NOT_SUPPORTED_ERR, msg);
                   }
           
           } else {
  -            throw new DOMException(DOMException.NOT_FOUND_ERR,"Feature \""+name+"\" not recognized");
  +            String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, 
  +                                                           "FEATURE_NOT_FOUND", 
  +                                                           new Object[]{name});
  +            throw new DOMException(DOMException.NOT_FOUND_ERR, msg);
           }
       }
   
  @@ -1170,7 +1179,10 @@
               return true;    
           
           } else {
  -            throw new DOMException(DOMException.NOT_FOUND_ERR,"Feature \""+name+"\" not recognized");
  +            String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, 
  +                                                           "FEATURE_NOT_FOUND", 
  +                                                           new Object[]{name});
  +            throw new DOMException(DOMException.NOT_FOUND_ERR, msg);
           }
       }
   
  @@ -1198,7 +1210,10 @@
               return (state)?true:false;    
           
           } else {
  -            throw new DOMException(DOMException.NOT_FOUND_ERR,"Feature \""+name+"\" not recognized");
  +            String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, 
  +                                                           "FEATURE_NOT_FOUND", 
  +                                                           new Object[]{name});
  +            throw new DOMException(DOMException.NOT_FOUND_ERR, msg);
           }
       }
   
  @@ -1256,9 +1271,8 @@
        */
       public void setAsync(boolean async) {
           if (async) {
  -            // NOT SUPPORTED
  -            throw new DOMException(DOMException.NOT_SUPPORTED_ERR, 
  -                                   "Asynchronous mode is not supported");
  +            String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NOT_SUPPORTED_ERR", null);
  +            throw new DOMException(DOMException.NOT_SUPPORTED_ERR, msg);
           }
       }
       /**
  @@ -1320,9 +1334,11 @@
        */
       public String saveXML(Node snode)
                             throws DOMException {
  -        if ( snode != null &&
  -             getOwnerDocument() != snode.getOwnerDocument() )
  -            throw new DOMException(DOMException.WRONG_DOCUMENT_ERR,"Node "+snode.getNodeName()+" does not belongs to this Document.");
  +        if ( snode != null &&                                                      
  +             getOwnerDocument() != snode.getOwnerDocument() ) {
  +            String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "WRONG_DOCUMENT_ERR", null);
  +            throw new DOMException(DOMException.WRONG_DOCUMENT_ERR, msg);
  +        }
           DOMImplementationLS domImplLS = (DOMImplementationLS)DOMImplementationImpl.getDOMImplementation();
           DOMWriter xmlWriter = domImplLS.createDOMWriter();
           if (snode == null) {
  @@ -1369,8 +1385,8 @@
           throws DOMException {
   
           if (errorChecking && !isXMLName(qualifiedName)) {
  -            throw new DOMException(DOMException.INVALID_CHARACTER_ERR,
  -                                   "DOM002 Illegal character");
  +            String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "INVALID_CHARACTER_ERR", null);
  +            throw new DOMException(DOMException.INVALID_CHARACTER_ERR, msg);
           }
           return new DocumentTypeImpl(this, qualifiedName, publicID, systemID);
   
  @@ -1392,8 +1408,8 @@
           throws DOMException {
   
           if (errorChecking && !isXMLName(name)) {
  -                throw new DOMException(DOMException.INVALID_CHARACTER_ERR,
  -                                           "DOM002 Illegal character");
  +            String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "INVALID_CHARACTER_ERR", null);
  +            throw new DOMException(DOMException.INVALID_CHARACTER_ERR, msg);
           }
           return new EntityImpl(this, name);
   
  @@ -1415,8 +1431,8 @@
           throws DOMException {
   
           if (errorChecking && !isXMLName(name)) {
  -                throw new DOMException(DOMException.INVALID_CHARACTER_ERR,
  -                                           "DOM002 Illegal character");
  +            String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "INVALID_CHARACTER_ERR", null);
  +            throw new DOMException(DOMException.INVALID_CHARACTER_ERR, msg);
           }
           return new NotationImpl(this, name);
   
  @@ -1430,8 +1446,8 @@
           throws DOMException {
   
           if (errorChecking && !isXMLName(name)) {
  -                throw new DOMException(DOMException.INVALID_CHARACTER_ERR,
  -                                           "DOM002 Illegal character");
  +            String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "INVALID_CHARACTER_ERR", null);
  +            throw new DOMException(DOMException.INVALID_CHARACTER_ERR, msg);
           }
           return new ElementDefinitionImpl(this, name);
   
  @@ -1623,8 +1639,8 @@
                   // unless this is used as part of cloning a Document
                   // forbid it for the sake of being compliant to the DOM spec
                   if (!cloningDoc) {
  -                    throw new DOMException(DOMException.NOT_SUPPORTED_ERR,
  -                                  "Node type being imported is not supported");
  +                    String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NOT_SUPPORTED_ERR", null);
  +                    throw new DOMException(DOMException.NOT_SUPPORTED_ERR, msg);
                   }
                   DocumentType srcdoctype = (DocumentType)source;
                   DocumentTypeImpl newdoctype = (DocumentTypeImpl)
  @@ -1676,8 +1692,8 @@
               }
               case DOCUMENT_NODE : // Can't import document nodes
               default: {           // Unknown node type
  -                throw new DOMException(DOMException.NOT_SUPPORTED_ERR,
  -                                  "Node type being imported is not supported");
  +                String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NOT_SUPPORTED_ERR", null);
  +                throw new DOMException(DOMException.NOT_SUPPORTED_ERR, msg);
               }
           }
   
  @@ -1727,8 +1743,8 @@
               }
               case DOCUMENT_NODE:
               case DOCUMENT_TYPE_NODE: {
  -                throw new DOMException(DOMException.NOT_SUPPORTED_ERR,
  -                                       "cannot adopt this type of node.");
  +                String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NOT_SUPPORTED_ERR", null);
  +                throw new DOMException(DOMException.NOT_SUPPORTED_ERR, msg);
               }
               case ENTITY_REFERENCE_NODE: {
                   // remove node from wherever it is
  @@ -1918,8 +1934,8 @@
           throws DOMException
       {
           if (errorChecking && !isXMLName(qualifiedName)) {
  -            throw new DOMException(DOMException.INVALID_CHARACTER_ERR,
  -                                   "DOM002 Illegal character");
  +            String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "INVALID_CHARACTER_ERR", null);
  +            throw new DOMException(DOMException.INVALID_CHARACTER_ERR, msg);
           }
           return new ElementNSImpl(this, namespaceURI, qualifiedName);
       }
  @@ -1966,8 +1982,8 @@
           throws DOMException
       {
           if (errorChecking && !isXMLName(qualifiedName)) {
  -            throw new DOMException(DOMException.INVALID_CHARACTER_ERR,
  -                                   "DOM002 Illegal character");
  +            String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "INVALID_CHARACTER_ERR", null);
  +            throw new DOMException(DOMException.INVALID_CHARACTER_ERR, msg);
           }
           return new AttrNSImpl(this, namespaceURI, qualifiedName);
       }
  
  
  

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