286N/A/*
286N/A * reserved comment block
286N/A * DO NOT REMOVE OR ALTER!
286N/A */
286N/A/*
286N/A * Copyright 2001, 2002, 2004 The Apache Software Foundation.
286N/A *
286N/A * Licensed under the Apache License, Version 2.0 (the "License");
286N/A * you may not use this file except in compliance with the License.
286N/A * You may obtain a copy of the License at
286N/A *
286N/A * http://www.apache.org/licenses/LICENSE-2.0
286N/A *
286N/A * Unless required by applicable law or agreed to in writing, software
286N/A * distributed under the License is distributed on an "AS IS" BASIS,
286N/A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
286N/A * See the License for the specific language governing permissions and
286N/A * limitations under the License.
286N/A */
286N/A
286N/Apackage com.sun.org.apache.xerces.internal.util;
286N/A
286N/Aimport com.sun.org.apache.xerces.internal.xni.XNIException;
286N/Aimport com.sun.org.apache.xerces.internal.xni.parser.XMLErrorHandler;
286N/Aimport com.sun.org.apache.xerces.internal.xni.parser.XMLParseException;
286N/A
286N/Aimport org.w3c.dom.Node;
286N/Aimport org.w3c.dom.DOMError;
286N/Aimport org.w3c.dom.DOMLocator;
286N/Aimport org.w3c.dom.DOMErrorHandler;
286N/Aimport com.sun.org.apache.xerces.internal.dom.DOMErrorImpl;
286N/Aimport com.sun.org.apache.xerces.internal.dom.DOMLocatorImpl;
286N/Aimport com.sun.org.apache.xerces.internal.impl.msg.XMLMessageFormatter;
286N/A
286N/Aimport java.io.PrintWriter;
286N/Aimport java.util.Hashtable;
286N/A
286N/A/**
286N/A * This class handles DOM errors .
286N/A *
286N/A * @see DOMErrorHandler
286N/A *
286N/A * @author Gopal Sharma, SUN Microsystems Inc.
286N/A */
286N/A
286N/A// REVISIT: current implementations wraps error several times:
286N/A// XMLErrorReport.reportError creates XMLParserException (by wrapping all info)
286N/A// and goes via switch to send errors.
286N/A// DOMErrorHandlerWrapper catches calls, copies info from XMLParserException and
286N/A// sends one call back to the application
286N/A// I think we can avoid this indirection if we modify XMLErrorReporter. --el
286N/A
286N/Apublic class DOMErrorHandlerWrapper
286N/A implements XMLErrorHandler, DOMErrorHandler {
286N/A
286N/A
286N/A
286N/A // It keeps the reference of DOMErrorHandler of application
286N/A protected DOMErrorHandler fDomErrorHandler;
286N/A
286N/A // Error Status
286N/A boolean eStatus = true ;
286N/A
286N/A // Print writer
286N/A protected PrintWriter fOut;
286N/A
286N/A // some components may set error node
286N/A // @see DOMNormalizer.
286N/A public Node fCurrentNode;
286N/A
286N/A /** Error code for comparisons. **/
286N/A protected final XMLErrorCode fErrorCode = new XMLErrorCode(null, null);
286N/A
286N/A protected final DOMErrorImpl fDOMError = new DOMErrorImpl();
286N/A
286N/A
286N/A
286N/A //
286N/A // Constructors
286N/A //
286N/A
286N/A // Default constructor /
286N/A
286N/A public DOMErrorHandlerWrapper() {
286N/A fOut = new PrintWriter(System.err);
286N/A }
286N/A
286N/A
286N/A public DOMErrorHandlerWrapper(DOMErrorHandler domErrorHandler) {
286N/A fDomErrorHandler = domErrorHandler;
286N/A } // DOMErrorHandlerWrapper(DOMErrorHandler domErrorHandler)
286N/A
286N/A
286N/A //
286N/A // Public methods
286N/A //
286N/A
286N/A /** Sets the DOM error handler. */
286N/A public void setErrorHandler(DOMErrorHandler errorHandler) {
286N/A fDomErrorHandler = errorHandler;
286N/A } // setErrorHandler(ErrorHandler)
286N/A
286N/A
286N/A public DOMErrorHandler getErrorHandler(){
286N/A return fDomErrorHandler;
286N/A } //getErrorHandler()
286N/A
286N/A //
286N/A // XMLErrorHandler methods
286N/A //
286N/A
286N/A /**
286N/A * Reports a warning. Warnings are non-fatal and can be safely ignored
286N/A * by most applications.
286N/A *
286N/A * @param domain The domain of the warning. The domain can be any
286N/A * string but is suggested to be a valid URI. The
286N/A * domain can be used to conveniently specify a web
286N/A * site location of the relevent specification or
286N/A * document pertaining to this warning.
286N/A * @param key The warning key. This key can be any string and
286N/A * is implementation dependent.
286N/A * @param exception Exception.
286N/A *
286N/A * @throws XNIException Thrown to signal that the parser should stop
286N/A * parsing the document.
286N/A */
286N/A
286N/A public void warning(String domain, String key,
286N/A XMLParseException exception) throws XNIException {
286N/A fDOMError.fSeverity = DOMError.SEVERITY_WARNING;
286N/A fDOMError.fException = exception;
286N/A // REVISIT: May need to lookup from DOMErrorTypeMap in the future.
286N/A fDOMError.fType = key;
286N/A fDOMError.fRelatedData = fDOMError.fMessage = exception.getMessage();
286N/A DOMLocatorImpl locator = fDOMError.fLocator;
286N/A if (locator != null) {
286N/A locator.fColumnNumber = exception.getColumnNumber();
286N/A locator.fLineNumber = exception.getLineNumber();
286N/A locator.fUtf16Offset = exception.getCharacterOffset();
286N/A locator.fUri = exception.getExpandedSystemId();
286N/A locator.fRelatedNode = fCurrentNode;
286N/A }
286N/A if (fDomErrorHandler != null) {
286N/A fDomErrorHandler.handleError(fDOMError);
286N/A }
286N/A } // warning(String,String,XMLParseException)
286N/A
286N/A /**
286N/A * Reports an error. Errors are non-fatal and usually signify that the
286N/A * document is invalid with respect to its grammar(s).
286N/A *
286N/A * @param domain The domain of the error. The domain can be any
286N/A * string but is suggested to be a valid URI. The
286N/A * domain can be used to conveniently specify a web
286N/A * site location of the relevent specification or
286N/A * document pertaining to this error.
286N/A * @param key The error key. This key can be any string and
286N/A * is implementation dependent.
286N/A * @param exception Exception.
286N/A *
286N/A * @throws XNIException Thrown to signal that the parser should stop
286N/A * parsing the document.
286N/A */
286N/A public void error(String domain, String key,
286N/A XMLParseException exception) throws XNIException {
286N/A fDOMError.fSeverity = DOMError.SEVERITY_ERROR;
286N/A fDOMError.fException = exception;
286N/A // REVISIT: May need to lookup from DOMErrorTypeMap in the future.
286N/A fDOMError.fType = key;
286N/A fDOMError.fRelatedData = fDOMError.fMessage = exception.getMessage();
286N/A DOMLocatorImpl locator = fDOMError.fLocator;
286N/A if (locator != null) {
286N/A locator.fColumnNumber = exception.getColumnNumber();
286N/A locator.fLineNumber = exception.getLineNumber();
286N/A locator.fUtf16Offset = exception.getCharacterOffset();
286N/A locator.fUri = exception.getExpandedSystemId();
286N/A locator.fRelatedNode= fCurrentNode;
286N/A }
286N/A if (fDomErrorHandler != null) {
286N/A fDomErrorHandler.handleError(fDOMError);
286N/A }
286N/A } // error(String,String,XMLParseException)
286N/A
286N/A /**
286N/A * Report a fatal error. Fatal errors usually occur when the document
286N/A * is not well-formed and signifies that the parser cannot continue
286N/A * normal operation.
286N/A * <p>
286N/A * <strong>Note:</strong> The error handler should <em>always</em>
286N/A * throw an <code>XNIException</code> from this method. This exception
286N/A * can either be the same exception that is passed as a parameter to
286N/A * the method or a new XNI exception object. If the registered error
286N/A * handler fails to throw an exception, the continuing operation of
286N/A * the parser is undetermined.
286N/A *
286N/A * @param domain The domain of the fatal error. The domain can be
286N/A * any string but is suggested to be a valid URI. The
286N/A * domain can be used to conveniently specify a web
286N/A * site location of the relevent specification or
286N/A * document pertaining to this fatal error.
286N/A * @param key The fatal error key. This key can be any string
286N/A * and is implementation dependent.
286N/A * @param exception Exception.
286N/A *
286N/A * @throws XNIException Thrown to signal that the parser should stop
286N/A * parsing the document.
286N/A */
286N/A public void fatalError(String domain, String key,
286N/A XMLParseException exception) throws XNIException {
286N/A fDOMError.fSeverity = DOMError.SEVERITY_FATAL_ERROR;
286N/A fDOMError.fException = exception;
286N/A fErrorCode.setValues(domain, key);
286N/A String domErrorType = DOMErrorTypeMap.getDOMErrorType(fErrorCode);
286N/A fDOMError.fType = (domErrorType != null) ? domErrorType : key;
286N/A fDOMError.fRelatedData = fDOMError.fMessage = exception.getMessage();
286N/A DOMLocatorImpl locator = fDOMError.fLocator;
286N/A if (locator != null) {
286N/A locator.fColumnNumber = exception.getColumnNumber();
286N/A locator.fLineNumber = exception.getLineNumber();
286N/A locator.fUtf16Offset = exception.getCharacterOffset();
286N/A locator.fUri = exception.getExpandedSystemId();
286N/A locator.fRelatedNode = fCurrentNode;
286N/A }
286N/A if (fDomErrorHandler != null) {
286N/A fDomErrorHandler.handleError(fDOMError);
286N/A }
286N/A } // fatalError(String,String,XMLParseException)
286N/A
286N/A
286N/A public boolean handleError(DOMError error) {
286N/A printError(error);
286N/A return eStatus;
286N/A }
286N/A
286N/A /** Prints the error message. */
286N/A
286N/A private void printError(DOMError error) {
286N/A int severity = error.getSeverity();
286N/A fOut.print("[");
286N/A if ( severity == DOMError.SEVERITY_WARNING) {
286N/A fOut.print("Warning");
286N/A } else if ( severity == DOMError.SEVERITY_ERROR) {
286N/A fOut.print("Error");
286N/A } else {
286N/A fOut.print("FatalError");
286N/A eStatus = false ; //REVISIT: Abort processing if fatal error, do we need to??
286N/A }
286N/A fOut.print("] ");
286N/A DOMLocator locator = error.getLocation();
286N/A if (locator != null) {
286N/A fOut.print(locator.getLineNumber());
286N/A fOut.print(":");
286N/A fOut.print(locator.getColumnNumber());
286N/A fOut.print(":");
286N/A fOut.print(locator.getByteOffset());
286N/A fOut.print(",");
286N/A fOut.print(locator.getUtf16Offset());
286N/A Node node = locator.getRelatedNode();
286N/A if (node != null) {
286N/A fOut.print("[");
286N/A fOut.print(node.getNodeName());
286N/A fOut.print("]");
286N/A }
286N/A String systemId = locator.getUri();
286N/A if (systemId != null) {
286N/A int index = systemId.lastIndexOf('/');
286N/A if (index != -1)
286N/A systemId = systemId.substring(index + 1);
286N/A fOut.print(": ");
286N/A fOut.print(systemId);
286N/A }
286N/A
286N/A }
286N/A
286N/A fOut.print(":");
286N/A fOut.print(error.getMessage());
286N/A fOut.println();
286N/A fOut.flush();
286N/A
286N/A } // printError(DOMError)
286N/A
286N/A /**
286N/A * A convenience class for converting between internal
286N/A * error codes and DOM error types.
286N/A */
286N/A private static class DOMErrorTypeMap {
286N/A
286N/A /** Map for converting internal error codes to DOM error types. **/
286N/A private static Hashtable fgDOMErrorTypeTable;
286N/A
286N/A static {
286N/A // initialize error type table: internal error codes (represented by domain and key) need to be mapped to a DOM error type.
286N/A
286N/A // REVISIT: do well-formedness issues involving XML declaration <?xml ... ?> need to be added to hash table (no XML declaration node in DOM, but Document includes xmlEncoding, xmlStandalone, xmlVersion, etc.
286N/A
286N/A fgDOMErrorTypeTable = new Hashtable();
286N/A fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "InvalidCharInCDSect"), "wf-invalid-character");
286N/A fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "InvalidCharInContent"), "wf-invalid-character");
286N/A fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "TwoColonsInQName"), "wf-invalid-character-in-node-name");
286N/A fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "ColonNotLegalWithNS"), "wf-invalid-character-in-node-name");
286N/A fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "InvalidCharInProlog"), "wf-invalid-character"); // e.g. in Processing Instruction
286N/A
286N/A // InvalidCharInXMLDecl omitted because XML declaration is not a DOM Node
286N/A fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "CDEndInContent"), "wf-invalid-character");
286N/A fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "CDSectUnterminated"), "wf-invalid-character");
286N/A fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "DoctypeNotAllowed"), "doctype-not-allowed");
286N/A fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "ETagRequired"), "wf-invalid-character-in-node-name");
286N/A fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "ElementUnterminated"), "wf-invalid-character-in-node-name");
286N/A fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "EqRequiredInAttribute"), "wf-invalid-character");
286N/A fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "OpenQuoteExpected"), "wf-invalid-character");
286N/A fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "CloseQuoteExpected"), "wf-invalid-character");
286N/A fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "ETagUnterminated"), "wf-invalid-character-in-node-name");
286N/A fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "MarkupNotRecognizedInContent"), "wf-invalid-character");
286N/A fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "DoctypeIllegalInContent"), "doctype-not-allowed");
286N/A fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "InvalidCharInAttValue"), "wf-invalid-character");
286N/A fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "InvalidCharInPI"), "wf-invalid-character");
286N/A fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "InvalidCharInInternalSubset"), "wf-invalid-character");
286N/A fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "QuoteRequiredInAttValue"), "wf-invalid-character");
286N/A fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "LessthanInAttValue"), "wf-invalid-character");
286N/A fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "AttributeValueUnterminated"), "wf-invalid-character");
286N/A fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "PITargetRequired"), "wf-invalid-character");
286N/A fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "SpaceRequiredInPI"), "wf-invalid-character");
286N/A fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "PIUnterminated"), "wf-invalid-character");
286N/A fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "ReservedPITarget"), "wf-invalid-character");
286N/A fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "PI_NOT_IN_ONE_ENTITY"), "wf-invalid-character");
286N/A fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "PINotInOneEntity"), "wf-invalid-character");
286N/A fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "EncodingDeclInvalid"), "unsupported-encoding");
286N/A fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "EncodingByteOrderUnsupported"), "unsupported-encoding");
286N/A fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "InvalidCharInEntityValue"), "wf-invalid-character-in-node-name");
286N/A fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "InvalidCharInExternalSubset"), "wf-invalid-character");
286N/A fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "InvalidCharInIgnoreSect"), "wf-invalid-character");
286N/A fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "InvalidCharInPublicID"), "wf-invalid-character");
286N/A fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "InvalidCharInSystemID"), "wf-invalid-character");
286N/A fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "SpaceRequiredAfterSYSTEM"), "wf-invalid-character");
286N/A fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "QuoteRequiredInSystemID"), "wf-invalid-character");
286N/A fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "SystemIDUnterminated"), "wf-invalid-character");
286N/A fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "SpaceRequiredAfterPUBLIC"), "wf-invalid-character");
286N/A fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "QuoteRequiredInPublicID"), "wf-invalid-character");
286N/A fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "PublicIDUnterminated"), "wf-invalid-character");
286N/A fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "PubidCharIllegal"), "wf-invalid-character");
286N/A fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "SpaceRequiredBetweenPublicAndSystem"), "wf-invalid-character");
286N/A fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "MSG_SPACE_REQUIRED_BEFORE_ROOT_ELEMENT_TYPE_IN_DOCTYPEDECL"), "wf-invalid-character-in-node-name"); // considered error in name of node (which follows !DOCTYPE)
286N/A fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "MSG_ROOT_ELEMENT_TYPE_REQUIRED"), "wf-invalid-character-in-node-name");
286N/A fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "DoctypedeclUnterminated"), "wf-invalid-character-in-node-name");
286N/A fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "PEReferenceWithinMarkup"), "wf-invalid-character");
286N/A fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "MSG_MARKUP_NOT_RECOGNIZED_IN_DTD"), "wf-invalid-character");
286N/A fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "MSG_SPACE_REQUIRED_BEFORE_ELEMENT_TYPE_IN_ELEMENTDECL"), "wf-invalid-character");
286N/A fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "MSG_ELEMENT_TYPE_REQUIRED_IN_ELEMENTDECL"), "wf-invalid-character");
286N/A fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "MSG_SPACE_REQUIRED_BEFORE_CONTENTSPEC_IN_ELEMENTDECL"), "wf-invalid-character");
286N/A fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "MSG_CONTENTSPEC_REQUIRED_IN_ELEMENTDECL"), "wf-invalid-character");
286N/A fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "ElementDeclUnterminated"), "wf-invalid-character");
286N/A fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "MSG_OPEN_PAREN_OR_ELEMENT_TYPE_REQUIRED_IN_CHILDREN"), "wf-invalid-character");
286N/A fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "MSG_CLOSE_PAREN_REQUIRED_IN_CHILDREN"), "wf-invalid-character");
286N/A fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "MSG_ELEMENT_TYPE_REQUIRED_IN_MIXED_CONTENT"), "wf-invalid-character");
286N/A fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "MSG_CLOSE_PAREN_REQUIRED_IN_MIXED"), "wf-invalid-character");
286N/A fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "MixedContentUnterminated"), "wf-invalid-character");
286N/A fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "MSG_SPACE_REQUIRED_BEFORE_ELEMENT_TYPE_IN_ATTLISTDECL"), "wf-invalid-character");
286N/A fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "MSG_ELEMENT_TYPE_REQUIRED_IN_ATTLISTDECL"), "wf-invalid-character");
286N/A fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "MSG_SPACE_REQUIRED_BEFORE_ATTRIBUTE_NAME_IN_ATTDEF"), "wf-invalid-character");
286N/A fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "AttNameRequiredInAttDef"), "wf-invalid-character");
286N/A fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "MSG_SPACE_REQUIRED_BEFORE_ATTTYPE_IN_ATTDEF"), "wf-invalid-character");
286N/A fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "AttTypeRequiredInAttDef"), "wf-invalid-character");
286N/A fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "MSG_SPACE_REQUIRED_BEFORE_DEFAULTDECL_IN_ATTDEF"), "wf-invalid-character");
286N/A fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "MSG_DUPLICATE_ATTRIBUTE_DEFINITION"), "wf-invalid-character");
286N/A fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "MSG_SPACE_REQUIRED_AFTER_NOTATION_IN_NOTATIONTYPE"), "wf-invalid-character");
286N/A fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "MSG_OPEN_PAREN_REQUIRED_IN_NOTATIONTYPE"), "wf-invalid-character");
286N/A fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "MSG_NAME_REQUIRED_IN_NOTATIONTYPE"), "wf-invalid-character");
286N/A fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "NotationTypeUnterminated"), "wf-invalid-character");
286N/A fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "MSG_NMTOKEN_REQUIRED_IN_ENUMERATION"), "wf-invalid-character");
286N/A fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "EnumerationUnterminated"), "wf-invalid-character");
286N/A fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "MSG_DISTINCT_TOKENS_IN_ENUMERATION"), "wf-invalid-character");
286N/A fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "MSG_DISTINCT_NOTATION_IN_ENUMERATION"), "wf-invalid-character");
286N/A fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "MSG_SPACE_REQUIRED_AFTER_FIXED_IN_DEFAULTDECL"), "wf-invalid-character");
286N/A fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "IncludeSectUnterminated"), "wf-invalid-character");
286N/A fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "IgnoreSectUnterminated"), "wf-invalid-character");
286N/A fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "NameRequiredInPEReference"), "wf-invalid-character");
286N/A fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "SemicolonRequiredInPEReference"), "wf-invalid-character");
286N/A fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "MSG_SPACE_REQUIRED_BEFORE_ENTITY_NAME_IN_ENTITYDECL"), "wf-invalid-character-in-node-name"); // considered error in name of node (which follows !ENTITY)
286N/A fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "MSG_SPACE_REQUIRED_BEFORE_PERCENT_IN_PEDECL"), "wf-invalid-character-in-node-name"); // considered error in name of node (which follows !ENTITY %)
286N/A fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "MSG_SPACE_REQUIRED_BEFORE_ENTITY_NAME_IN_PEDECL"), "wf-invalid-character-in-node-name"); // considered error in name of node (which follows !ENTITY %)
286N/A fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "MSG_ENTITY_NAME_REQUIRED_IN_ENTITYDECL"), "wf-invalid-character-in-node-name"); // considered error in name of node (which follows !ENTITY)
286N/A fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "MSG_SPACE_REQUIRED_AFTER_ENTITY_NAME_IN_ENTITYDECL"), "wf-invalid-character-in-node-name"); // considered error in name of node
286N/A fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "MSG_SPACE_REQUIRED_BEFORE_NOTATION_NAME_IN_UNPARSED_ENTITYDECL"), "wf-invalid-character");
286N/A fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "MSG_SPACE_REQUIRED_BEFORE_NDATA_IN_UNPARSED_ENTITYDECL"), "wf-invalid-character");
286N/A fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "MSG_NOTATION_NAME_REQUIRED_FOR_UNPARSED_ENTITYDECL"), "wf-invalid-character");
286N/A fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "EntityDeclUnterminated"), "wf-invalid-character-in-node-name");
286N/A fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "MSG_DUPLICATE_ENTITY_DEFINITION"), "wf-invalid-character-in-node-name");
286N/A fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "ExternalIDRequired"), "wf-invalid-character");
286N/A fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "MSG_SPACE_REQUIRED_BEFORE_PUBIDLITERAL_IN_EXTERNALID"), "wf-invalid-character");
286N/A fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "MSG_SPACE_REQUIRED_AFTER_PUBIDLITERAL_IN_EXTERNALID"), "wf-invalid-character");
286N/A fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "MSG_SPACE_REQUIRED_BEFORE_SYSTEMLITERAL_IN_EXTERNALID"), "wf-invalid-character");
286N/A fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "MSG_URI_FRAGMENT_IN_SYSTEMID"), "wf-invalid-character");
286N/A fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "MSG_SPACE_REQUIRED_BEFORE_NOTATION_NAME_IN_NOTATIONDECL"), "wf-invalid-character-in-node-name"); // considered error in name of node, which follows !NOTATION
286N/A fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "MSG_NOTATION_NAME_REQUIRED_IN_NOTATIONDECL"), "wf-invalid-character-in-node-name"); // considered error in name of node, which follows !NOTATION
286N/A fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "MSG_SPACE_REQUIRED_AFTER_NOTATION_NAME_IN_NOTATIONDECL"), "wf-invalid-character-in-node-name"); // considered error in name of node, which follows !NOTATION
286N/A fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "ExternalIDorPublicIDRequired"), "wf-invalid-character");
286N/A fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "NotationDeclUnterminated"), "wf-invalid-character-in-node-name");
286N/A fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "ReferenceToExternalEntity"), "wf-invalid-character");
286N/A fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "ReferenceToUnparsedEntity"), "wf-invalid-character");
286N/A
286N/A // REVISIT: do EntityNotDeclared, RecursiveReference, RecursiveGeneralReference, RecursivePEReference belong here?
286N/A fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "EncodingNotSupported"), "unsupported-encoding");
286N/A fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "EncodingRequired"), "unsupported-encoding");
286N/A fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "IllegalQName"), "wf-invalid-character-in-node-name");
286N/A fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "ElementXMLNSPrefix"), "wf-invalid-character-in-node-name");
286N/A fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "ElementPrefixUnbound"), "wf-invalid-character-in-node-name");
286N/A fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "AttributePrefixUnbound"), "wf-invalid-character-in-node-name");
286N/A fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "EmptyPrefixedAttName"), "wf-invalid-character-in-node-name");
286N/A fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "PrefixDeclared"), "wf-invalid-character-in-node-name");
286N/A }
286N/A
286N/A public static String getDOMErrorType (XMLErrorCode error) {
286N/A return (String) fgDOMErrorTypeTable.get(error);
286N/A }
286N/A
286N/A private DOMErrorTypeMap () {}
286N/A }
286N/A
286N/A} // class DOMErrorHandlerWrapper