diff options
Diffstat (limited to 'src/com/sun/org/apache/xerces/internal')
78 files changed, 3107 insertions, 2785 deletions
diff --git a/src/com/sun/org/apache/xerces/internal/dom/CoreDocumentImpl.java b/src/com/sun/org/apache/xerces/internal/dom/CoreDocumentImpl.java index 46cbc34..64094b2 100644 --- a/src/com/sun/org/apache/xerces/internal/dom/CoreDocumentImpl.java +++ b/src/com/sun/org/apache/xerces/internal/dom/CoreDocumentImpl.java @@ -1,13 +1,13 @@ /* - * reserved comment block - * DO NOT REMOVE OR ALTER! + * Copyright (c) 2009, 2015, Oracle and/or its affiliates. All rights reserved. */ /* - * Copyright 1999-2002,2004,2005 The Apache Software Foundation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * @@ -17,25 +17,27 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - package com.sun.org.apache.xerces.internal.dom; -import java.lang.reflect.Constructor; -import java.util.Enumeration; -import java.util.Hashtable; -import com.sun.org.apache.xerces.internal.util.URI; import com.sun.org.apache.xerces.internal.impl.Constants; - -import org.w3c.dom.DOMConfiguration; -import org.w3c.dom.UserDataHandler; -import com.sun.org.apache.xerces.internal.util.XMLChar; +import com.sun.org.apache.xerces.internal.util.URI; import com.sun.org.apache.xerces.internal.util.XML11Char; -import com.sun.org.apache.xerces.internal.xni.NamespaceContext; +import com.sun.org.apache.xerces.internal.util.XMLChar; import com.sun.org.apache.xerces.internal.utils.ObjectFactory; import com.sun.org.apache.xerces.internal.utils.SecuritySupport; +import com.sun.org.apache.xerces.internal.xni.NamespaceContext; +import java.io.IOException; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; +import java.io.ObjectStreamField; +import java.lang.reflect.Constructor; +import java.util.HashMap; +import java.util.Hashtable; +import java.util.Map; import org.w3c.dom.Attr; import org.w3c.dom.CDATASection; import org.w3c.dom.Comment; +import org.w3c.dom.DOMConfiguration; import org.w3c.dom.DOMException; import org.w3c.dom.DOMImplementation; import org.w3c.dom.Document; @@ -50,6 +52,7 @@ import org.w3c.dom.NodeList; import org.w3c.dom.Notation; import org.w3c.dom.ProcessingInstruction; import org.w3c.dom.Text; +import org.w3c.dom.UserDataHandler; import org.w3c.dom.events.Event; import org.w3c.dom.events.EventListener; import org.w3c.dom.ls.DOMImplementationLS; @@ -82,17 +85,15 @@ import org.w3c.dom.ls.LSSerializer; * @version $Id: CoreDocumentImpl.java,v 1.9 2010-11-01 04:39:37 joehw Exp $ * @since PR-DOM-Level-1-19980818. */ - - public class CoreDocumentImpl -extends ParentNode implements Document { - - /**TODO:: - * 1. Change XML11Char method names similar to XMLChar. That will prevent lot - * of dirty version checking code. - * - * 2. IMO during cloneNode qname/isXMLName check should not be made. - */ + extends ParentNode implements Document { + + /** + * TODO:: 1. Change XML11Char method names similar to XMLChar. That will + * prevent lot of dirty version checking code. + * + * 2. IMO during cloneNode qname/isXMLName check should not be made. + */ // // Constants // @@ -130,13 +131,12 @@ extends ParentNode implements Document { /**Experimental DOM Level 3 feature: documentURI */ protected String fDocumentURI; - //Revisit :: change to a better data structure. + //Revisit :: change to a better data structure. /** Table for user data attached to this document nodes. */ - protected Hashtable userData; - + private Map<Node, Map<String, UserDataRecord>> nodeUserData; /** Identifiers. */ - protected Hashtable identifiers; + protected Map<String, Node> identifiers; // DOM Level 3: normalizeDocument transient DOMNormalizer domNormalizer = null; @@ -207,7 +207,7 @@ extends ParentNode implements Document { // document. Node number values are negative integers. Nodes are // assigned numbers on demand. private int nodeCounter = 0; - private Hashtable nodeTable; + private Map<Node, Integer> nodeTable; private boolean xml11Version = false; //by default 1.0 // // Static initialization @@ -243,6 +243,52 @@ extends ParentNode implements Document { } // static + /** + * @serialField docType DocumentTypeImpl document type + * @serialField docElement ElementImpl document element + * @serialField fFreeNLCache NodeListCache NodeListCache free list + * @serialField encoding String Document encoding + * @serialField actualEncoding String Document actualEncoding + * @serialField version String Document version + * @serialField standalone boolean Document standalone + * @serialField fDocumentURI String Document URI + * @serialField userData Hashtable user data attached to the nodes. Note that + * it was original called "userData". It has been changed to nodeUserData to + * avoid confusion with those that are actually values of the map. + * @serialField identifiers Hashtable identifiers + * @serialField changes int flag indicates whether the node has changed + * @serialField allowGrammarAccess boolean Allow grammar access + * @serialField errorChecking boolean Bypass error checking + * @serialField ancestorChecking boolean Ancestor checking + * @serialField xmlVersionChanged boolean Indicate whether the version has changed + * @serialField documentNumber int Document number + * @serialField nodeCounter int Node counter + * @serialField nodeTable Hashtable Node table + * @serialField xml11Version boolean XML version + */ + private static final ObjectStreamField[] serialPersistentFields = + new ObjectStreamField[] { + new ObjectStreamField("docType", DocumentTypeImpl.class), + new ObjectStreamField("docElement", ElementImpl.class), + new ObjectStreamField("fFreeNLCache", NodeListCache.class), + new ObjectStreamField("encoding", String.class), + new ObjectStreamField("actualEncoding", String.class), + new ObjectStreamField("version", String.class), + new ObjectStreamField("standalone", boolean.class), + new ObjectStreamField("fDocumentURI", String.class), + new ObjectStreamField("userData", Hashtable.class), + new ObjectStreamField("identifiers", Hashtable.class), + new ObjectStreamField("changes", int.class), + new ObjectStreamField("allowGrammarAccess", boolean.class), + new ObjectStreamField("errorChecking", boolean.class), + new ObjectStreamField("ancestorChecking", boolean.class), + new ObjectStreamField("xmlVersionChanged", boolean.class), + new ObjectStreamField("documentNumber", int.class), + new ObjectStreamField("nodeCounter", int.class), + new ObjectStreamField("nodeTable", Hashtable.class), + new ObjectStreamField("xml11Version", boolean.class), + }; + // // Constructors // @@ -343,24 +389,21 @@ extends ParentNode implements Document { } if (deep) { - Hashtable reversedIdentifiers = null; + Map<Node, String> reversedIdentifiers = null; if (identifiers != null) { // Build a reverse mapping from element to identifier. - reversedIdentifiers = new Hashtable(); - Enumeration elementIds = identifiers.keys(); - while (elementIds.hasMoreElements()) { - Object elementId = elementIds.nextElement(); - reversedIdentifiers.put(identifiers.get(elementId), - elementId); + reversedIdentifiers = new HashMap<>(identifiers.size()); + for (String elementId : identifiers.keySet()) { + reversedIdentifiers.put(identifiers.get(elementId), elementId); } } // Copy children into new document. for (ChildNode kid = firstChild; kid != null; - kid = kid.nextSibling) { + kid = kid.nextSibling) { newdoc.appendChild(newdoc.importNode(kid, true, true, - reversedIdentifiers)); + reversedIdentifiers)); } } @@ -385,7 +428,7 @@ extends ParentNode implements Document { * document element nor the document type in any way */ public Node insertBefore(Node newChild, Node refChild) - throws DOMException { + throws DOMException { // Only one such child permitted int type = newChild.getNodeType(); @@ -447,7 +490,7 @@ extends ParentNode implements Document { * document element nor the document type in any way */ public Node replaceChild(Node newChild, Node oldChild) - throws DOMException { + throws DOMException { // Adopt orphan doctypes if (newChild.getOwnerDocument() == null && @@ -463,8 +506,8 @@ extends ParentNode implements Document { newChild.getNodeType() == Node.ELEMENT_NODE))) { throw new DOMException( - DOMException.HIERARCHY_REQUEST_ERR, - DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "HIERARCHY_REQUEST_ERR", null)); + DOMException.HIERARCHY_REQUEST_ERR, + DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "HIERARCHY_REQUEST_ERR", null)); } super.replaceChild(newChild, oldChild); @@ -491,7 +534,7 @@ extends ParentNode implements Document { * @since DOM Level 3 */ public void setTextContent(String textContent) - throws DOMException { + throws DOMException { // no-op } @@ -508,7 +551,7 @@ extends ParentNode implements Document { // plus, only features whose interfaces are directly castable are // considered. if ((feature.equalsIgnoreCase("+XPath")) - && (anyVersion || version.equals("3.0"))) { + && (anyVersion || version.equals("3.0"))) { // If an XPathEvaluator was created previously // return it otherwise create a new one. @@ -527,7 +570,7 @@ extends ParentNode implements Document { Class interfaces[] = xpathClass.getInterfaces(); for (int i = 0; i < interfaces.length; i++) { if (interfaces[i].getName().equals( - "org.w3c.dom.xpath.XPathEvaluator")) { + "org.w3c.dom.xpath.XPathEvaluator")) { fXPathEvaluator = xpathClassConstr.newInstance(new Object[] { this }); return fXPathEvaluator; } @@ -557,14 +600,14 @@ extends ParentNode implements Document { * if the attribute name is not acceptable. */ public Attr createAttribute(String name) - throws DOMException { + throws DOMException { if (errorChecking && !isXMLName(name,xml11Version)) { String msg = DOMMessageFormatter.formatMessage( - DOMMessageFormatter.DOM_DOMAIN, - "INVALID_CHARACTER_ERR", - null); + DOMMessageFormatter.DOM_DOMAIN, + "INVALID_CHARACTER_ERR", + null); throw new DOMException(DOMException.INVALID_CHARACTER_ERR, msg); } return new AttrImpl(this, name); @@ -581,7 +624,7 @@ extends ParentNode implements Document { * not yet implemented.) */ public CDATASection createCDATASection(String data) - throws DOMException { + throws DOMException { return new CDATASectionImpl(this, data); } @@ -615,7 +658,7 @@ extends ParentNode implements Document { * acceptable. */ public Element createElement(String tagName) - throws DOMException { + throws DOMException { if (errorChecking && !isXMLName(tagName,xml11Version)) { String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "INVALID_CHARACTER_ERR", null); @@ -636,7 +679,7 @@ extends ParentNode implements Document { * implemented.) */ public EntityReference createEntityReference(String name) - throws DOMException { + throws DOMException { if (errorChecking && !isXMLName(name,xml11Version)) { String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "INVALID_CHARACTER_ERR", null); @@ -660,8 +703,8 @@ extends ParentNode implements Document { * not yet implemented.) */ public ProcessingInstruction createProcessingInstruction(String target, - String data) - throws DOMException { + String data) + throws DOMException { if (errorChecking && !isXMLName(target,xml11Version)) { String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "INVALID_CHARACTER_ERR", null); @@ -695,7 +738,6 @@ extends ParentNode implements Document { return docType; } - /** * Convenience method, allowing direct access to the child node * which is considered the root of the actual document content. For @@ -787,7 +829,6 @@ extends ParentNode implements Document { return errorChecking; } - /** * DOM Level 3 CR - Experimental. (Was getActualEncoding) * @@ -921,8 +962,8 @@ extends ParentNode implements Document { * @since DOM Level 3 */ public void setXmlStandalone(boolean value) - throws DOMException { - standalone = value; + throws DOMException { + standalone = value; } /** @@ -993,9 +1034,9 @@ extends ParentNode implements Document { if(colon1 != -1){ String msg = DOMMessageFormatter.formatMessage( - DOMMessageFormatter.DOM_DOMAIN, - "NAMESPACE_ERR", - null); + DOMMessageFormatter.DOM_DOMAIN, + "NAMESPACE_ERR", + null); throw new DOMException(DOMException.NAMESPACE_ERR, msg); } if (!isXMLName(name,xml11Version)) { @@ -1021,7 +1062,7 @@ extends ParentNode implements Document { copyEventListeners(el, nel); // remove user data from old node - Hashtable data = removeUserDataTable(el); + Map<String, UserDataRecord> data = removeUserDataTable(el); // remove old node from parent if any Node parent = el.getParentNode(); @@ -1094,7 +1135,7 @@ extends ParentNode implements Document { copyEventListeners(at, nat); // remove user data from old node - Hashtable data = removeUserDataTable(at); + Map<String, UserDataRecord> data = removeUserDataTable(at); // move children to new node Node child = at.getFirstChild(); @@ -1329,13 +1370,13 @@ extends ParentNode implements Document { * parameter is from an other document. */ public String saveXML(Node node) - throws DOMException { - if ( errorChecking && node != null && - this != node.getOwnerDocument() ) { + throws DOMException { + if (errorChecking && node != null + && this != node.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(); + DOMImplementationLS domImplLS = (DOMImplementationLS) DOMImplementationImpl.getDOMImplementation(); LSSerializer xmlWriter = domImplLS.createLSSerializer(); if (node == null) { node = this; @@ -1344,8 +1385,8 @@ extends ParentNode implements Document { } /** - * Sets whether the DOM implementation generates mutation events - * upon operations. + * Sets whether the DOM implementation generates mutation events upon + * operations. */ void setMutationEvents(boolean set) { // does nothing by default - overidden in subclass @@ -1359,47 +1400,40 @@ extends ParentNode implements Document { return false; } - - // non-DOM factory methods - /** - * NON-DOM - * Factory method; creates a DocumentType having this Document - * as its OwnerDoc. (REC-DOM-Level-1-19981001 left the process of building - * DTD information unspecified.) + * NON-DOM Factory method; creates a DocumentType having this Document as + * its OwnerDoc. (REC-DOM-Level-1-19981001 left the process of building DTD + * information unspecified.) * * @param name The name of the Entity we wish to provide a value for. * - * @throws DOMException(NOT_SUPPORTED_ERR) for HTML documents, where - * DTDs are not permitted. (HTML not yet implemented.) + * @throws DOMException(NOT_SUPPORTED_ERR) for HTML documents, where DTDs + * are not permitted. (HTML not yet implemented.) */ public DocumentType createDocumentType(String qualifiedName, - String publicID, - String systemID) - throws DOMException { + String publicID, + String systemID) + throws DOMException { return new DocumentTypeImpl(this, qualifiedName, publicID, systemID); } // createDocumentType(String):DocumentType /** - * NON-DOM - * Factory method; creates an Entity having this Document - * as its OwnerDoc. (REC-DOM-Level-1-19981001 left the process of building - * DTD information unspecified.) + * NON-DOM Factory method; creates an Entity having this Document as its + * OwnerDoc. (REC-DOM-Level-1-19981001 left the process of building DTD + * information unspecified.) * * @param name The name of the Entity we wish to provide a value for. * * @throws DOMException(NOT_SUPPORTED_ERR) for HTML documents, where - * nonstandard entities are not permitted. (HTML not yet - * implemented.) + * nonstandard entities are not permitted. (HTML not yet implemented.) */ public Entity createEntity(String name) - throws DOMException { - + throws DOMException { - if (errorChecking && !isXMLName(name,xml11Version)) { + if (errorChecking && !isXMLName(name, xml11Version)) { String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "INVALID_CHARACTER_ERR", null); throw new DOMException(DOMException.INVALID_CHARACTER_ERR, msg); } @@ -1408,21 +1442,19 @@ extends ParentNode implements Document { } // createEntity(String):Entity /** - * NON-DOM - * Factory method; creates a Notation having this Document - * as its OwnerDoc. (REC-DOM-Level-1-19981001 left the process of building - * DTD information unspecified.) + * NON-DOM Factory method; creates a Notation having this Document as its + * OwnerDoc. (REC-DOM-Level-1-19981001 left the process of building DTD + * information unspecified.) * * @param name The name of the Notation we wish to describe * * @throws DOMException(NOT_SUPPORTED_ERR) for HTML documents, where - * notations are not permitted. (HTML not yet - * implemented.) + * notations are not permitted. (HTML not yet implemented.) */ public Notation createNotation(String name) - throws DOMException { + throws DOMException { - if (errorChecking && !isXMLName(name,xml11Version)) { + if (errorChecking && !isXMLName(name, xml11Version)) { String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "INVALID_CHARACTER_ERR", null); throw new DOMException(DOMException.INVALID_CHARACTER_ERR, msg); } @@ -1435,9 +1467,9 @@ extends ParentNode implements Document { * definitions hold default attribute values. */ public ElementDefinitionImpl createElementDefinition(String name) - throws DOMException { + throws DOMException { - if (errorChecking && !isXMLName(name,xml11Version)) { + if (errorChecking && !isXMLName(name, xml11Version)) { String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "INVALID_CHARACTER_ERR", null); throw new DOMException(DOMException.INVALID_CHARACTER_ERR, msg); } @@ -1446,23 +1478,23 @@ extends ParentNode implements Document { } // createElementDefinition(String):ElementDefinitionImpl // other non-DOM methods - - /** NON-DOM: Get the number associated with this document. Used to - * order documents in the implementation. + /** + * NON-DOM: Get the number associated with this document. Used to order + * documents in the implementation. */ protected int getNodeNumber() { - if (documentNumber==0) { + if (documentNumber == 0) { - CoreDOMImplementationImpl cd = (CoreDOMImplementationImpl)CoreDOMImplementationImpl.getDOMImplementation(); + CoreDOMImplementationImpl cd = (CoreDOMImplementationImpl) CoreDOMImplementationImpl.getDOMImplementation(); documentNumber = cd.assignDocumentNumber(); } return documentNumber; } - - /** NON-DOM: Get a number associated with a node created with respect - * to this document. Needed for compareDocumentPosition when nodes - * are disconnected. This is only used on demand. + /** + * NON-DOM: Get a number associated with a node created with respect to this + * document. Needed for compareDocumentPosition when nodes are disconnected. + * This is only used on demand. */ protected int getNodeNumber(Node node) { @@ -1472,18 +1504,17 @@ extends ParentNode implements Document { // Node numbers are negative, from -1 to -n int num; if (nodeTable == null) { - nodeTable = new Hashtable(); + nodeTable = new HashMap<>(); num = --nodeCounter; nodeTable.put(node, new Integer(num)); - } - else { - Integer n = (Integer)nodeTable.get(node); - if (n== null) { + } else { + Integer n = nodeTable.get(node); + if (n == null) { num = --nodeCounter; - nodeTable.put(node, new Integer(num)); - } - else + nodeTable.put(node, num); + } else { num = n.intValue(); + } } return num; } @@ -1498,7 +1529,7 @@ extends ParentNode implements Document { * and a NOT_SUPPORTED_ERR exception is thrown if attempted. */ public Node importNode(Node source, boolean deep) - throws DOMException { + throws DOMException { return importNode(source, deep, false, null); } // importNode(Node,boolean):Node @@ -1507,18 +1538,18 @@ extends ParentNode implements Document { * provides the core functionality for the public importNode and cloneNode * methods. * - * The reversedIdentifiers parameter is provided for cloneNode to - * preserve the document's identifiers. The Hashtable has Elements as the - * keys and their identifiers as the values. When an element is being - * imported, a check is done for an associated identifier. If one exists, - * the identifier is registered with the new, imported element. If - * reversedIdentifiers is null, the parameter is not applied. + * The reversedIdentifiers parameter is provided for cloneNode to preserve + * the document's identifiers. The Map has Elements as the keys and + * their identifiers as the values. When an element is being imported, a + * check is done for an associated identifier. If one exists, the identifier + * is registered with the new, imported element. If reversedIdentifiers is + * null, the parameter is not applied. */ private Node importNode(Node source, boolean deep, boolean cloningDoc, - Hashtable reversedIdentifiers) - throws DOMException { - Node newnode=null; - Hashtable userData = null; + Map<Node, String> reversedIdentifiers) + throws DOMException { + Node newnode = null; + Map<String, UserDataRecord> userData = null; // Sigh. This doesn't work; too many nodes have private data that // would have to be manually tweaked. May be able to add local @@ -1531,8 +1562,9 @@ extends ParentNode implements Document { // newnode.ownerDocument=this; // } // else - if(source instanceof NodeImpl) - userData = ((NodeImpl)source).getUserDataRecord(); + if (source instanceof NodeImpl) { + userData = ((NodeImpl) source).getUserDataRecord(); + } int type = source.getNodeType(); switch (type) { case ELEMENT_NODE: { @@ -1543,7 +1575,7 @@ extends ParentNode implements Document { newElement = createElement(source.getNodeName()); else newElement = createElementNS(source.getNamespaceURI(), - source.getNodeName()); + source.getNodeName()); // Copy element's attributes, if any. NamedNodeMap sourceAttrs = source.getAttributes(); @@ -1558,7 +1590,7 @@ extends ParentNode implements Document { // But for importNode defaults should be ignored. if (attr.getSpecified() || cloningDoc) { Attr newAttr = (Attr)importNode(attr, true, cloningDoc, - reversedIdentifiers); + reversedIdentifiers); // Attach attribute according to namespace // support/qualification. @@ -1567,17 +1599,18 @@ extends ParentNode implements Document { newElement.setAttributeNode(newAttr); else newElement.setAttributeNodeNS(newAttr); + } } } - } // Register element identifier. if (reversedIdentifiers != null) { // Does element have an associated identifier? - Object elementId = reversedIdentifiers.get(source); + String elementId = reversedIdentifiers.get(source); if (elementId != null) { - if (identifiers == null) - identifiers = new Hashtable(); + if (identifiers == null) { + identifiers = new HashMap<>(); + } identifiers.put(elementId, newElement); } @@ -1594,7 +1627,7 @@ extends ParentNode implements Document { newnode = createAttribute(source.getNodeName()); } else { newnode = createAttributeNS(source.getNamespaceURI(), - source.getNodeName()); + source.getNodeName()); } } else { @@ -1663,7 +1696,7 @@ extends ParentNode implements Document { case PROCESSING_INSTRUCTION_NODE: { newnode = createProcessingInstruction(source.getNodeName(), - source.getNodeValue()); + source.getNodeValue()); break; } @@ -1682,15 +1715,15 @@ extends ParentNode implements Document { DocumentType srcdoctype = (DocumentType)source; DocumentTypeImpl newdoctype = (DocumentTypeImpl) createDocumentType(srcdoctype.getNodeName(), - srcdoctype.getPublicId(), - srcdoctype.getSystemId()); + srcdoctype.getPublicId(), + srcdoctype.getSystemId()); // Values are on NamedNodeMaps NamedNodeMap smap = srcdoctype.getEntities(); NamedNodeMap tmap = newdoctype.getEntities(); if(smap != null) { for(int i = 0; i < smap.getLength(); i++) { tmap.setNamedItem(importNode(smap.item(i), true, true, - reversedIdentifiers)); + reversedIdentifiers)); } } smap = srcdoctype.getNotations(); @@ -1698,7 +1731,7 @@ extends ParentNode implements Document { if (smap != null) { for(int i = 0; i < smap.getLength(); i++) { tmap.setNamedItem(importNode(smap.item(i), true, true, - reversedIdentifiers)); + reversedIdentifiers)); } } @@ -1741,10 +1774,10 @@ extends ParentNode implements Document { // If deep, replicate and attach the kids. if (deep) { for (Node srckid = source.getFirstChild(); - srckid != null; - srckid = srckid.getNextSibling()) { + srckid != null; + srckid = srckid.getNextSibling()) { newnode.appendChild(importNode(srckid, true, cloningDoc, - reversedIdentifiers)); + reversedIdentifiers)); } } if (newnode.getNodeType() == Node.ENTITY_NODE) { @@ -1752,7 +1785,7 @@ extends ParentNode implements Document { } return newnode; - } // importNode(Node,boolean,boolean,Hashtable):Node + } // importNode(Node,boolean,boolean,Map):Node /** * DOM Level 3 WD - Experimental @@ -1763,7 +1796,7 @@ extends ParentNode implements Document { **/ public Node adoptNode(Node source) { NodeImpl node; - Hashtable userData = null; + Map<String, UserDataRecord> userData; try { node = (NodeImpl) source; } catch (ClassCastException e) { @@ -1774,8 +1807,8 @@ extends ParentNode implements Document { // Return null if the source is null if (source == null ) { - return null; - } else if (source != null && source.getOwnerDocument() != null) { + return null; + } else if (source.getOwnerDocument() != null) { DOMImplementation thisImpl = this.getImplementation(); DOMImplementation otherImpl = source.getOwnerDocument().getImplementation(); @@ -1795,7 +1828,7 @@ extends ParentNode implements Document { // Adopting between two dissimilar DOM's is not allowed return null; } - } + } } switch (node.getNodeType()) { @@ -1808,12 +1841,13 @@ extends ParentNode implements Document { } //2. specified flag is set to true attr.isSpecified(true); - userData = node.getUserDataRecord(); + userData = node.getUserDataRecord(); //3. change ownership attr.setOwnerDocument(this); - if(userData != null ) - setUserDataTable(node,userData); + if (userData != null) { + setUserDataTable(node, userData); + } break; } //entity, notation nodes are read only nodes.. so they can't be adopted. @@ -1832,7 +1866,7 @@ extends ParentNode implements Document { throw new DOMException(DOMException.NOT_SUPPORTED_ERR, msg); } case ENTITY_REFERENCE_NODE: { - userData = node.getUserDataRecord(); + userData = node.getUserDataRecord(); // remove node from wherever it is Node parent = node.getParentNode(); if (parent != null) { @@ -1845,8 +1879,9 @@ extends ParentNode implements Document { } // change ownership node.setOwnerDocument(this); - if(userData != null) - setUserDataTable(node,userData); + if (userData != null) { + setUserDataTable(node, userData); + } // set its new replacement value if any if (docType == null) { break; @@ -1857,14 +1892,14 @@ extends ParentNode implements Document { break; } for (child = entityNode.getFirstChild(); - child != null; child = child.getNextSibling()) { + child != null; child = child.getNextSibling()) { Node childClone = child.cloneNode(true); node.appendChild(childClone); } break; } case ELEMENT_NODE: { - userData = node.getUserDataRecord(); + userData = node.getUserDataRecord(); // remove node from wherever it is Node parent = node.getParentNode(); if (parent != null) { @@ -1872,14 +1907,15 @@ extends ParentNode implements Document { } // change ownership node.setOwnerDocument(this); - if(userData != null) - setUserDataTable(node,userData); + if (userData != null) { + setUserDataTable(node, userData); + } // reconcile default attributes ((ElementImpl)node).reconcileDefaultAttributes(); break; } default: { - userData = node.getUserDataRecord(); + userData = node.getUserDataRecord(); // remove node from wherever it is Node parent = node.getParentNode(); if (parent != null) { @@ -1887,15 +1923,17 @@ extends ParentNode implements Document { } // change ownership node.setOwnerDocument(this); - if(userData != null) - setUserDataTable(node,userData); + if (userData != null) { + setUserDataTable(node, userData); + } } } //DOM L3 Core CR - //http://www.w3.org/TR/2003/CR-DOM-Level-3-Core-20031107/core.html#UserDataHandler-ADOPTED - if(userData != null) - callUserDataHandlers(source, null, UserDataHandler.NODE_ADOPTED,userData); + //http://www.w3.org/TR/2003/CR-DOM-Level-3-Core-20031107/core.html#UserDataHandler-ADOPTED + if (userData != null) { + callUserDataHandlers(source, null, UserDataHandler.NODE_ADOPTED, userData); + } return node; } @@ -1994,7 +2032,7 @@ extends ParentNode implements Document { } if (identifiers == null) { - identifiers = new Hashtable(); + identifiers = new HashMap<>(); } identifiers.put(idName, element); @@ -2052,25 +2090,9 @@ extends ParentNode implements Document { } // removeIdentifier(String) - /** Returns an enumeration registered of identifier names. */ - public Enumeration getIdentifiers() { - - if (needsSyncData()) { - synchronizeData(); - } - - if (identifiers == null) { - identifiers = new Hashtable(); - } - - return identifiers.keys(); - - } // getIdentifiers():Enumeration - // // DOM2: Namespace methods // - /** * Introduced in DOM Level 2. <p> * Creates an element of the given qualified name and namespace URI. @@ -2095,7 +2117,7 @@ extends ParentNode implements Document { * @since WD-DOM-Level-2-19990923 */ public Element createElementNS(String namespaceURI, String qualifiedName) - throws DOMException { + throws DOMException { return new ElementNSImpl(this, namespaceURI, qualifiedName); } @@ -2114,8 +2136,8 @@ extends ParentNode implements Document { * name contains an invalid character. */ public Element createElementNS(String namespaceURI, String qualifiedName, - String localpart) - throws DOMException { + String localpart) + throws DOMException { return new ElementNSImpl(this, namespaceURI, qualifiedName, localpart); } @@ -2138,7 +2160,7 @@ extends ParentNode implements Document { * @since WD-DOM-Level-2-19990923 */ public Attr createAttributeNS(String namespaceURI, String qualifiedName) - throws DOMException { + throws DOMException { return new AttrNSImpl(this, namespaceURI, qualifiedName); } @@ -2158,8 +2180,8 @@ extends ParentNode implements Document { * name contains an invalid character. */ public Attr createAttributeNS(String namespaceURI, String qualifiedName, - String localpart) - throws DOMException { + String localpart) + throws DOMException { return new AttrNSImpl(this, namespaceURI, qualifiedName, localpart); } @@ -2180,7 +2202,7 @@ extends ParentNode implements Document { * @since WD-DOM-Level-2-19990923 */ public NodeList getElementsByTagNameNS(String namespaceURI, - String localName) { + String localName) { return new DeepNodeListImpl(this, namespaceURI, localName); } @@ -2233,11 +2255,11 @@ extends ParentNode implements Document { if (!xml11Version) { validNCName = (prefix == null || XMLChar.isValidNCName(prefix)) - && XMLChar.isValidNCName(local); + && XMLChar.isValidNCName(local); } else { validNCName = (prefix == null || XML11Char.isXML11ValidNCName(prefix)) - && XML11Char.isXML11ValidNCName(local); + && XML11Char.isXML11ValidNCName(local); } return validNCName; @@ -2323,37 +2345,33 @@ extends ParentNode implements Document { * REVISIT: we could use a free list of UserDataRecord here */ public Object setUserData(Node n, String key, - Object data, UserDataHandler handler) { + Object data, UserDataHandler handler) { if (data == null) { - if (userData != null) { - Hashtable t = (Hashtable) userData.get(n); + if (nodeUserData != null) { + Map<String, UserDataRecord> t = nodeUserData.get(n); if (t != null) { - Object o = t.remove(key); - if (o != null) { - UserDataRecord r = (UserDataRecord) o; + UserDataRecord r = t.remove(key); + if (r != null) { return r.fData; } } } return null; - } - else { - Hashtable t; - if (userData == null) { - userData = new Hashtable(); - t = new Hashtable(); - userData.put(n, t); - } - else { - t = (Hashtable) userData.get(n); + } else { + Map<String, UserDataRecord> t; + if (nodeUserData == null) { + nodeUserData = new HashMap<>(); + t = new HashMap<>(); + nodeUserData.put(n, t); + } else { + t = nodeUserData.get(n); if (t == null) { - t = new Hashtable(); - userData.put(n, t); + t = new HashMap<>(); + nodeUserData.put(n, t); } } - Object o = t.put(key, new UserDataRecord(data, handler)); - if (o != null) { - UserDataRecord r = (UserDataRecord) o; + UserDataRecord r = t.put(key, new UserDataRecord(data, handler)); + if (r != null) { return r.fData; } return null; @@ -2372,42 +2390,41 @@ extends ParentNode implements Document { * @since DOM Level 3 */ public Object getUserData(Node n, String key) { - if (userData == null) { + if (nodeUserData == null) { return null; } - Hashtable t = (Hashtable) userData.get(n); + Map<String, UserDataRecord> t = nodeUserData.get(n); if (t == null) { return null; } - Object o = t.get(key); - if (o != null) { - UserDataRecord r = (UserDataRecord) o; + UserDataRecord r = t.get(key); + if (r != null) { return r.fData; } return null; } - protected Hashtable getUserDataRecord(Node n){ - if (userData == null) { + protected Map<String, UserDataRecord> getUserDataRecord(Node n) { + if (nodeUserData == null) { return null; } - Hashtable t = (Hashtable) userData.get(n); + Map<String, UserDataRecord> t = nodeUserData.get(n); if (t == null) { return null; } - return t; - } + return t; + } - /** + /** * Remove user data table for the given node. * @param n The node this operation applies to. * @return The removed table. */ - Hashtable removeUserDataTable(Node n) { - if (userData == null) { + Map<String, UserDataRecord> removeUserDataTable(Node n) { + if (nodeUserData == null) { return null; } - return (Hashtable) userData.get(n); + return nodeUserData.get(n); } /** @@ -2415,11 +2432,13 @@ extends ParentNode implements Document { * @param n The node this operation applies to. * @param data The user data table. */ - void setUserDataTable(Node n, Hashtable data) { - if (userData == null) - userData = new Hashtable(); + void setUserDataTable(Node n, Map<String, UserDataRecord> data) { + if (nodeUserData == null) { + nodeUserData = new HashMap<>(); + } + if (data != null) { - userData.put(n, data); + nodeUserData.put(n, data); } } @@ -2430,41 +2449,39 @@ extends ParentNode implements Document { * @param operation The operation - import, clone, or delete. */ void callUserDataHandlers(Node n, Node c, short operation) { - if (userData == null) { + if (nodeUserData == null) { return; } - //Hashtable t = (Hashtable) userData.get(n); - if(n instanceof NodeImpl){ - Hashtable t = ((NodeImpl)n).getUserDataRecord(); - if (t == null || t.isEmpty()) { - return; - } - callUserDataHandlers(n, c, operation,t); - } + + if (n instanceof NodeImpl) { + Map<String, UserDataRecord> t = ((NodeImpl) n).getUserDataRecord(); + if (t == null || t.isEmpty()) { + return; + } + callUserDataHandlers(n, c, operation, t); + } } - /** + /** * Call user data handlers when a node is deleted (finalized) * @param n The node this operation applies to. * @param c The copy node or null. * @param operation The operation - import, clone, or delete. - * @param handlers Data associated with n. - */ - void callUserDataHandlers(Node n, Node c, short operation,Hashtable userData) { + * @param handlers Data associated with n. + */ + void callUserDataHandlers(Node n, Node c, short operation, Map<String, UserDataRecord> userData) { if (userData == null || userData.isEmpty()) { return; } - Enumeration keys = userData.keys(); - while (keys.hasMoreElements()) { - String key = (String) keys.nextElement(); - UserDataRecord r = (UserDataRecord) userData.get(key); + for (String key : userData.keySet()) { + UserDataRecord r = userData.get(key); if (r.fHandler != null) { r.fHandler.handle(operation, key, r.fData, n, c); } } } - /** + /** * Call user data handlers to let them know the nodes they are related to * are being deleted. The alternative would be to do that on Node but * because the nodes are used as the keys we have a reference to them that @@ -2479,29 +2496,29 @@ extends ParentNode implements Document { // 2. It affects the performance greatly in multi-thread environment. // -SG /*public void finalize() { - if (userData == null) { - return; - } - Enumeration nodes = userData.keys(); - while (nodes.hasMoreElements()) { - Object node = nodes.nextElement(); - Hashtable t = (Hashtable) userData.get(node); - if (t != null && !t.isEmpty()) { - Enumeration keys = t.keys(); - while (keys.hasMoreElements()) { - String key = (String) keys.nextElement(); - UserDataRecord r = (UserDataRecord) t.get(key); - if (r.fHandler != null) { - r.fHandler.handle(UserDataHandler.NODE_DELETED, - key, r.fData, null, null); - } - } - } - } - }*/ + if (userData == null) { + return; + } + Enumeration nodes = userData.keys(); + while (nodes.hasMoreElements()) { + Object node = nodes.nextElement(); + Hashtable t = (Hashtable) userData.get(node); + if (t != null && !t.isEmpty()) { + Enumeration keys = t.keys(); + while (keys.hasMoreElements()) { + String key = (String) keys.nextElement(); + UserDataRecord r = (UserDataRecord) t.get(key); + if (r.fHandler != null) { + r.fHandler.handle(UserDataHandler.NODE_DELETED, + key, r.fData, null, null); + } + } + } + } + }*/ protected final void checkNamespaceWF( String qname, int colon1, - int colon2) { + int colon2) { if (!errorChecking) { return; @@ -2512,42 +2529,42 @@ extends ParentNode implements Document { if (colon1 == 0 || colon1 == qname.length() - 1 || colon2 != colon1) { String msg = DOMMessageFormatter.formatMessage( - DOMMessageFormatter.DOM_DOMAIN, - "NAMESPACE_ERR", - null); + DOMMessageFormatter.DOM_DOMAIN, + "NAMESPACE_ERR", + null); throw new DOMException(DOMException.NAMESPACE_ERR, msg); } } protected final void checkDOMNSErr(String prefix, - String namespace) { + String namespace) { if (errorChecking) { if (namespace == null) { String msg = DOMMessageFormatter.formatMessage( - DOMMessageFormatter.DOM_DOMAIN, - "NAMESPACE_ERR", - null); + DOMMessageFormatter.DOM_DOMAIN, + "NAMESPACE_ERR", + null); throw new DOMException(DOMException.NAMESPACE_ERR, msg); } else if (prefix.equals("xml") - && !namespace.equals(NamespaceContext.XML_URI)) { + && !namespace.equals(NamespaceContext.XML_URI)) { String msg = DOMMessageFormatter.formatMessage( - DOMMessageFormatter.DOM_DOMAIN, - "NAMESPACE_ERR", - null); + DOMMessageFormatter.DOM_DOMAIN, + "NAMESPACE_ERR", + null); throw new DOMException(DOMException.NAMESPACE_ERR, msg); } else if ( prefix.equals("xmlns") - && !namespace.equals(NamespaceContext.XMLNS_URI) - || (!prefix.equals("xmlns") - && namespace.equals(NamespaceContext.XMLNS_URI))) { + && !namespace.equals(NamespaceContext.XMLNS_URI) + || (!prefix.equals("xmlns") + && namespace.equals(NamespaceContext.XMLNS_URI))) { String msg = DOMMessageFormatter.formatMessage( - DOMMessageFormatter.DOM_DOMAIN, - "NAMESPACE_ERR", - null); + DOMMessageFormatter.DOM_DOMAIN, + "NAMESPACE_ERR", + null); throw new DOMException(DOMException.NAMESPACE_ERR, msg); } } @@ -2565,24 +2582,24 @@ extends ParentNode implements Document { return; } - // check that both prefix and local part match NCName + // check that both prefix and local part match NCName boolean validNCName = false; if (!xml11Version) { validNCName = (prefix == null || XMLChar.isValidNCName(prefix)) - && XMLChar.isValidNCName(local); + && XMLChar.isValidNCName(local); } else { validNCName = (prefix == null || XML11Char.isXML11ValidNCName(prefix)) - && XML11Char.isXML11ValidNCName(local); + && XML11Char.isXML11ValidNCName(local); } if (!validNCName) { // REVISIT: add qname parameter to the message String msg = DOMMessageFormatter.formatMessage( - DOMMessageFormatter.DOM_DOMAIN, - "INVALID_CHARACTER_ERR", - null); + DOMMessageFormatter.DOM_DOMAIN, + "INVALID_CHARACTER_ERR", + null); throw new DOMException(DOMException.INVALID_CHARACTER_ERR, msg); } } @@ -2629,14 +2646,14 @@ extends ParentNode implements Document { // Event related methods overidden in subclass protected void addEventListener(NodeImpl node, String type, - EventListener listener, - boolean useCapture) { + EventListener listener, + boolean useCapture) { // does nothing by default - overidden in subclass } protected void removeEventListener(NodeImpl node, String type, - EventListener listener, - boolean useCapture) { + EventListener listener, + boolean useCapture) { // does nothing by default - overidden in subclass } @@ -2763,4 +2780,91 @@ extends ParentNode implements Document { void renamedElement(Element oldEl, Element newEl) { } + /** + * @serialData Serialized fields. Convert Maps to Hashtables for backward + * compatibility. + */ + private void writeObject(ObjectOutputStream out) throws IOException { + // Convert Maps to Hashtables + Hashtable<Node, Hashtable<String, UserDataRecord>> nud = null; + if (nodeUserData != null) { + nud = new Hashtable<>(); + for (Map.Entry<Node, Map<String, UserDataRecord>> e : nodeUserData.entrySet()) { + //e.getValue() will not be null since an entry is always put with a non-null value + nud.put(e.getKey(), new Hashtable<>(e.getValue())); + } + } + + Hashtable<String, Node> ids = (identifiers == null)? null : new Hashtable<>(identifiers); + Hashtable<Node, Integer> nt = (nodeTable == null)? null : new Hashtable<>(nodeTable); + + // Write serialized fields + ObjectOutputStream.PutField pf = out.putFields(); + pf.put("docType", docType); + pf.put("docElement", docElement); + pf.put("fFreeNLCache", fFreeNLCache); + pf.put("encoding", encoding); + pf.put("actualEncoding", actualEncoding); + pf.put("version", version); + pf.put("standalone", standalone); + pf.put("fDocumentURI", fDocumentURI); + + //userData is the original name. It has been changed to nodeUserData, refer to the corrsponding @serialField + pf.put("userData", nud); + pf.put("identifiers", ids); + pf.put("changes", changes); + pf.put("allowGrammarAccess", allowGrammarAccess); + pf.put("errorChecking", errorChecking); + pf.put("ancestorChecking", ancestorChecking); + pf.put("xmlVersionChanged", xmlVersionChanged); + pf.put("documentNumber", documentNumber); + pf.put("nodeCounter", nodeCounter); + pf.put("nodeTable", nt); + pf.put("xml11Version", xml11Version); + out.writeFields(); + } + + @SuppressWarnings("unchecked") + private void readObject(ObjectInputStream in) + throws IOException, ClassNotFoundException { + // We have to read serialized fields first. + ObjectInputStream.GetField gf = in.readFields(); + docType = (DocumentTypeImpl)gf.get("docType", null); + docElement = (ElementImpl)gf.get("docElement", null); + fFreeNLCache = (NodeListCache)gf.get("fFreeNLCache", null); + encoding = (String)gf.get("encoding", null); + actualEncoding = (String)gf.get("actualEncoding", null); + version = (String)gf.get("version", null); + standalone = gf.get("standalone", false); + fDocumentURI = (String)gf.get("fDocumentURI", null); + + //userData is the original name. It has been changed to nodeUserData, refer to the corrsponding @serialField + Hashtable<Node, Hashtable<String, UserDataRecord>> nud = + (Hashtable<Node, Hashtable<String, UserDataRecord>>)gf.get("userData", null); + + Hashtable<String, Node> ids = (Hashtable<String, Node>)gf.get("identifiers", null); + + changes = gf.get("changes", 0); + allowGrammarAccess = gf.get("allowGrammarAccess", false); + errorChecking = gf.get("errorChecking", true); + ancestorChecking = gf.get("ancestorChecking", true); + xmlVersionChanged = gf.get("xmlVersionChanged", false); + documentNumber = gf.get("documentNumber", 0); + nodeCounter = gf.get("nodeCounter", 0); + + Hashtable<Node, Integer> nt = (Hashtable<Node, Integer>)gf.get("nodeTable", null); + + xml11Version = gf.get("xml11Version", false); + + //convert Hashtables back to HashMaps + if (nud != null) { + nodeUserData = new HashMap<>(); + for (Map.Entry<Node, Hashtable<String, UserDataRecord>> e : nud.entrySet()) { + nodeUserData.put(e.getKey(), new HashMap<>(e.getValue())); + } + } + + if (ids != null) identifiers = new HashMap<>(ids); + if (nt != null) nodeTable = new HashMap<>(nt); + } } // class CoreDocumentImpl diff --git a/src/com/sun/org/apache/xerces/internal/dom/DeferredDocumentImpl.java b/src/com/sun/org/apache/xerces/internal/dom/DeferredDocumentImpl.java index 92c03b0..1486086 100644 --- a/src/com/sun/org/apache/xerces/internal/dom/DeferredDocumentImpl.java +++ b/src/com/sun/org/apache/xerces/internal/dom/DeferredDocumentImpl.java @@ -1,13 +1,13 @@ /* - * reserved comment block - * DO NOT REMOVE OR ALTER! + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. */ /* - * Copyright 1999-2002,2004,2005 The Apache Software Foundation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * @@ -21,7 +21,7 @@ package com.sun.org.apache.xerces.internal.dom; import java.util.ArrayList; - +import java.util.HashMap; import org.w3c.dom.DOMImplementation; import org.w3c.dom.Element; import org.w3c.dom.Node; @@ -2057,9 +2057,9 @@ public class DeferredDocumentImpl element+')'); } - // create hashtable + // create Map if (identifiers == null) { - identifiers = new java.util.Hashtable(); + identifiers = new HashMap<>(); } // save ID and its associated element diff --git a/src/com/sun/org/apache/xerces/internal/dom/DocumentImpl.java b/src/com/sun/org/apache/xerces/internal/dom/DocumentImpl.java index 4cc0648..a5fe4b8 100644 --- a/src/com/sun/org/apache/xerces/internal/dom/DocumentImpl.java +++ b/src/com/sun/org/apache/xerces/internal/dom/DocumentImpl.java @@ -1,13 +1,13 @@ /* - * reserved comment block - * DO NOT REMOVE OR ALTER! + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. */ /* - * Copyright 2001,2002,2004,2005 The Apache Software Foundation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * @@ -20,13 +20,19 @@ package com.sun.org.apache.xerces.internal.dom; +import com.sun.org.apache.xerces.internal.dom.events.EventImpl; +import com.sun.org.apache.xerces.internal.dom.events.MutationEventImpl; +import java.io.IOException; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; +import java.io.ObjectStreamField; import java.io.Serializable; +import java.util.ArrayList; +import java.util.HashMap; import java.util.Hashtable; +import java.util.List; +import java.util.Map; import java.util.Vector; - -import com.sun.org.apache.xerces.internal.dom.events.EventImpl; -import com.sun.org.apache.xerces.internal.dom.events.MutationEventImpl; -import org.w3c.dom.UserDataHandler; import org.w3c.dom.Attr; import org.w3c.dom.DOMException; import org.w3c.dom.DOMImplementation; @@ -34,6 +40,7 @@ import org.w3c.dom.DocumentType; import org.w3c.dom.Element; import org.w3c.dom.NamedNodeMap; import org.w3c.dom.Node; +import org.w3c.dom.UserDataHandler; import org.w3c.dom.events.DocumentEvent; import org.w3c.dom.events.Event; import org.w3c.dom.events.EventException; @@ -96,18 +103,33 @@ public class DocumentImpl /** Iterators */ // REVISIT: Should this be transient? -Ac - protected Vector iterators; + protected List<NodeIterator> iterators; /** Ranges */ // REVISIT: Should this be transient? -Ac - protected Vector ranges; + protected List<Range> ranges; /** Table for event listeners registered to this document nodes. */ - protected Hashtable eventListeners; + protected Map<NodeImpl, List<LEntry>> eventListeners; /** Bypass mutation events firing. */ protected boolean mutationEvents = false; + + /** + * @serialField iterators Vector Node iterators + * @serialField ranges Vector ranges + * @serialField eventListeners Hashtable Event listeners + * @serialField mutationEvents boolean Bypass mutation events firing + */ + private static final ObjectStreamField[] serialPersistentFields = + new ObjectStreamField[] { + new ObjectStreamField("iterators", Vector.class), + new ObjectStreamField("ranges", Vector.class), + new ObjectStreamField("eventListeners", Hashtable.class), + new ObjectStreamField("mutationEvents", boolean.class), + }; + // // Constructors // @@ -227,10 +249,10 @@ public class DocumentImpl filter, entityReferenceExpansion); if (iterators == null) { - iterators = new Vector(); + iterators = new ArrayList<>(); } - iterators.addElement(iterator); + iterators.add(iterator); return iterator; } @@ -287,7 +309,7 @@ public class DocumentImpl if (nodeIterator == null) return; if (iterators == null) return; - iterators.removeElement(nodeIterator); + iterators.remove(nodeIterator); } // @@ -298,12 +320,11 @@ public class DocumentImpl public Range createRange() { if (ranges == null) { - ranges = new Vector(); + ranges = new ArrayList<>(); } Range range = new RangeImpl(this); - - ranges.addElement(range); + ranges.add(range); return range; @@ -318,7 +339,7 @@ public class DocumentImpl if (range == null) return; if (ranges == null) return; - ranges.removeElement(range); + ranges.remove(range); } /** @@ -330,7 +351,7 @@ public class DocumentImpl if (ranges != null) { int size = ranges.size(); for (int i = 0; i != size; i++) { - ((RangeImpl)ranges.elementAt(i)).receiveReplacedText(node); + ((RangeImpl)ranges.get(i)).receiveReplacedText(node); } } } @@ -344,7 +365,7 @@ public class DocumentImpl if (ranges != null) { int size = ranges.size(); for (int i = 0; i != size; i++) { - ((RangeImpl)ranges.elementAt(i)).receiveDeletedText(node, + ((RangeImpl)ranges.get(i)).receiveDeletedText(node, offset, count); } } @@ -359,7 +380,7 @@ public class DocumentImpl if (ranges != null) { int size = ranges.size(); for (int i = 0; i != size; i++) { - ((RangeImpl)ranges.elementAt(i)).receiveInsertedText(node, + ((RangeImpl)ranges.get(i)).receiveInsertedText(node, offset, count); } } @@ -374,7 +395,7 @@ public class DocumentImpl if (ranges != null) { int size = ranges.size(); for (int i = 0; i != size; i++) { - ((RangeImpl)ranges.elementAt(i)).receiveSplitData(node, + ((RangeImpl)ranges.get(i)).receiveSplitData(node, newNode, offset); } } @@ -437,9 +458,9 @@ public class DocumentImpl * node here won't be GC'ed as long as some listener is registered on it, * since the eventsListeners table will have a reference to the node. */ - protected void setEventListeners(NodeImpl n, Vector listeners) { + private void setEventListeners(NodeImpl n, List<LEntry> listeners) { if (eventListeners == null) { - eventListeners = new Hashtable(); + eventListeners = new HashMap<>(); } if (listeners == null) { eventListeners.remove(n); @@ -457,11 +478,11 @@ public class DocumentImpl /** * Retreive event listener registered on a given node */ - protected Vector getEventListeners(NodeImpl n) { + private List<LEntry> getEventListeners(NodeImpl n) { if (eventListeners == null) { return null; } - return (Vector) eventListeners.get(n); + return eventListeners.get(n); } // @@ -515,6 +536,7 @@ public class DocumentImpl * @param useCapture True iff listener is registered on * capturing phase rather than at-target or bubbling */ + @Override protected void addEventListener(NodeImpl node, String type, EventListener listener, boolean useCapture) { @@ -527,12 +549,12 @@ public class DocumentImpl // Simplest way to code that is to zap the previous entry, if any. removeEventListener(node, type, listener, useCapture); - Vector nodeListeners = getEventListeners(node); + List<LEntry> nodeListeners = getEventListeners(node); if(nodeListeners == null) { - nodeListeners = new Vector(); + nodeListeners = new ArrayList<>(); setEventListeners(node, nodeListeners); } - nodeListeners.addElement(new LEntry(type, listener, useCapture)); + nodeListeners.add(new LEntry(type, listener, useCapture)); // Record active listener LCount lc = LCount.lookup(type); @@ -558,6 +580,7 @@ public class DocumentImpl * @param useCapture True iff listener is registered on * capturing phase rather than at-target or bubbling */ + @Override protected void removeEventListener(NodeImpl node, String type, EventListener listener, boolean useCapture) @@ -565,7 +588,7 @@ public class DocumentImpl // If this couldn't be a valid listener registration, ignore request if (type == null || type.equals("") || listener == null) return; - Vector nodeListeners = getEventListeners(node); + List<LEntry> nodeListeners = getEventListeners(node); if (nodeListeners == null) return; @@ -573,12 +596,12 @@ public class DocumentImpl // each listener may be registered only once per type per phase. // count-down is OK for deletions! for (int i = nodeListeners.size() - 1; i >= 0; --i) { - LEntry le = (LEntry) nodeListeners.elementAt(i); + LEntry le = nodeListeners.get(i); if (le.useCapture == useCapture && le.listener == listener && le.type.equals(type)) { - nodeListeners.removeElementAt(i); + nodeListeners.remove(i); // Storage management: Discard empty listener lists - if (nodeListeners.size() == 0) + if (nodeListeners.isEmpty()) setEventListeners(node, null); // Remove active listener @@ -597,12 +620,13 @@ public class DocumentImpl } } // removeEventListener(NodeImpl,String,EventListener,boolean) :void + @Override protected void copyEventListeners(NodeImpl src, NodeImpl tgt) { - Vector nodeListeners = getEventListeners(src); + List<LEntry> nodeListeners = getEventListeners(src); if (nodeListeners == null) { return; } - setEventListeners(tgt, (Vector) nodeListeners.clone()); + setEventListeners(tgt, new ArrayList<>(nodeListeners)); } /** @@ -655,6 +679,7 @@ public class DocumentImpl * @return true if the event's <code>preventDefault()</code> * method was invoked by an EventListener; otherwise false. */ + @Override protected boolean dispatchEvent(NodeImpl node, Event event) { if (event == null) return false; @@ -691,11 +716,11 @@ public class DocumentImpl // is issued to the Element rather than the Attr // and causes a _second_ DOMSubtreeModified in the Element's // tree. - Vector pv = new Vector(10,10); + List<Node> pv = new ArrayList<>(10); Node p = node; Node n = p.getParentNode(); while (n != null) { - pv.addElement(n); + pv.add(n); p = n; n = n.getParentNode(); } @@ -710,15 +735,15 @@ public class DocumentImpl break; // Someone set the flag. Phase ends. // Handle all capturing listeners on this node - NodeImpl nn = (NodeImpl) pv.elementAt(j); + NodeImpl nn = (NodeImpl) pv.get(j); evt.currentTarget = nn; - Vector nodeListeners = getEventListeners(nn); + List<LEntry> nodeListeners = getEventListeners(nn); if (nodeListeners != null) { - Vector nl = (Vector) nodeListeners.clone(); + List<LEntry> nl = (List)((ArrayList)nodeListeners).clone(); // call listeners in the order in which they got registered int nlsize = nl.size(); for (int i = 0; i < nlsize; i++) { - LEntry le = (LEntry) nl.elementAt(i); + LEntry le = nl.get(i); if (le.useCapture && le.type.equals(evt.type) && nodeListeners.contains(le)) { try { @@ -741,13 +766,13 @@ public class DocumentImpl // node are _not_ invoked, even during the capture phase. evt.eventPhase = Event.AT_TARGET; evt.currentTarget = node; - Vector nodeListeners = getEventListeners(node); + List<LEntry> nodeListeners = getEventListeners(node); if (!evt.stopPropagation && nodeListeners != null) { - Vector nl = (Vector) nodeListeners.clone(); + List<LEntry> nl = (List)((ArrayList)nodeListeners).clone(); // call listeners in the order in which they got registered int nlsize = nl.size(); for (int i = 0; i < nlsize; i++) { - LEntry le = (LEntry) nl.elementAt(i); + LEntry le = (LEntry) nl.get(i); if (!le.useCapture && le.type.equals(evt.type) && nodeListeners.contains(le)) { try { @@ -772,16 +797,16 @@ public class DocumentImpl break; // Someone set the flag. Phase ends. // Handle all bubbling listeners on this node - NodeImpl nn = (NodeImpl) pv.elementAt(j); + NodeImpl nn = (NodeImpl) pv.get(j); evt.currentTarget = nn; nodeListeners = getEventListeners(nn); if (nodeListeners != null) { - Vector nl = (Vector) nodeListeners.clone(); + List<LEntry> nl = (List)((ArrayList)nodeListeners).clone(); // call listeners in the order in which they got // registered int nlsize = nl.size(); for (int i = 0; i < nlsize; i++) { - LEntry le = (LEntry) nl.elementAt(i); + LEntry le = nl.get(i); if (!le.useCapture && le.type.equals(evt.type) && nodeListeners.contains(le)) { try { @@ -1118,7 +1143,7 @@ public class DocumentImpl if (ranges != null) { int size = ranges.size(); for (int i = 0; i != size; i++) { - ((RangeImpl)ranges.elementAt(i)).insertedNodeFromDOM(newInternal); + ((RangeImpl)ranges.get(i)).insertedNodeFromDOM(newInternal); } } } @@ -1132,7 +1157,7 @@ public class DocumentImpl if (iterators != null) { int size = iterators.size(); for (int i = 0; i != size; i++) { - ((NodeIteratorImpl)iterators.elementAt(i)).removeNode(oldChild); + ((NodeIteratorImpl)iterators.get(i)).removeNode(oldChild); } } @@ -1140,7 +1165,7 @@ public class DocumentImpl if (ranges != null) { int size = ranges.size(); for (int i = 0; i != size; i++) { - ((RangeImpl)ranges.elementAt(i)).removeNode(oldChild); + ((RangeImpl)ranges.get(i)).removeNode(oldChild); } } @@ -1302,4 +1327,53 @@ public class DocumentImpl // REVISIT: To be implemented!!! } + + /** + * @serialData Serialized fields. Convert Maps to Hashtables and Lists + * to Vectors for backward compatibility. + */ + private void writeObject(ObjectOutputStream out) throws IOException { + // Convert Maps to Hashtables, Lists to Vectors + Vector<NodeIterator> it = (iterators == null)? null : new Vector<>(iterators); + Vector<Range> r = (ranges == null)? null : new Vector<>(ranges); + + Hashtable<NodeImpl, Vector<LEntry>> el = null; + if (eventListeners != null) { + el = new Hashtable<>(); + for (Map.Entry<NodeImpl, List<LEntry>> e : eventListeners.entrySet()) { + el.put(e.getKey(), new Vector<>(e.getValue())); + } + } + + // Write serialized fields + ObjectOutputStream.PutField pf = out.putFields(); + pf.put("iterators", it); + pf.put("ranges", r); + pf.put("eventListeners", el); + pf.put("mutationEvents", mutationEvents); + out.writeFields(); + } + + @SuppressWarnings("unchecked") + private void readObject(ObjectInputStream in) + throws IOException, ClassNotFoundException { + // We have to read serialized fields first. + ObjectInputStream.GetField gf = in.readFields(); + Vector<NodeIterator> it = (Vector<NodeIterator>)gf.get("iterators", null); + Vector<Range> r = (Vector<Range>)gf.get("ranges", null); + Hashtable<NodeImpl, Vector<LEntry>> el = + (Hashtable<NodeImpl, Vector<LEntry>>)gf.get("eventListeners", null); + + mutationEvents = gf.get("mutationEvents", false); + + //convert Hashtables back to HashMaps and Vectors to Lists + if (it != null) iterators = new ArrayList<>(it); + if (r != null) ranges = new ArrayList<>(r); + if (el != null) { + eventListeners = new HashMap<>(); + for (Map.Entry<NodeImpl, Vector<LEntry>> e : el.entrySet()) { + eventListeners.put(e.getKey(), new ArrayList<>(e.getValue())); + } + } + } } // class DocumentImpl diff --git a/src/com/sun/org/apache/xerces/internal/dom/DocumentTypeImpl.java b/src/com/sun/org/apache/xerces/internal/dom/DocumentTypeImpl.java index 7615fc1..6bec51b 100644 --- a/src/com/sun/org/apache/xerces/internal/dom/DocumentTypeImpl.java +++ b/src/com/sun/org/apache/xerces/internal/dom/DocumentTypeImpl.java @@ -1,13 +1,13 @@ /* - * reserved comment block - * DO NOT REMOVE OR ALTER! + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. */ /* - * Copyright 1999-2002,2004 The Apache Software Foundation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * @@ -20,11 +20,17 @@ package com.sun.org.apache.xerces.internal.dom; +import java.io.IOException; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; +import java.io.ObjectStreamField; +import java.util.HashMap; +import java.util.Hashtable; +import java.util.Map; import org.w3c.dom.DOMException; import org.w3c.dom.DocumentType; -import org.w3c.dom.Node; import org.w3c.dom.NamedNodeMap; -import java.util.Hashtable; +import org.w3c.dom.Node; import org.w3c.dom.UserDataHandler; /** @@ -95,10 +101,37 @@ public class DocumentTypeImpl // a number, on demand, for ordering purposes for compareDocumentPosition private int doctypeNumber=0; + private Map<String, UserDataRecord> userData = null; + + + /** + * @serialField name String document type name + * @serialField entities NamedNodeMapImpl entities + * @serialField notations NamedNodeMapImpl notations + * @serialField elements NamedNodeMapImpl elements + * @serialField publicID String support public ID + * @serialField systemID String support system ID + * @serialField internalSubset String support internal subset + * @serialField doctypeNumber int Doctype number + * @serialField userData Hashtable user data + */ + private static final ObjectStreamField[] serialPersistentFields = + new ObjectStreamField[] { + new ObjectStreamField("name", String.class), + new ObjectStreamField("entities", NamedNodeMapImpl.class), + new ObjectStreamField("notations", NamedNodeMapImpl.class), + new ObjectStreamField("elements", NamedNodeMapImpl.class), + new ObjectStreamField("publicID", String.class), + new ObjectStreamField("systemID", String.class), + new ObjectStreamField("internalSubset", String.class), + new ObjectStreamField("doctypeNumber", int.class), + new ObjectStreamField("userData", Hashtable.class), + }; + // // Constructors // - private Hashtable userData = null; + /** Factory method for creating a document type node. */ public DocumentTypeImpl(CoreDocumentImpl ownerDocument, String name) { super(ownerDocument); @@ -445,22 +478,20 @@ public class DocumentTypeImpl public Object setUserData(String key, Object data, UserDataHandler handler) { if(userData == null) - userData = new Hashtable(); + userData = new HashMap<>(); if (data == null) { if (userData != null) { - Object o = userData.remove(key); - if (o != null) { - UserDataRecord r = (UserDataRecord) o; - return r.fData; + UserDataRecord udr = userData.remove(key); + if (udr != null) { + return udr.fData; } } return null; } else { - Object o = userData.put(key, new UserDataRecord(data, handler)); - if (o != null) { - UserDataRecord r = (UserDataRecord) o; - return r.fData; + UserDataRecord udr = userData.put(key, new UserDataRecord(data, handler)); + if (udr != null) { + return udr.fData; } } return null; @@ -470,16 +501,58 @@ public class DocumentTypeImpl if (userData == null) { return null; } - Object o = userData.get(key); - if (o != null) { - UserDataRecord r = (UserDataRecord) o; - return r.fData; + UserDataRecord udr = userData.get(key); + if (udr != null) { + return udr.fData; } return null; } - protected Hashtable getUserDataRecord(){ + @Override + protected Map<String, UserDataRecord> getUserDataRecord(){ return userData; } + /** + * @serialData Serialized fields. Convert Map to Hashtable for backward + * compatibility. + */ + private void writeObject(ObjectOutputStream out) throws IOException { + // Convert the HashMap to Hashtable + Hashtable<String, UserDataRecord> ud = (userData == null)? null : new Hashtable<>(userData); + + // Write serialized fields + ObjectOutputStream.PutField pf = out.putFields(); + pf.put("name", name); + pf.put("entities", entities); + pf.put("notations", notations); + pf.put("elements", elements); + pf.put("publicID", publicID); + pf.put("systemID", systemID); + pf.put("internalSubset", internalSubset); + pf.put("doctypeNumber", doctypeNumber); + pf.put("userData", ud); + out.writeFields(); + } + + @SuppressWarnings("unchecked") + private void readObject(ObjectInputStream in) + throws IOException, ClassNotFoundException { + // We have to read serialized fields first. + ObjectInputStream.GetField gf = in.readFields(); + name = (String)gf.get("name", null); + entities = (NamedNodeMapImpl)gf.get("entities", null); + notations = (NamedNodeMapImpl)gf.get("notations", null); + elements = (NamedNodeMapImpl)gf.get("elements", null); + publicID = (String)gf.get("publicID", null); + systemID = (String)gf.get("systemID", null); + internalSubset = (String)gf.get("internalSubset", null); + doctypeNumber = gf.get("doctypeNumber", 0); + + Hashtable<String, UserDataRecord> ud = + (Hashtable<String, UserDataRecord>)gf.get("userData", null); + + //convert the Hashtable back to HashMap + if (ud != null) userData = new HashMap<>(ud); + } } // class DocumentTypeImpl diff --git a/src/com/sun/org/apache/xerces/internal/dom/LCount.java b/src/com/sun/org/apache/xerces/internal/dom/LCount.java index 91ec8d5..77545bd 100644 --- a/src/com/sun/org/apache/xerces/internal/dom/LCount.java +++ b/src/com/sun/org/apache/xerces/internal/dom/LCount.java @@ -1,13 +1,13 @@ /* - * reserved comment block - * DO NOT REMOVE OR ALTER! + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. */ /* - * Copyright 1999-2002,2004 The Apache Software Foundation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * @@ -22,20 +22,13 @@ package com.sun.org.apache.xerces.internal.dom; /** Internal class LCount is used to track the number of listeners registered for a given event name, as an entry - in a global hashtable. This should allow us to avoid generating, - or discard, events for which no listeners are registered. + in a global Map. This should allow us to avoid generating, + or discarding, events for which no listeners are registered. ***** There should undoubtedly be methods here to manipulate this table. At the moment that code's residing in NodeImpl. Move it when we have a chance to do so. Sorry; we were rushed. - - ???? CONCERN: Hashtables are known to be "overserialized" in - current versions of Java. That may impact performance. - - ???? CONCERN: The hashtable should probably be a per-document object. - Finer granularity would be even better, but would cost more cycles to - resolve and might not save enough event traffic to be worth the investment. */ /** * @xerces.internal @@ -44,7 +37,7 @@ package com.sun.org.apache.xerces.internal.dom; class LCount { - static java.util.Hashtable lCounts=new java.util.Hashtable(); + static final java.util.Map<String, LCount> lCounts=new java.util.concurrent.ConcurrentHashMap<>(); public int captures=0,bubbles=0,defaults, total=0; static LCount lookup(String evtName) diff --git a/src/com/sun/org/apache/xerces/internal/dom/NodeImpl.java b/src/com/sun/org/apache/xerces/internal/dom/NodeImpl.java index b273a1c..529f533 100644 --- a/src/com/sun/org/apache/xerces/internal/dom/NodeImpl.java +++ b/src/com/sun/org/apache/xerces/internal/dom/NodeImpl.java @@ -1,13 +1,13 @@ /* - * reserved comment block - * DO NOT REMOVE OR ALTER! + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. */ /* - * Copyright 1999-2002,2004 The Apache Software Foundation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * @@ -23,15 +23,14 @@ package com.sun.org.apache.xerces.internal.dom; import java.io.IOException; import java.io.ObjectOutputStream; import java.io.Serializable; -import java.util.Hashtable; - -import org.w3c.dom.UserDataHandler; +import java.util.Map; import org.w3c.dom.DOMException; import org.w3c.dom.Document; import org.w3c.dom.DocumentType; import org.w3c.dom.NamedNodeMap; import org.w3c.dom.Node; import org.w3c.dom.NodeList; +import org.w3c.dom.UserDataHandler; import org.w3c.dom.events.Event; import org.w3c.dom.events.EventListener; import org.w3c.dom.events.EventTarget; @@ -1793,7 +1792,7 @@ public abstract class NodeImpl return ownerDocument().getUserData(this, key); } - protected Hashtable getUserDataRecord(){ + protected Map<String, ParentNode.UserDataRecord> getUserDataRecord(){ return ownerDocument().getUserDataRecord(this); } @@ -1845,7 +1844,7 @@ public abstract class NodeImpl * NON-DOM: As an alternative to subclassing the DOM, this implementation * has been extended with the ability to attach an object to each node. * (If you need multiple objects, you can attach a collection such as a - * vector or hashtable, then attach your application information to that.) + * List or Map, then attach your application information to that.) * <p><b>Important Note:</b> You are responsible for removing references * to your data on nodes that are no longer used. Failure to do so will * prevent the nodes, your data is attached to, to be garbage collected diff --git a/src/com/sun/org/apache/xerces/internal/dom/ParentNode.java b/src/com/sun/org/apache/xerces/internal/dom/ParentNode.java index 7725c4c..2e1997e 100644 --- a/src/com/sun/org/apache/xerces/internal/dom/ParentNode.java +++ b/src/com/sun/org/apache/xerces/internal/dom/ParentNode.java @@ -1,13 +1,13 @@ /* - * reserved comment block - * DO NOT REMOVE OR ALTER! + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. */ /* - * Copyright 1999-2002,2004,2005 The Apache Software Foundation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * @@ -20,10 +20,10 @@ package com.sun.org.apache.xerces.internal.dom; -import java.io.Serializable; import java.io.IOException; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; +import java.io.Serializable; import org.w3c.dom.DOMException; import org.w3c.dom.Document; @@ -1023,7 +1023,7 @@ public abstract class ParentNode /* * a class to store some user data along with its handler */ - class UserDataRecord implements Serializable { + protected class UserDataRecord implements Serializable { /** Serialization version. */ private static final long serialVersionUID = 3258126977134310455L; diff --git a/src/com/sun/org/apache/xerces/internal/impl/XML11DocumentScannerImpl.java b/src/com/sun/org/apache/xerces/internal/impl/XML11DocumentScannerImpl.java index dda470a..5276454 100644 --- a/src/com/sun/org/apache/xerces/internal/impl/XML11DocumentScannerImpl.java +++ b/src/com/sun/org/apache/xerces/internal/impl/XML11DocumentScannerImpl.java @@ -332,7 +332,7 @@ public class XML11DocumentScannerImpl new Object[]{entityName}); } } - fEntityManager.startEntity(entityName, true); + fEntityManager.startEntity(true, entityName, true); } } } diff --git a/src/com/sun/org/apache/xerces/internal/impl/XML11EntityScanner.java b/src/com/sun/org/apache/xerces/internal/impl/XML11EntityScanner.java index c293551..028f6a7 100644 --- a/src/com/sun/org/apache/xerces/internal/impl/XML11EntityScanner.java +++ b/src/com/sun/org/apache/xerces/internal/impl/XML11EntityScanner.java @@ -1,62 +1,21 @@ /* - * reserved comment block - * DO NOT REMOVE OR ALTER! + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. */ + /* - * The Apache Software License, Version 1.1 - * - * - * Copyright (c) 1999-2002 The Apache Software Foundation. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. + * Copyright 2005 The Apache Software Foundation. * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. + * http://www.apache.org/licenses/LICENSE-2.0 * - * 4. The names "Xerces" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation and was - * originally based on software copyright (c) 1999, International - * Business Machines, Inc., http://www.apache.org. For more - * information on the Apache Software Foundation, please see - * <http://www.apache.org/>. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package com.sun.org.apache.xerces.internal.impl; @@ -65,6 +24,8 @@ import com.sun.org.apache.xerces.internal.impl.msg.XMLMessageFormatter; import com.sun.org.apache.xerces.internal.util.XML11Char; import com.sun.org.apache.xerces.internal.util.XMLChar; import com.sun.org.apache.xerces.internal.util.XMLStringBuffer; +import com.sun.org.apache.xerces.internal.utils.XMLSecurityManager; +import com.sun.org.apache.xerces.internal.utils.XMLSecurityManager.Limit; import com.sun.org.apache.xerces.internal.xni.QName; import com.sun.org.apache.xerces.internal.xni.XMLString; import java.io.IOException; @@ -690,9 +651,13 @@ public class XML11EntityScanner break; } index = fCurrentEntity.position; + //check prefix before further read + checkLimit(Limit.MAX_NAME_LIMIT, fCurrentEntity, offset, index - offset); } if (++fCurrentEntity.position == fCurrentEntity.count) { int length = fCurrentEntity.position - offset; + //check localpart before loading more data + checkLimit(Limit.MAX_NAME_LIMIT, fCurrentEntity, offset, length - index - 1); invokeListeners(length); if (length == fCurrentEntity.ch.length) { // bad luck we have to resize our buffer @@ -786,6 +751,8 @@ public class XML11EntityScanner offset, length); if (index != -1) { int prefixLength = index - offset; + //check the result: prefix + checkLimit(Limit.MAX_NAME_LIMIT, fCurrentEntity, offset, prefixLength); prefix = fSymbolTable.addSymbol(fCurrentEntity.ch, offset, prefixLength); int len = length - prefixLength - 1; @@ -798,12 +765,16 @@ public class XML11EntityScanner null, XMLErrorReporter.SEVERITY_FATAL_ERROR); } + //check the result: localpart + checkLimit(Limit.MAX_NAME_LIMIT, fCurrentEntity, index + 1, len); localpart = fSymbolTable.addSymbol(fCurrentEntity.ch, index + 1, len); } else { localpart = rawname; + //check the result: localpart + checkLimit(Limit.MAX_NAME_LIMIT, fCurrentEntity, offset, length); } qname.setValues(prefix, localpart, rawname, null); return true; @@ -934,6 +905,9 @@ public class XML11EntityScanner } int length = fCurrentEntity.position - offset; fCurrentEntity.columnNumber += length - newlines; + if (fCurrentEntity.isGE) { + checkLimit(Limit.TOTAL_ENTITY_SIZE_LIMIT, fCurrentEntity, offset, length); + } content.setValues(fCurrentEntity.ch, offset, length); // return next character @@ -1078,6 +1052,9 @@ public class XML11EntityScanner } int length = fCurrentEntity.position - offset; fCurrentEntity.columnNumber += length - newlines; + if (fCurrentEntity.isGE) { + checkLimit(Limit.TOTAL_ENTITY_SIZE_LIMIT, fCurrentEntity, offset, length); + } content.setValues(fCurrentEntity.ch, offset, length); // return next character diff --git a/src/com/sun/org/apache/xerces/internal/impl/XML11NSDocumentScannerImpl.java b/src/com/sun/org/apache/xerces/internal/impl/XML11NSDocumentScannerImpl.java index 7a826df..a3dd4d1 100644 --- a/src/com/sun/org/apache/xerces/internal/impl/XML11NSDocumentScannerImpl.java +++ b/src/com/sun/org/apache/xerces/internal/impl/XML11NSDocumentScannerImpl.java @@ -1,62 +1,21 @@ /* - * reserved comment block - * DO NOT REMOVE OR ALTER! + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. */ + /* - * The Apache Software License, Version 1.1 - * - * - * Copyright (c) 1999-2003 The Apache Software Foundation. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. + * Copyright 2005 The Apache Software Foundation. * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. + * http://www.apache.org/licenses/LICENSE-2.0 * - * 4. The names "Xerces" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation and was - * originally based on software copyright (c) 2002, International - * Business Machines, Inc., http://www.apache.org. For more - * information on the Apache Software Foundation, please see - * <http://www.apache.org/>. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package com.sun.org.apache.xerces.internal.impl; @@ -67,6 +26,7 @@ import com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidatorFilter; import com.sun.org.apache.xerces.internal.impl.msg.XMLMessageFormatter; import com.sun.org.apache.xerces.internal.util.XMLAttributesImpl; import com.sun.org.apache.xerces.internal.util.XMLSymbols; +import com.sun.org.apache.xerces.internal.utils.XMLSecurityManager; import com.sun.org.apache.xerces.internal.xni.NamespaceContext; import com.sun.org.apache.xerces.internal.xni.QName; import com.sun.org.apache.xerces.internal.xni.XMLDocumentHandler; @@ -340,36 +300,37 @@ public class XML11NSDocumentScannerImpl extends XML11DocumentScannerImpl { } // call handler + if (empty) { + //decrease the markup depth.. + fMarkupDepth--; - if (empty) { - - //decrease the markup depth.. - fMarkupDepth--; - - // check that this element was opened in the same entity - if (fMarkupDepth < fEntityStack[fEntityDepth - 1]) { - reportFatalError( - "ElementEntityMismatch", - new Object[] { fCurrentElement.rawname }); - } + // check that this element was opened in the same entity + if (fMarkupDepth < fEntityStack[fEntityDepth - 1]) { + reportFatalError( + "ElementEntityMismatch", + new Object[] { fCurrentElement.rawname }); + } + if (fDocumentHandler != null) { fDocumentHandler.emptyElement(fElementQName, fAttributes, null); + } - /*if (fBindNamespaces) { - fNamespaceContext.popContext(); - }*/ - fScanEndElement = true; - - //pop the element off the stack.. - fElementStack.popElement(); - } else { + /*if (fBindNamespaces) { + fNamespaceContext.popContext(); + }*/ + fScanEndElement = true; - if(dtdGrammarUtil != null) - dtdGrammarUtil.startElement(fElementQName, fAttributes); + //pop the element off the stack.. + fElementStack.popElement(); + } else { + if(dtdGrammarUtil != null) { + dtdGrammarUtil.startElement(fElementQName, fAttributes); + } - if (fDocumentHandler != null) + if (fDocumentHandler != null) { fDocumentHandler.startElement(fElementQName, fAttributes, null); } + } if (DEBUG_START_END_ELEMENT) System.out.println("<<< scanStartElement(): " + empty); @@ -679,7 +640,13 @@ public class XML11NSDocumentScannerImpl extends XML11DocumentScannerImpl { if (prefix == XMLSymbols.PREFIX_XMLNS || prefix == XMLSymbols.EMPTY_STRING && localpart == XMLSymbols.PREFIX_XMLNS) { - + if (value.length() > fXMLNameLimit) { + fErrorReporter.reportError(XMLMessageFormatter.XML_DOMAIN, + "MaxXMLNameLimit", + new Object[]{value, value.length(), fXMLNameLimit, + fSecurityManager.getStateLiteral(XMLSecurityManager.Limit.MAX_NAME_LIMIT)}, + XMLErrorReporter.SEVERITY_FATAL_ERROR); + } // get the internalized value of this attribute String uri = fSymbolTable.addSymbol(value); diff --git a/src/com/sun/org/apache/xerces/internal/impl/XMLDTDScannerImpl.java b/src/com/sun/org/apache/xerces/internal/impl/XMLDTDScannerImpl.java index f945b0a..a54234b 100644 --- a/src/com/sun/org/apache/xerces/internal/impl/XMLDTDScannerImpl.java +++ b/src/com/sun/org/apache/xerces/internal/impl/XMLDTDScannerImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. */ /* @@ -369,6 +369,8 @@ implements XMLDTDScanner, XMLComponent, XMLEntityHandler { } // we're done, set starting state for external subset setScannerState(SCANNER_STATE_TEXT_DECL); + // we're done scanning DTD. + fLimitAnalyzer.reset(XMLSecurityManager.Limit.TOTAL_ENTITY_SIZE_LIMIT); return false; } } while (complete); @@ -378,6 +380,26 @@ implements XMLDTDScanner, XMLComponent, XMLEntityHandler { } // scanDTDInternalSubset(boolean,boolean,boolean):boolean + /** + * Skip the DTD if javax.xml.stream.supportDTD is false. + * + * @param supportDTD The value of the property javax.xml.stream.supportDTD. + * @return true if DTD is skipped, false otherwise. + * @throws java.io.IOException if i/o error occurs + */ + @Override + public boolean skipDTD(boolean supportDTD) throws IOException { + if (!supportDTD) { + fStringBuffer.clear(); + if (!fEntityScanner.scanData("]", fStringBuffer)) { + fEntityScanner.fCurrentEntity.position--; + } + + return true; + } + return false; + } + // // XMLComponent methods // @@ -704,7 +726,7 @@ implements XMLDTDScanner, XMLComponent, XMLEntityHandler { fErrorReporter.reportError( XMLMessageFormatter.XML_DOMAIN,"EntityNotDeclared", new Object[]{name}, XMLErrorReporter.SEVERITY_ERROR); } - fEntityManager.startEntity(fSymbolTable.addSymbol(pName), + fEntityManager.startEntity(false, fSymbolTable.addSymbol(pName), literal); // if we actually got a new entity and it's external // parse text decl if there is any @@ -1418,7 +1440,7 @@ implements XMLDTDScanner, XMLComponent, XMLEntityHandler { // AttValue boolean isVC = !fStandalone && (fSeenExternalDTD || fSeenExternalPE) ; scanAttributeValue(defaultVal, nonNormalizedDefaultVal, atName, - fAttributes, 0, isVC); + fAttributes, 0, isVC, elName); } return defaultType; @@ -1632,7 +1654,7 @@ implements XMLDTDScanner, XMLComponent, XMLEntityHandler { XMLString literal2 = fString; int countChar = 0; if (fLimitAnalyzer == null ) { - fLimitAnalyzer = new XMLLimitAnalyzer(); + fLimitAnalyzer = fEntityManager.fLimitAnalyzer; } fLimitAnalyzer.startEntity(entityName); @@ -1640,9 +1662,7 @@ implements XMLDTDScanner, XMLComponent, XMLEntityHandler { fStringBuffer.clear(); fStringBuffer2.clear(); do { - if (isPEDecl && fLimitAnalyzer != null) { - checkLimit("%" + entityName, fString.length + countChar); - } + checkEntityLimit(isPEDecl, entityName, fString.length + countChar); countChar = 0; fStringBuffer.append(fString); fStringBuffer2.append(fString); @@ -1728,9 +1748,7 @@ implements XMLDTDScanner, XMLComponent, XMLEntityHandler { literal = fStringBuffer; literal2 = fStringBuffer2; } else { - if (isPEDecl) { - checkLimit("%" + entityName, literal); - } + checkEntityLimit(isPEDecl, entityName, literal); } value.setValues(literal); nonNormalizedValue.setValues(literal2); @@ -2152,35 +2170,49 @@ implements XMLDTDScanner, XMLComponent, XMLEntityHandler { setScannerState(SCANNER_STATE_TEXT_DECL); //new SymbolTable()); - fLimitAnalyzer = new XMLLimitAnalyzer(); + fLimitAnalyzer = fEntityManager.fLimitAnalyzer; + fSecurityManager = fEntityManager.fSecurityManager; } /** * Add the count of the content buffer and check if the accumulated * value exceeds the limit + * @param isPEDecl a flag to indicate whether the entity is parameter * @param entityName entity name * @param buffer content buffer */ - private void checkLimit(String entityName, XMLString buffer) { - checkLimit(entityName, buffer.length); + private void checkEntityLimit(boolean isPEDecl, String entityName, XMLString buffer) { + checkEntityLimit(isPEDecl, entityName, buffer.length); } /** * Add the count and check limit + * @param isPEDecl a flag to indicate whether the entity is parameter * @param entityName entity name * @param len length of the buffer */ - private void checkLimit(String entityName, int len) { + private void checkEntityLimit(boolean isPEDecl, String entityName, int len) { if (fLimitAnalyzer == null) { - fLimitAnalyzer = new XMLLimitAnalyzer(); - } - fLimitAnalyzer.addValue(XMLSecurityManager.Limit.PARAMETER_ENTITY_SIZE_LIMIT, entityName, len); - if (fSecurityManager.isOverLimit(XMLSecurityManager.Limit.PARAMETER_ENTITY_SIZE_LIMIT, fLimitAnalyzer)) { - fSecurityManager.debugPrint(fLimitAnalyzer); - reportFatalError("MaxEntitySizeLimit", new Object[]{entityName, - fLimitAnalyzer.getValue(XMLSecurityManager.Limit.PARAMETER_ENTITY_SIZE_LIMIT), - fSecurityManager.getLimit(XMLSecurityManager.Limit.PARAMETER_ENTITY_SIZE_LIMIT), - fSecurityManager.getStateLiteral(XMLSecurityManager.Limit.PARAMETER_ENTITY_SIZE_LIMIT)}); + fLimitAnalyzer = fEntityManager.fLimitAnalyzer; + } + if (isPEDecl) { + fLimitAnalyzer.addValue(XMLSecurityManager.Limit.PARAMETER_ENTITY_SIZE_LIMIT, "%" + entityName, len); + if (fSecurityManager.isOverLimit(XMLSecurityManager.Limit.PARAMETER_ENTITY_SIZE_LIMIT, fLimitAnalyzer)) { + fSecurityManager.debugPrint(fLimitAnalyzer); + reportFatalError("MaxEntitySizeLimit", new Object[]{"%" + entityName, + fLimitAnalyzer.getValue(XMLSecurityManager.Limit.PARAMETER_ENTITY_SIZE_LIMIT), + fSecurityManager.getLimit(XMLSecurityManager.Limit.PARAMETER_ENTITY_SIZE_LIMIT), + fSecurityManager.getStateLiteral(XMLSecurityManager.Limit.PARAMETER_ENTITY_SIZE_LIMIT)}); + } + } else { + fLimitAnalyzer.addValue(XMLSecurityManager.Limit.GENERAL_ENTITY_SIZE_LIMIT, entityName, len); + if (fSecurityManager.isOverLimit(XMLSecurityManager.Limit.GENERAL_ENTITY_SIZE_LIMIT, fLimitAnalyzer)) { + fSecurityManager.debugPrint(fLimitAnalyzer); + reportFatalError("MaxEntitySizeLimit", new Object[]{entityName, + fLimitAnalyzer.getValue(XMLSecurityManager.Limit.GENERAL_ENTITY_SIZE_LIMIT), + fSecurityManager.getLimit(XMLSecurityManager.Limit.GENERAL_ENTITY_SIZE_LIMIT), + fSecurityManager.getStateLiteral(XMLSecurityManager.Limit.GENERAL_ENTITY_SIZE_LIMIT)}); + } } if (fSecurityManager.isOverLimit(XMLSecurityManager.Limit.TOTAL_ENTITY_SIZE_LIMIT, fLimitAnalyzer)) { fSecurityManager.debugPrint(fLimitAnalyzer); diff --git a/src/com/sun/org/apache/xerces/internal/impl/XMLDocumentFragmentScannerImpl.java b/src/com/sun/org/apache/xerces/internal/impl/XMLDocumentFragmentScannerImpl.java index d7080ca..e8a2d43 100644 --- a/src/com/sun/org/apache/xerces/internal/impl/XMLDocumentFragmentScannerImpl.java +++ b/src/com/sun/org/apache/xerces/internal/impl/XMLDocumentFragmentScannerImpl.java @@ -89,7 +89,7 @@ public class XMLDocumentFragmentScannerImpl // Constants // - protected int fElementAttributeLimit; + protected int fElementAttributeLimit, fXMLNameLimit; /** External subset resolver. **/ protected ExternalSubsetResolver fExternalSubsetResolver; @@ -425,7 +425,7 @@ public class XMLDocumentFragmentScannerImpl */ public void setInputSource(XMLInputSource inputSource) throws IOException { fEntityManager.setEntityHandler(this); - fEntityManager.startEntity("$fragment$", inputSource, false, true); + fEntityManager.startEntity(false, "$fragment$", inputSource, false, true); // fDocumentSystemId = fEntityManager.expandSystemId(inputSource.getSystemId()); } // setInputSource(XMLInputSource) @@ -660,11 +660,12 @@ public class XMLDocumentFragmentScannerImpl if (fSecurityManager != null) { fElementAttributeLimit = fSecurityManager.getLimit(XMLSecurityManager.Limit.ELEMENT_ATTRIBUTE_LIMIT); + fXMLNameLimit = fSecurityManager.getLimit(XMLSecurityManager.Limit.MAX_NAME_LIMIT); } else { fElementAttributeLimit = 0; + fXMLNameLimit = XMLSecurityManager.Limit.MAX_NAME_LIMIT.defaultValue(); } - fLimitAnalyzer = new XMLLimitAnalyzer(); - fEntityManager.setLimitAnalyzer(fLimitAnalyzer); + fLimitAnalyzer = fEntityManager.fLimitAnalyzer; } /** @@ -1546,7 +1547,7 @@ public class XMLDocumentFragmentScannerImpl scanAttributeValue(tmpStr, fTempString2, fAttributeQName.rawname, attributes, - attIndex, isVC); + attIndex, isVC, fCurrentElement.rawname); // content int oldLen = attributes.getLength(); @@ -1905,7 +1906,7 @@ public class XMLDocumentFragmentScannerImpl //if that was the case it its taken care in XMLEntityManager.startEntity() //we immediately call the endEntity. Application gets to know if there was //any entity that was not declared. - fEntityManager.startEntity(name, false); + fEntityManager.startEntity(true, name, false); //set the scaner state to content.. parser will automatically revive itself at any point of time. //setScannerState(SCANNER_STATE_CONTENT); //return true ; @@ -2851,8 +2852,6 @@ public class XMLDocumentFragmentScannerImpl if(DEBUG){ System.out.println("NOT USING THE BUFFER, STRING = " + fTempString.toString()); } - //check limit before returning event - checkLimit(fContentBuffer); if(dtdGrammarUtil!= null && dtdGrammarUtil.isIgnorableWhiteSpace(fContentBuffer)){ if(DEBUG)System.out.println("Return SPACE EVENT"); return XMLEvent.SPACE; @@ -2951,8 +2950,6 @@ public class XMLDocumentFragmentScannerImpl fLastSectionWasCharacterData = true ; continue; }else{ - //check limit before returning event - checkLimit(fContentBuffer); if(dtdGrammarUtil!= null && dtdGrammarUtil.isIgnorableWhiteSpace(fContentBuffer)){ if(DEBUG)System.out.println("Return SPACE EVENT"); return XMLEvent.SPACE; @@ -3163,31 +3160,6 @@ public class XMLDocumentFragmentScannerImpl } //while loop }//next - /** - * Add the count of the content buffer and check if the accumulated - * value exceeds the limit - * @param buffer content buffer - */ - protected void checkLimit(XMLStringBuffer buffer) { - if (fLimitAnalyzer.isTracking(fCurrentEntityName)) { - fLimitAnalyzer.addValue(Limit.GENERAL_ENTITY_SIZE_LIMIT, fCurrentEntityName, buffer.length); - if (fSecurityManager.isOverLimit(Limit.GENERAL_ENTITY_SIZE_LIMIT, fLimitAnalyzer)) { - fSecurityManager.debugPrint(fLimitAnalyzer); - reportFatalError("MaxEntitySizeLimit", new Object[]{fCurrentEntityName, - fLimitAnalyzer.getValue(Limit.GENERAL_ENTITY_SIZE_LIMIT), - fSecurityManager.getLimit(Limit.GENERAL_ENTITY_SIZE_LIMIT), - fSecurityManager.getStateLiteral(Limit.GENERAL_ENTITY_SIZE_LIMIT)}); - } - if (fSecurityManager.isOverLimit(Limit.TOTAL_ENTITY_SIZE_LIMIT, fLimitAnalyzer)) { - fSecurityManager.debugPrint(fLimitAnalyzer); - reportFatalError("TotalEntitySizeLimit", - new Object[]{fLimitAnalyzer.getTotalValue(Limit.TOTAL_ENTITY_SIZE_LIMIT), - fSecurityManager.getLimit(Limit.TOTAL_ENTITY_SIZE_LIMIT), - fSecurityManager.getStateLiteral(Limit.TOTAL_ENTITY_SIZE_LIMIT)}); - } - } - } - // // Protected methods // diff --git a/src/com/sun/org/apache/xerces/internal/impl/XMLDocumentScannerImpl.java b/src/com/sun/org/apache/xerces/internal/impl/XMLDocumentScannerImpl.java index c2d58bd..27689e7 100644 --- a/src/com/sun/org/apache/xerces/internal/impl/XMLDocumentScannerImpl.java +++ b/src/com/sun/org/apache/xerces/internal/impl/XMLDocumentScannerImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. */ /* @@ -1096,11 +1096,14 @@ public class XMLDocumentScannerImpl again = false; switch (fScannerState) { case SCANNER_STATE_DTD_INTERNAL_DECLS: { + boolean moreToScan = false; + if (!fDTDScanner.skipDTD(fSupportDTD)) { // REVISIT: Should there be a feature for // the "complete" parameter? boolean completeDTD = true; - boolean moreToScan = fDTDScanner.scanDTDInternalSubset(completeDTD, fStandalone, fHasExternalDTD && fLoadExternalDTD); + moreToScan = fDTDScanner.scanDTDInternalSubset(completeDTD, fStandalone, fHasExternalDTD && fLoadExternalDTD); + } Entity entity = fEntityScanner.getCurrentEntity(); if(entity instanceof Entity.ScannedEntity){ fEndPos=((Entity.ScannedEntity)entity).position; diff --git a/src/com/sun/org/apache/xerces/internal/impl/XMLEntityManager.java b/src/com/sun/org/apache/xerces/internal/impl/XMLEntityManager.java index d0f036f..bf3adc2 100644 --- a/src/com/sun/org/apache/xerces/internal/impl/XMLEntityManager.java +++ b/src/com/sun/org/apache/xerces/internal/impl/XMLEntityManager.java @@ -1,15 +1,15 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. */ - /* - * Copyright 2005 The Apache Software Foundation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -20,12 +20,10 @@ package com.sun.org.apache.xerces.internal.impl ; -import com.sun.org.apache.xerces.internal.impl.Constants; import com.sun.org.apache.xerces.internal.impl.io.ASCIIReader; import com.sun.org.apache.xerces.internal.impl.io.UCSReader; import com.sun.org.apache.xerces.internal.impl.io.UTF8Reader; import com.sun.org.apache.xerces.internal.impl.msg.XMLMessageFormatter; -import com.sun.org.apache.xerces.internal.impl.XMLEntityHandler; import com.sun.org.apache.xerces.internal.impl.validation.ValidationManager; import com.sun.org.apache.xerces.internal.util.*; import com.sun.org.apache.xerces.internal.util.URI; @@ -47,12 +45,11 @@ import java.net.HttpURLConnection; import java.net.URISyntaxException; import java.net.URL; import java.net.URLConnection; -import java.util.Hashtable; +import java.util.HashMap; import java.util.Iterator; import java.util.Locale; import java.util.Map; import java.util.Stack; -import javax.xml.XMLConstants; import javax.xml.stream.XMLInputFactory; @@ -368,7 +365,7 @@ public class XMLEntityManager implements XMLComponent, XMLEntityResolver { // entities /** Entities. */ - protected Hashtable fEntities = new Hashtable(); + protected Map<String, Entity> fEntities = new HashMap<>(); /** Entity stack. */ protected Stack fEntityStack = new Stack(); @@ -405,6 +402,8 @@ public class XMLEntityManager implements XMLComponent, XMLEntityResolver { * If this constructor is used to create the object, reset() should be invoked on this object */ public XMLEntityManager() { + //for entity managers not created by parsers + fSecurityManager = new XMLSecurityManager(true); fEntityStorage = new XMLEntityStorage(this) ; setScannerVersion(Constants.XML_VERSION_1_0); } // <init>() @@ -582,6 +581,8 @@ public class XMLEntityManager implements XMLComponent, XMLEntityResolver { /** * This method uses the passed-in XMLInputSource to make * fCurrentEntity usable for reading. + * + * @param reference flag to indicate whether the entity is an Entity Reference. * @param name name of the entity (XML is it's the document entity) * @param xmlInputSource the input source, with sufficient information * to begin scanning characters. @@ -592,7 +593,7 @@ public class XMLEntityManager implements XMLComponent, XMLEntityResolver { * XNIException If any parser-specific goes wrong. * @return the encoding of the new entity or null if a character stream was employed */ - public String setupCurrentEntity(String name, XMLInputSource xmlInputSource, + public String setupCurrentEntity(boolean reference, String name, XMLInputSource xmlInputSource, boolean literal, boolean isExternal) throws IOException, XNIException { // get information @@ -835,7 +836,9 @@ public class XMLEntityManager implements XMLComponent, XMLEntityResolver { * in the prolog of the XML document is not considered. Hence, prolog can * be read in Chunks of data instead of byte by byte. */ - fCurrentEntity = new com.sun.xml.internal.stream.Entity.ScannedEntity(name,new XMLResourceIdentifierImpl(publicId, literalSystemId, baseSystemId, expandedSystemId),stream, reader, encoding, literal, encodingExternallySpecified, isExternal); + fCurrentEntity = new Entity.ScannedEntity(reference, name, + new XMLResourceIdentifierImpl(publicId, literalSystemId, baseSystemId, expandedSystemId), + stream, reader, encoding, literal, encodingExternallySpecified, isExternal); fCurrentEntity.setEncodingExternallySpecified(encodingExternallySpecified); fEntityScanner.setCurrentEntity(fCurrentEntity); fResourceIdentifier.setValues(publicId, literalSystemId, baseSystemId, expandedSystemId); @@ -855,7 +858,7 @@ public class XMLEntityManager implements XMLComponent, XMLEntityResolver { */ public boolean isExternalEntity(String entityName) { - Entity entity = (Entity)fEntities.get(entityName); + Entity entity = fEntities.get(entityName); if (entity == null) { return false; } @@ -872,7 +875,7 @@ public class XMLEntityManager implements XMLComponent, XMLEntityResolver { */ public boolean isEntityDeclInExternalSubset(String entityName) { - Entity entity = (Entity)fEntities.get(entityName); + Entity entity = fEntities.get(entityName); if (entity == null) { return false; } @@ -902,13 +905,13 @@ public class XMLEntityManager implements XMLComponent, XMLEntityResolver { public boolean isDeclaredEntity(String entityName) { - Entity entity = (Entity)fEntities.get(entityName); + Entity entity = fEntities.get(entityName); return entity != null; } public boolean isUnparsedEntity(String entityName) { - Entity entity = (Entity)fEntities.get(entityName); + Entity entity = fEntities.get(entityName); if (entity == null) { return false; } @@ -1103,6 +1106,7 @@ public class XMLEntityManager implements XMLComponent, XMLEntityResolver { /** * Starts a named entity. * + * @param isGE flag to indicate whether the entity is a General Entity * @param entityName The name of the entity to start. * @param literal True if this entity is started within a literal * value. @@ -1110,11 +1114,11 @@ public class XMLEntityManager implements XMLComponent, XMLEntityResolver { * @throws IOException Thrown on i/o error. * @throws XNIException Thrown by entity handler to signal an error. */ - public void startEntity(String entityName, boolean literal) + public void startEntity(boolean isGE, String entityName, boolean literal) throws IOException, XNIException { // was entity declared? - Entity entity = (Entity)fEntityStorage.getEntity(entityName); + Entity entity = fEntityStorage.getEntity(entityName); if (entity == null) { if (fEntityHandler != null) { String encoding = null; @@ -1234,7 +1238,7 @@ public class XMLEntityManager implements XMLComponent, XMLEntityResolver { } // start the entity - startEntity(entityName, xmlInputSource, literal, external); + startEntity(isGE, entityName, xmlInputSource, literal, external); } // startEntity(String,boolean) @@ -1249,7 +1253,7 @@ public class XMLEntityManager implements XMLComponent, XMLEntityResolver { */ public void startDocumentEntity(XMLInputSource xmlInputSource) throws IOException, XNIException { - startEntity(XMLEntity, xmlInputSource, false, true); + startEntity(false, XMLEntity, xmlInputSource, false, true); } // startDocumentEntity(XMLInputSource) //xxx these methods are not required. @@ -1264,7 +1268,7 @@ public class XMLEntityManager implements XMLComponent, XMLEntityResolver { */ public void startDTDEntity(XMLInputSource xmlInputSource) throws IOException, XNIException { - startEntity(DTDEntity, xmlInputSource, false, true); + startEntity(false, DTDEntity, xmlInputSource, false, true); } // startDTDEntity(XMLInputSource) // indicate start of external subset so that @@ -1283,6 +1287,7 @@ public class XMLEntityManager implements XMLComponent, XMLEntityResolver { * This method can be used to insert an application defined XML * entity stream into the parsing stream. * + * @param isGE flag to indicate whether the entity is a General Entity * @param name The name of the entity. * @param xmlInputSource The input source of the entity. * @param literal True if this entity is started within a @@ -1292,12 +1297,12 @@ public class XMLEntityManager implements XMLComponent, XMLEntityResolver { * @throws IOException Thrown on i/o error. * @throws XNIException Thrown by entity handler to signal an error. */ - public void startEntity(String name, + public void startEntity(boolean isGE, String name, XMLInputSource xmlInputSource, boolean literal, boolean isExternal) throws IOException, XNIException { - String encoding = setupCurrentEntity(name, xmlInputSource, literal, isExternal); + String encoding = setupCurrentEntity(isGE, name, xmlInputSource, literal, isExternal); //when entity expansion limit is set by the Application, we need to //check for the entity expansion limit set by the parser, if number of entity @@ -1309,7 +1314,7 @@ public class XMLEntityManager implements XMLComponent, XMLEntityResolver { } if( fSecurityManager != null && fSecurityManager.isOverLimit(entityExpansionIndex, fLimitAnalyzer)){ fSecurityManager.debugPrint(fLimitAnalyzer); - fErrorReporter.reportError(XMLMessageFormatter.XML_DOMAIN,"EntityExpansionLimitExceeded", + fErrorReporter.reportError(XMLMessageFormatter.XML_DOMAIN,"EntityExpansionLimit", new Object[]{fSecurityManager.getLimitValueByIndex(entityExpansionIndex)}, XMLErrorReporter.SEVERITY_FATAL_ERROR ); // is there anything better to do than reset the counter? @@ -1425,10 +1430,6 @@ public class XMLEntityManager implements XMLComponent, XMLEntityResolver { // XMLComponent methods // public void reset(PropertyManager propertyManager){ - //reset fEntityStorage - fEntityStorage.reset(propertyManager); - //reset XMLEntityReaderImpl - fEntityScanner.reset(propertyManager); // xerces properties fSymbolTable = (SymbolTable)propertyManager.getProperty(Constants.XERCES_PROPERTY_PREFIX + Constants.SYMBOL_TABLE_PROPERTY); fErrorReporter = (XMLErrorReporter)propertyManager.getProperty(Constants.XERCES_PROPERTY_PREFIX + Constants.ERROR_REPORTER_PROPERTY); @@ -1451,6 +1452,12 @@ public class XMLEntityManager implements XMLComponent, XMLEntityResolver { fSecurityManager = (XMLSecurityManager)propertyManager.getProperty(SECURITY_MANAGER); + fLimitAnalyzer = new XMLLimitAnalyzer(); + //reset fEntityStorage + fEntityStorage.reset(propertyManager); + //reset XMLEntityReaderImpl + fEntityScanner.reset(propertyManager); + // initialize state //fStandalone = false; fEntities.clear(); @@ -1537,7 +1544,7 @@ public class XMLEntityManager implements XMLComponent, XMLEntityResolver { // a class acting as a component manager but not // implementing that interface for whatever reason. public void reset() { - + fLimitAnalyzer = new XMLLimitAnalyzer(); // initialize state fStandalone = false; fEntities.clear(); diff --git a/src/com/sun/org/apache/xerces/internal/impl/XMLEntityScanner.java b/src/com/sun/org/apache/xerces/internal/impl/XMLEntityScanner.java index 768118d..1c0eca6 100644 --- a/src/com/sun/org/apache/xerces/internal/impl/XMLEntityScanner.java +++ b/src/com/sun/org/apache/xerces/internal/impl/XMLEntityScanner.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. */ /* @@ -30,10 +30,14 @@ import com.sun.org.apache.xerces.internal.util.EncodingMap; import com.sun.org.apache.xerces.internal.util.SymbolTable; import com.sun.org.apache.xerces.internal.util.XMLChar; import com.sun.org.apache.xerces.internal.util.XMLStringBuffer; +import com.sun.org.apache.xerces.internal.utils.XMLLimitAnalyzer; +import com.sun.org.apache.xerces.internal.utils.XMLSecurityManager; +import com.sun.org.apache.xerces.internal.utils.XMLSecurityManager.Limit; import com.sun.org.apache.xerces.internal.xni.*; import com.sun.org.apache.xerces.internal.xni.parser.XMLComponentManager; import com.sun.org.apache.xerces.internal.xni.parser.XMLConfigurationException; import com.sun.xml.internal.stream.Entity; +import com.sun.xml.internal.stream.Entity.ScannedEntity; import com.sun.xml.internal.stream.XMLBufferListener; import java.io.EOFException; import java.io.IOException; @@ -60,6 +64,12 @@ public class XMLEntityScanner implements XMLLocator { protected XMLEntityManager fEntityManager ; + /** Security manager. */ + protected XMLSecurityManager fSecurityManager = null; + + /** Limit analyzer. */ + protected XMLLimitAnalyzer fLimitAnalyzer = null; + /** Debug switching readers for encodings. */ private static final boolean DEBUG_ENCODINGS = false; /** Listeners which should know when load is being called */ @@ -174,10 +184,7 @@ public class XMLEntityScanner implements XMLLocator { public void reset(PropertyManager propertyManager){ fSymbolTable = (SymbolTable)propertyManager.getProperty(SYMBOL_TABLE) ; fErrorReporter = (XMLErrorReporter)propertyManager.getProperty(ERROR_REPORTER) ; - fCurrentEntity = null; - whiteSpaceLen = 0; - whiteSpaceInfoNeeded = true; - listeners.clear(); + resetCommon(); } /** @@ -196,18 +203,13 @@ public class XMLEntityScanner implements XMLLocator { */ public void reset(XMLComponentManager componentManager) throws XMLConfigurationException { - - //System.out.println(" this is being called"); // xerces features fAllowJavaEncodings = componentManager.getFeature(ALLOW_JAVA_ENCODINGS, false); //xerces properties fSymbolTable = (SymbolTable)componentManager.getProperty(SYMBOL_TABLE); fErrorReporter = (XMLErrorReporter)componentManager.getProperty(ERROR_REPORTER); - fCurrentEntity = null; - whiteSpaceLen = 0; - whiteSpaceInfoNeeded = true; - listeners.clear(); + resetCommon(); } // reset(XMLComponentManager) @@ -217,6 +219,17 @@ public class XMLEntityScanner implements XMLLocator { fSymbolTable = symbolTable; fEntityManager = entityManager; fErrorReporter = reporter; + fLimitAnalyzer = fEntityManager.fLimitAnalyzer; + fSecurityManager = fEntityManager.fSecurityManager; + } + + private void resetCommon() { + fCurrentEntity = null; + whiteSpaceLen = 0; + whiteSpaceInfoNeeded = true; + listeners.clear(); + fLimitAnalyzer = fEntityManager.fLimitAnalyzer; + fSecurityManager = fEntityManager.fSecurityManager; } /** @@ -813,9 +826,13 @@ public class XMLEntityScanner implements XMLLocator { break; } index = fCurrentEntity.position; + //check prefix before further read + checkLimit(Limit.MAX_NAME_LIMIT, fCurrentEntity, offset, index - offset); } if (++fCurrentEntity.position == fCurrentEntity.count) { int length = fCurrentEntity.position - offset; + //check localpart before loading more data + checkLimit(Limit.MAX_NAME_LIMIT, fCurrentEntity, offset, length - index - 1); invokeListeners(length); if (length == fCurrentEntity.fBufferSize) { // bad luck we have to resize our buffer @@ -847,14 +864,20 @@ public class XMLEntityScanner implements XMLLocator { if (index != -1) { int prefixLength = index - offset; + //check the result: prefix + checkLimit(Limit.MAX_NAME_LIMIT, fCurrentEntity, offset, prefixLength); prefix = fSymbolTable.addSymbol(fCurrentEntity.ch, offset, prefixLength); int len = length - prefixLength - 1; + //check the result: localpart + checkLimit(Limit.MAX_NAME_LIMIT, fCurrentEntity, index + 1, len); localpart = fSymbolTable.addSymbol(fCurrentEntity.ch, index + 1, len); } else { localpart = rawname; + //check the result: localpart + checkLimit(Limit.MAX_NAME_LIMIT, fCurrentEntity, offset, length); } qname.setValues(prefix, localpart, rawname, null); if (DEBUG_BUFFER) { @@ -877,6 +900,27 @@ public class XMLEntityScanner implements XMLLocator { } // scanQName(QName):boolean /** + * Checks whether the value of the specified Limit exceeds its limit + * + * @param limit The Limit to be checked. + * @param entity The current entity. + * @param offset The index of the first byte + * @param length The length of the entity scanned. + */ + protected void checkLimit(Limit limit, ScannedEntity entity, int offset, int length) { + fLimitAnalyzer.addValue(limit, null, length); + if (fSecurityManager.isOverLimit(limit, fLimitAnalyzer)) { + fSecurityManager.debugPrint(fLimitAnalyzer); + fErrorReporter.reportError(XMLMessageFormatter.XML_DOMAIN, limit.key(), + new Object[]{new String(entity.ch, offset, length), + fLimitAnalyzer.getTotalValue(limit), + fSecurityManager.getLimit(limit), + fSecurityManager.getStateLiteral(limit)}, + XMLErrorReporter.SEVERITY_FATAL_ERROR); + } + } + + /** * CHANGED: * Scans a range of parsed character data, This function appends the character data to * the supplied buffer. @@ -994,6 +1038,9 @@ public class XMLEntityScanner implements XMLLocator { } int length = fCurrentEntity.position - offset; fCurrentEntity.columnNumber += length - newlines; + if (fCurrentEntity.isGE) { + checkLimit(Limit.TOTAL_ENTITY_SIZE_LIMIT, fCurrentEntity, offset, length); + } //CHANGED: dont replace the value.. append to the buffer. This gives control to the callee //on buffering the data.. @@ -1158,6 +1205,9 @@ public class XMLEntityScanner implements XMLLocator { } int length = fCurrentEntity.position - offset; fCurrentEntity.columnNumber += length - newlines; + if (fCurrentEntity.isGE) { + checkLimit(Limit.TOTAL_ENTITY_SIZE_LIMIT, fCurrentEntity, offset, length); + } content.setValues(fCurrentEntity.ch, offset, length); // return next character diff --git a/src/com/sun/org/apache/xerces/internal/impl/XMLErrorReporter.java b/src/com/sun/org/apache/xerces/internal/impl/XMLErrorReporter.java index 8d0ed6d..1333a68 100644 --- a/src/com/sun/org/apache/xerces/internal/impl/XMLErrorReporter.java +++ b/src/com/sun/org/apache/xerces/internal/impl/XMLErrorReporter.java @@ -1,68 +1,24 @@ /* - * reserved comment block - * DO NOT REMOVE OR ALTER! + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. */ /* - * The Apache Software License, Version 1.1 + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * + * http://www.apache.org/licenses/LICENSE-2.0 * - * Copyright (c) 1999-2004 The Apache Software Foundation. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Xerces" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation and was - * originally based on software copyright (c) 1999, International - * Business Machines, Inc., http://www.apache.org. For more - * information on the Apache Software Foundation, please see - * <http://www.apache.org/>. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package com.sun.org.apache.xerces.internal.impl; -import java.util.Hashtable; -import java.util.Locale; - import com.sun.org.apache.xerces.internal.util.DefaultErrorHandler; import com.sun.org.apache.xerces.internal.util.ErrorHandlerProxy; import com.sun.org.apache.xerces.internal.util.MessageFormatter; @@ -73,6 +29,9 @@ import com.sun.org.apache.xerces.internal.xni.parser.XMLComponentManager; import com.sun.org.apache.xerces.internal.xni.parser.XMLConfigurationException; import com.sun.org.apache.xerces.internal.xni.parser.XMLErrorHandler; import com.sun.org.apache.xerces.internal.xni.parser.XMLParseException; +import java.util.HashMap; +import java.util.Locale; +import java.util.Map; import org.xml.sax.ErrorHandler; /** @@ -189,7 +148,7 @@ public class XMLErrorReporter protected Locale fLocale; /** Mapping of Message formatters for domains. */ - protected Hashtable fMessageFormatters; + protected Map<String, MessageFormatter> fMessageFormatters; /** Error handler. */ protected XMLErrorHandler fErrorHandler; @@ -233,7 +192,7 @@ public class XMLErrorReporter // caller to specify the location of the error being // reported. -Ac - fMessageFormatters = new Hashtable(); + fMessageFormatters = new HashMap<>(); } // <init>() @@ -291,7 +250,7 @@ public class XMLErrorReporter * @param domain The domain of the message formatter. */ public MessageFormatter getMessageFormatter(String domain) { - return (MessageFormatter)fMessageFormatters.get(domain); + return fMessageFormatters.get(domain); } // getMessageFormatter(String):MessageFormatter /** @@ -301,7 +260,7 @@ public class XMLErrorReporter * @param domain The domain of the message formatter. */ public MessageFormatter removeMessageFormatter(String domain) { - return (MessageFormatter) fMessageFormatters.remove(domain); + return fMessageFormatters.remove(domain); } // removeMessageFormatter(String):MessageFormatter /** diff --git a/src/com/sun/org/apache/xerces/internal/impl/XMLNSDocumentScannerImpl.java b/src/com/sun/org/apache/xerces/internal/impl/XMLNSDocumentScannerImpl.java index a97da68..7853357 100644 --- a/src/com/sun/org/apache/xerces/internal/impl/XMLNSDocumentScannerImpl.java +++ b/src/com/sun/org/apache/xerces/internal/impl/XMLNSDocumentScannerImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. */ /* @@ -37,6 +37,7 @@ import com.sun.org.apache.xerces.internal.xni.XMLDocumentHandler; import com.sun.org.apache.xerces.internal.xni.XMLAttributes; import com.sun.org.apache.xerces.internal.xni.parser.XMLDocumentSource; import com.sun.org.apache.xerces.internal.util.XMLAttributesImpl; +import com.sun.org.apache.xerces.internal.utils.XMLSecurityManager; import javax.xml.stream.XMLInputFactory; import javax.xml.stream.XMLStreamConstants; @@ -438,7 +439,7 @@ public class XMLNSDocumentScannerImpl XMLString tmpStr = getString(); scanAttributeValue(tmpStr, fTempString2, fAttributeQName.rawname, attributes, - attrIndex, isVC); + attrIndex, isVC, fCurrentElement.rawname); String value = null; //fTempString.toString(); @@ -453,7 +454,15 @@ public class XMLNSDocumentScannerImpl // it's a namespace declaration. but prefix:xmlns="..." isn't. if (prefix == XMLSymbols.PREFIX_XMLNS || prefix == XMLSymbols.EMPTY_STRING && localpart == XMLSymbols.PREFIX_XMLNS) { - + //check the length of URI + if (tmpStr.length > fXMLNameLimit) { + fErrorReporter.reportError(XMLMessageFormatter.XML_DOMAIN, + "MaxXMLNameLimit", + new Object[]{new String(tmpStr.ch,tmpStr.offset,tmpStr.length), + tmpStr.length, fXMLNameLimit, + fSecurityManager.getStateLiteral(XMLSecurityManager.Limit.MAX_NAME_LIMIT)}, + XMLErrorReporter.SEVERITY_FATAL_ERROR); + } // get the internalized value of this attribute String uri = fSymbolTable.addSymbol(tmpStr.ch,tmpStr.offset,tmpStr.length); value = uri; diff --git a/src/com/sun/org/apache/xerces/internal/impl/XMLScanner.java b/src/com/sun/org/apache/xerces/internal/impl/XMLScanner.java index 0cb44b2..fc46488 100644 --- a/src/com/sun/org/apache/xerces/internal/impl/XMLScanner.java +++ b/src/com/sun/org/apache/xerces/internal/impl/XMLScanner.java @@ -812,6 +812,7 @@ public abstract class XMLScanner * @param attrIndex The index of the attribute to use from the list. * @param checkEntities true if undeclared entities should be reported as VC violation, * false if undeclared entities should be reported as WFC violation. + * @param eleName The name of element to which this attribute belongs. * * <strong>Note:</strong> This method uses fStringBuffer2, anything in it * at the time of calling is lost. @@ -820,13 +821,13 @@ public abstract class XMLScanner XMLString nonNormalizedValue, String atName, XMLAttributes attributes, int attrIndex, - boolean checkEntities) + boolean checkEntities, String eleName) throws IOException, XNIException { XMLStringBuffer stringBuffer = null; // quote int quote = fEntityScanner.peekChar(); if (quote != '\'' && quote != '"') { - reportFatalError("OpenQuoteExpected", new Object[]{atName}); + reportFatalError("OpenQuoteExpected", new Object[]{eleName, atName}); } fEntityScanner.scanChar(); @@ -946,13 +947,13 @@ public abstract class XMLScanner new Object[]{entityName}); } } - fEntityManager.startEntity(entityName, true); + fEntityManager.startEntity(true, entityName, true); } } } } else if (c == '<') { reportFatalError("LessthanInAttValue", - new Object[] { null, atName }); + new Object[] { eleName, atName }); fEntityScanner.scanChar(); if (entityDepth == fEntityDepth && fNeedNonNormalizedValue) { fStringBuffer2.append((char)c); @@ -987,7 +988,7 @@ public abstract class XMLScanner } } else if (c != -1 && isInvalidLiteral(c)) { reportFatalError("InvalidCharInAttValue", - new Object[] {Integer.toString(c, 16)}); + new Object[] {eleName, atName, Integer.toString(c, 16)}); fEntityScanner.scanChar(); if (entityDepth == fEntityDepth && fNeedNonNormalizedValue) { fStringBuffer2.append((char)c); @@ -1016,7 +1017,7 @@ public abstract class XMLScanner // quote int cquote = fEntityScanner.scanChar(); if (cquote != quote) { - reportFatalError("CloseQuoteExpected", new Object[]{atName}); + reportFatalError("CloseQuoteExpected", new Object[]{eleName, atName}); } } // scanAttributeValue() diff --git a/src/com/sun/org/apache/xerces/internal/impl/XMLStreamReaderImpl.java b/src/com/sun/org/apache/xerces/internal/impl/XMLStreamReaderImpl.java index a0c999d..350a87c 100644 --- a/src/com/sun/org/apache/xerces/internal/impl/XMLStreamReaderImpl.java +++ b/src/com/sun/org/apache/xerces/internal/impl/XMLStreamReaderImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,22 +25,21 @@ package com.sun.org.apache.xerces.internal.impl; +import com.sun.org.apache.xerces.internal.util.NamespaceContextWrapper; +import com.sun.org.apache.xerces.internal.util.NamespaceSupport; +import com.sun.org.apache.xerces.internal.util.SymbolTable; +import com.sun.org.apache.xerces.internal.util.XMLAttributesImpl; +import com.sun.org.apache.xerces.internal.util.XMLChar; +import com.sun.org.apache.xerces.internal.util.XMLStringBuffer; +import com.sun.org.apache.xerces.internal.xni.XNIException; +import com.sun.org.apache.xerces.internal.xni.parser.XMLInputSource; import com.sun.xml.internal.stream.Entity; import com.sun.xml.internal.stream.StaxErrorReporter; import com.sun.xml.internal.stream.XMLEntityStorage; +import com.sun.xml.internal.stream.dtd.nonvalidating.DTDGrammar; +import com.sun.xml.internal.stream.dtd.nonvalidating.XMLNotationDecl; import com.sun.xml.internal.stream.events.EntityDeclarationImpl; import com.sun.xml.internal.stream.events.NotationDeclarationImpl; -import javax.xml.namespace.NamespaceContext; -import com.sun.org.apache.xerces.internal.xni.XNIException; -import com.sun.org.apache.xerces.internal.xni.parser.XMLInputSource; -import javax.xml.XMLConstants; -import javax.xml.namespace.QName; -import javax.xml.stream.Location; -import javax.xml.stream.events.XMLEvent; -import com.sun.org.apache.xerces.internal.util.NamespaceContextWrapper; -import com.sun.org.apache.xerces.internal.util.SymbolTable; -import com.sun.xml.internal.stream.dtd.nonvalidating.XMLNotationDecl; -import com.sun.xml.internal.stream.dtd.nonvalidating.DTDGrammar; import java.io.BufferedInputStream; import java.io.BufferedReader; import java.io.IOException; @@ -48,20 +47,16 @@ import java.io.InputStream; import java.io.Reader; import java.util.ArrayList; import java.util.Enumeration; -import java.util.Hashtable; import java.util.Iterator; import java.util.List; +import javax.xml.XMLConstants; +import javax.xml.namespace.NamespaceContext; +import javax.xml.namespace.QName; +import javax.xml.stream.Location; import javax.xml.stream.XMLInputFactory; import javax.xml.stream.XMLStreamConstants; import javax.xml.stream.XMLStreamException; -import com.sun.org.apache.xerces.internal.impl.msg.XMLMessageFormatter; -import com.sun.org.apache.xerces.internal.util.XMLChar; -import com.sun.org.apache.xerces.internal.util.XMLStringBuffer; -import com.sun.org.apache.xerces.internal.util.NamespaceSupport; -import com.sun.org.apache.xerces.internal.util.XMLAttributesImpl; -import com.sun.org.apache.xerces.internal.impl.Constants; -import com.sun.org.apache.xerces.internal.xni.XMLDocumentHandler; -import com.sun.xml.internal.stream.dtd.DTDGrammarUtil; +import javax.xml.stream.events.XMLEvent; /** This class implements javax.xml.stream.XMLStreamReader. It makes use of XML*Scanner classes to * derive most of its functionality. If desired, Application can reuse this instance by calling @@ -1173,7 +1168,7 @@ public class XMLStreamReaderImpl implements javax.xml.stream.XMLStreamReader { public boolean hasText() { if(DEBUG) pr("XMLReaderImpl#EVENT TYPE = " + fEventType ) ; if( fEventType == XMLEvent.CHARACTERS || fEventType == XMLEvent.COMMENT || fEventType == XMLEvent.CDATA) { - return fScanner.getCharacterData().length > 0 ? true : false; + return fScanner.getCharacterData().length > 0; } else if(fEventType == XMLEvent.ENTITY_REFERENCE) { String name = fScanner.getEntityName(); if(name != null){ @@ -1185,9 +1180,9 @@ public class XMLStreamReaderImpl implements javax.xml.stream.XMLStreamReader { if(en == null) return false; if(en.isExternal()){ - return ((Entity.ExternalEntity)en).entityLocation.getExpandedSystemId() != null ? true : false; + return ((Entity.ExternalEntity)en).entityLocation.getExpandedSystemId() != null; } else{ - return ((Entity.InternalEntity)en).text != null ? true : false ; + return ((Entity.InternalEntity)en).text != null ; } }else return false; diff --git a/src/com/sun/org/apache/xerces/internal/impl/XMLVersionDetector.java b/src/com/sun/org/apache/xerces/internal/impl/XMLVersionDetector.java index 08b4093..437cc30 100644 --- a/src/com/sun/org/apache/xerces/internal/impl/XMLVersionDetector.java +++ b/src/com/sun/org/apache/xerces/internal/impl/XMLVersionDetector.java @@ -186,7 +186,7 @@ public class XMLVersionDetector { * @throws IOException */ public short determineDocVersion(XMLInputSource inputSource) throws IOException { - fEncoding = fEntityManager.setupCurrentEntity(fXMLSymbol, inputSource, false, true); + fEncoding = fEntityManager.setupCurrentEntity(false, fXMLSymbol, inputSource, false, true); // Must use XML 1.0 scanner to handle whitespace correctly // in the XML declaration. diff --git a/src/com/sun/org/apache/xerces/internal/impl/dtd/DTDGrammar.java b/src/com/sun/org/apache/xerces/internal/impl/dtd/DTDGrammar.java index 71a9231..03768b3 100644 --- a/src/com/sun/org/apache/xerces/internal/impl/dtd/DTDGrammar.java +++ b/src/com/sun/org/apache/xerces/internal/impl/dtd/DTDGrammar.java @@ -1,69 +1,25 @@ /* - * reserved comment block - * DO NOT REMOVE OR ALTER! + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. */ /* - * The Apache Software License, Version 1.1 + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * + * http://www.apache.org/licenses/LICENSE-2.0 * - * Copyright (c) 1999-2002 The Apache Software Foundation. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Xerces" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation and was - * originally based on software copyright (c) 1999, International - * Business Machines, Inc., http://www.apache.org. For more - * information on the Apache Software Foundation, please see - * <http://www.apache.org/>. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package com.sun.org.apache.xerces.internal.impl.dtd; -import java.util.ArrayList; -import java.util.Hashtable; - import com.sun.org.apache.xerces.internal.impl.dtd.models.CMAny; import com.sun.org.apache.xerces.internal.impl.dtd.models.CMBinOp; import com.sun.org.apache.xerces.internal.impl.dtd.models.CMLeaf; @@ -88,10 +44,13 @@ import com.sun.org.apache.xerces.internal.xni.grammars.Grammar; import com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarDescription; import com.sun.org.apache.xerces.internal.xni.parser.XMLDTDContentModelSource; import com.sun.org.apache.xerces.internal.xni.parser.XMLDTDSource; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Map; /** * A DTD grammar. This class implements the XNI handler interfaces - * for DTD information so that it can build the approprate validation + * for DTD information so that it can build the appropriate validation * structures automatically from the callbacks. * * @xerces.internal @@ -251,13 +210,13 @@ public class DTDGrammar // other information /** Element index mapping table. */ - private QNameHashtable fElementIndexMap = new QNameHashtable(); + private final Map<String, Integer> fElementIndexMap = new HashMap<>(); /** Entity index mapping table. */ - private QNameHashtable fEntityIndexMap = new QNameHashtable(); + private final Map<String, Integer> fEntityIndexMap = new HashMap<>(); /** Notation index mapping table. */ - private QNameHashtable fNotationIndexMap = new QNameHashtable(); + private final Map<String, Integer> fNotationIndexMap = new HashMap<>(); // temp variables @@ -291,7 +250,7 @@ public class DTDGrammar private XMLContentSpec fContentSpec = new XMLContentSpec(); /** table of XMLElementDecl */ - Hashtable fElementDeclTab = new Hashtable(); + Map<String, XMLElementDecl> fElementDeclTab = new HashMap<>(); /** Children content model operation stack. */ private short[] fOpStack = null; @@ -516,7 +475,7 @@ public class DTDGrammar public void elementDecl(String name, String contentModel, Augmentations augs) throws XNIException { - XMLElementDecl tmpElementDecl = (XMLElementDecl) fElementDeclTab.get(name) ; + XMLElementDecl tmpElementDecl = fElementDeclTab.get(name) ; // check if it is already defined if ( tmpElementDecl != null ) { @@ -606,7 +565,7 @@ public class DTDGrammar String defaultType, XMLString defaultValue, XMLString nonNormalizedDefaultValue, Augmentations augs) throws XNIException { - if ( this.fElementDeclTab.containsKey( (String) elementName) ) { + if ( this.fElementDeclTab.containsKey(elementName) ) { //if ElementDecl has already being created in the Grammar then remove from table, //this.fElementDeclTab.remove( (String) elementName ); } @@ -989,7 +948,7 @@ public class DTDGrammar public void startContentModel(String elementName, Augmentations augs) throws XNIException { - XMLElementDecl elementDecl = (XMLElementDecl) this.fElementDeclTab.get( elementName); + XMLElementDecl elementDecl = this.fElementDeclTab.get(elementName); if ( elementDecl != null ) { fElementDecl = elementDecl; } @@ -1216,7 +1175,10 @@ public class DTDGrammar * @return index of the elementDeclName in scope */ public int getElementDeclIndex(String elementDeclName) { - int mapping = fElementIndexMap.get(elementDeclName); + Integer mapping = fElementIndexMap.get(elementDeclName); + if (mapping == null) { + mapping = -1; + } //System.out.println("getElementDeclIndex("+elementDeclName+") -> "+mapping); return mapping; } // getElementDeclIndex(String):int @@ -1393,7 +1355,7 @@ public class DTDGrammar * @return the index of the EntityDecl */ public int getEntityDeclIndex(String entityDeclName) { - if (entityDeclName == null) { + if (entityDeclName == null || fEntityIndexMap.get(entityDeclName) == null) { return -1; } @@ -1436,7 +1398,7 @@ public class DTDGrammar * @return the index if found a notation with the name, otherwise -1. */ public int getNotationDeclIndex(String notationDeclName) { - if (notationDeclName == null) { + if (notationDeclName == null || fNotationIndexMap.get(notationDeclName) == null) { return -1; } @@ -2670,108 +2632,6 @@ public class DTDGrammar } // class ChildrenList // - // Classes - // - - /** - * A simple Hashtable implementation that takes a tuple (String, String) - * as the key and a int as value. - * - * @xerces.internal - * - * @author Eric Ye, IBM - * @author Andy Clark, IBM - */ - protected static final class QNameHashtable { - - // - // Constants - // - - /** Initial bucket size (4). */ - private static final int INITIAL_BUCKET_SIZE = 4; - - // NOTE: Changed previous hashtable size from 512 to 101 so - // that we get a better distribution for hashing. -Ac - /** Hashtable size (101). */ - private static final int HASHTABLE_SIZE = 101; - - // - // Data - // - private Object[][] fHashTable = new Object[HASHTABLE_SIZE][]; - - // - // Public methods - // - /** Associates the given value with the specified key tuple. */ - public void put(String key, int value) { - - int hash = (key.hashCode() & 0x7FFFFFFF) % HASHTABLE_SIZE; - Object[] bucket = fHashTable[hash]; - - if (bucket == null) { - bucket = new Object[1 + 2*INITIAL_BUCKET_SIZE]; - bucket[0] = new int[]{1}; - bucket[1] = key; - bucket[2] = new int[]{value}; - fHashTable[hash] = bucket; - } else { - int count = ((int[])bucket[0])[0]; - int offset = 1 + 2*count; - if (offset == bucket.length) { - int newSize = count + INITIAL_BUCKET_SIZE; - Object[] newBucket = new Object[1 + 2*newSize]; - System.arraycopy(bucket, 0, newBucket, 0, offset); - bucket = newBucket; - fHashTable[hash] = bucket; - } - boolean found = false; - int j=1; - for (int i=0; i<count; i++){ - if ((String)bucket[j] == key) { - ((int[])bucket[j+1])[0] = value; - found = true; - break; - } - j += 2; - } - if (! found) { - bucket[offset++] = key; - bucket[offset]= new int[]{value}; - ((int[])bucket[0])[0] = ++count; - } - - } - //System.out.println("put("+key+" -> "+value+')'); - //System.out.println("get("+key+") -> "+get(key)); - - } // put(int,String,String,int) - - /** Returns the value associated with the specified key tuple. */ - public int get(String key) { - int hash = (key.hashCode() & 0x7FFFFFFF) % HASHTABLE_SIZE; - Object[] bucket = fHashTable[hash]; - - if (bucket == null) { - return -1; - } - int count = ((int[])bucket[0])[0]; - - int j=1; - for (int i=0; i<count; i++){ - if ((String)bucket[j] == key) { - return ((int[])bucket[j+1])[0]; - } - j += 2; - } - return -1; - - } // get(int,String,String) - - } // class QNameHashtable - - // // EntityState methods // public boolean isEntityDeclared (String name){ diff --git a/src/com/sun/org/apache/xerces/internal/impl/dtd/DTDGrammarBucket.java b/src/com/sun/org/apache/xerces/internal/impl/dtd/DTDGrammarBucket.java index 70871e1..fd656bc 100644 --- a/src/com/sun/org/apache/xerces/internal/impl/dtd/DTDGrammarBucket.java +++ b/src/com/sun/org/apache/xerces/internal/impl/dtd/DTDGrammarBucket.java @@ -1,68 +1,28 @@ /* - * reserved comment block - * DO NOT REMOVE OR ALTER! + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. */ /* - * The Apache Software License, Version 1.1 + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * + * http://www.apache.org/licenses/LICENSE-2.0 * - * Copyright (c) 1999-2002 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Xerces" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation and was - * originally based on software copyright (c) 1999, International - * Business Machines, Inc., http://www.apache.org. For more - * information on the Apache Software Foundation, please see - * <http://www.apache.org/>. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package com.sun.org.apache.xerces.internal.impl.dtd; import com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarDescription; -import java.util.Hashtable; +import java.util.HashMap; +import java.util.Map; /** * This very simple class is the skeleton of what the DTDValidator could use @@ -87,7 +47,7 @@ public class DTDGrammarBucket { // /** Grammars associated with element root name. */ - protected Hashtable fGrammars; + protected Map<XMLDTDDescription, DTDGrammar> fGrammars; // the unique grammar from fGrammars (or that we're // building) that is used in validation. @@ -102,7 +62,7 @@ public class DTDGrammarBucket { /** Default constructor. */ public DTDGrammarBucket() { - fGrammars = new Hashtable(); + fGrammars = new HashMap<>(); } // <init>() // @@ -122,7 +82,7 @@ public class DTDGrammarBucket { // retrieve a DTDGrammar given an XMLDTDDescription public DTDGrammar getGrammar(XMLGrammarDescription desc) { - return (DTDGrammar)(fGrammars.get((XMLDTDDescription)desc)); + return fGrammars.get((XMLDTDDescription)desc); } // putGrammar(DTDGrammar) public void clear() { diff --git a/src/com/sun/org/apache/xerces/internal/impl/dv/DTDDVFactory.java b/src/com/sun/org/apache/xerces/internal/impl/dv/DTDDVFactory.java index 15afa2e..ccfccb0 100644 --- a/src/com/sun/org/apache/xerces/internal/impl/dv/DTDDVFactory.java +++ b/src/com/sun/org/apache/xerces/internal/impl/dv/DTDDVFactory.java @@ -1,13 +1,13 @@ /* - * reserved comment block - * DO NOT REMOVE OR ALTER! + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. */ /* - * Copyright 2001, 2002,2004 The Apache Software Foundation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * @@ -20,8 +20,10 @@ package com.sun.org.apache.xerces.internal.impl.dv; -import java.util.Hashtable; +import com.sun.org.apache.xerces.internal.impl.dv.dtd.DTDDVFactoryImpl; +import com.sun.org.apache.xerces.internal.impl.dv.dtd.XML11DTDDVFactoryImpl; import com.sun.org.apache.xerces.internal.utils.ObjectFactory; +import java.util.Map; /** * The factory to create and return DTD types. The implementation should @@ -36,7 +38,11 @@ import com.sun.org.apache.xerces.internal.utils.ObjectFactory; */ public abstract class DTDDVFactory { - private static final String DEFAULT_FACTORY_CLASS = "com.sun.org.apache.xerces.internal.impl.dv.dtd.DTDDVFactoryImpl"; + private static final String DEFAULT_FACTORY_CLASS = + "com.sun.org.apache.xerces.internal.impl.dv.dtd.DTDDVFactoryImpl"; + + private static final String XML11_DATATYPE_VALIDATOR_FACTORY = + "com.sun.org.apache.xerces.internal.impl.dv.dtd.XML11DTDDVFactoryImpl"; /** * Get an instance of the default DTDDVFactory implementation. @@ -59,9 +65,15 @@ public abstract class DTDDVFactory { */ public static final DTDDVFactory getInstance(String factoryClass) throws DVFactoryException { try { - // if the class name is not specified, use the default one - return (DTDDVFactory) - (ObjectFactory.newInstance(factoryClass, true)); + if (DEFAULT_FACTORY_CLASS.equals(factoryClass)) { + return new DTDDVFactoryImpl(); + } else if (XML11_DATATYPE_VALIDATOR_FACTORY.equals(factoryClass)) { + return new XML11DTDDVFactoryImpl(); + } else { + //fall back for compatibility + return (DTDDVFactory) + (ObjectFactory.newInstance(factoryClass, true)); + } } catch (ClassCastException e) { throw new DVFactoryException("DTD factory class " + factoryClass + " does not extend from DTDDVFactory."); @@ -80,10 +92,10 @@ public abstract class DTDDVFactory { public abstract DatatypeValidator getBuiltInDV(String name); /** - * get all built-in DVs, which are stored in a hashtable keyed by the name + * get all built-in DVs, which are stored in a map keyed by the name * - * @return a hashtable which contains all datatypes + * @return a map which contains all datatypes */ - public abstract Hashtable getBuiltInTypes(); + public abstract Map<String, DatatypeValidator> getBuiltInTypes(); } diff --git a/src/com/sun/org/apache/xerces/internal/impl/dv/dtd/DTDDVFactoryImpl.java b/src/com/sun/org/apache/xerces/internal/impl/dv/dtd/DTDDVFactoryImpl.java index 561643d..0323412 100644 --- a/src/com/sun/org/apache/xerces/internal/impl/dv/dtd/DTDDVFactoryImpl.java +++ b/src/com/sun/org/apache/xerces/internal/impl/dv/dtd/DTDDVFactoryImpl.java @@ -1,13 +1,13 @@ /* - * reserved comment block - * DO NOT REMOVE OR ALTER! + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. */ /* - * Copyright 2001, 2002,2004 The Apache Software Foundation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * @@ -22,7 +22,9 @@ package com.sun.org.apache.xerces.internal.impl.dv.dtd; import com.sun.org.apache.xerces.internal.impl.dv.DTDDVFactory; import com.sun.org.apache.xerces.internal.impl.dv.DatatypeValidator; -import java.util.Hashtable; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; /** * the factory to create/return built-in schema DVs and create user-defined DVs @@ -34,9 +36,25 @@ import java.util.Hashtable; */ public class DTDDVFactoryImpl extends DTDDVFactory { - static Hashtable fBuiltInTypes = new Hashtable(); + static final Map<String, DatatypeValidator> fBuiltInTypes; static { - createBuiltInTypes(); + Map<String, DatatypeValidator> builtInTypes = new HashMap<>(); + DatatypeValidator dvTemp; + + builtInTypes.put("string", new StringDatatypeValidator()); + builtInTypes.put("ID", new IDDatatypeValidator()); + dvTemp = new IDREFDatatypeValidator(); + builtInTypes.put("IDREF", dvTemp); + builtInTypes.put("IDREFS", new ListDatatypeValidator(dvTemp)); + dvTemp = new ENTITYDatatypeValidator(); + builtInTypes.put("ENTITY", new ENTITYDatatypeValidator()); + builtInTypes.put("ENTITIES", new ListDatatypeValidator(dvTemp)); + builtInTypes.put("NOTATION", new NOTATIONDatatypeValidator()); + dvTemp = new NMTOKENDatatypeValidator(); + builtInTypes.put("NMTOKEN", dvTemp); + builtInTypes.put("NMTOKENS", new ListDatatypeValidator(dvTemp)); + + fBuiltInTypes = Collections.unmodifiableMap(builtInTypes); } /** @@ -45,37 +63,19 @@ public class DTDDVFactoryImpl extends DTDDVFactory { * @param name the name of the datatype * @return the datatype validator of the given name */ + @Override public DatatypeValidator getBuiltInDV(String name) { - return (DatatypeValidator)fBuiltInTypes.get(name); + return fBuiltInTypes.get(name); } /** - * get all built-in DVs, which are stored in a hashtable keyed by the name + * get all built-in DVs, which are stored in a Map keyed by the name * - * @return a hashtable which contains all datatypes + * @return a Map which contains all datatypes */ - public Hashtable getBuiltInTypes() { - return (Hashtable)fBuiltInTypes.clone(); + @Override + public Map<String, DatatypeValidator> getBuiltInTypes() { + return new HashMap<>(fBuiltInTypes); } - // create all built-in types - static void createBuiltInTypes() { - - DatatypeValidator dvTemp; - - fBuiltInTypes.put("string", new StringDatatypeValidator()); - fBuiltInTypes.put("ID", new IDDatatypeValidator()); - dvTemp = new IDREFDatatypeValidator(); - fBuiltInTypes.put("IDREF", dvTemp); - fBuiltInTypes.put("IDREFS", new ListDatatypeValidator(dvTemp)); - dvTemp = new ENTITYDatatypeValidator(); - fBuiltInTypes.put("ENTITY", new ENTITYDatatypeValidator()); - fBuiltInTypes.put("ENTITIES", new ListDatatypeValidator(dvTemp)); - fBuiltInTypes.put("NOTATION", new NOTATIONDatatypeValidator()); - dvTemp = new NMTOKENDatatypeValidator(); - fBuiltInTypes.put("NMTOKEN", dvTemp); - fBuiltInTypes.put("NMTOKENS", new ListDatatypeValidator(dvTemp)); - - }//createBuiltInTypes() - }// DTDDVFactoryImpl diff --git a/src/com/sun/org/apache/xerces/internal/impl/dv/dtd/XML11DTDDVFactoryImpl.java b/src/com/sun/org/apache/xerces/internal/impl/dv/dtd/XML11DTDDVFactoryImpl.java index 29a2624..0c0b1f3 100644 --- a/src/com/sun/org/apache/xerces/internal/impl/dv/dtd/XML11DTDDVFactoryImpl.java +++ b/src/com/sun/org/apache/xerces/internal/impl/dv/dtd/XML11DTDDVFactoryImpl.java @@ -1,13 +1,13 @@ /* - * reserved comment block - * DO NOT REMOVE OR ALTER! + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. */ /* - * Copyright 2001, 2002,2004 The Apache Software Foundation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * @@ -20,10 +20,10 @@ package com.sun.org.apache.xerces.internal.impl.dv.dtd; -import java.util.Enumeration; -import java.util.Hashtable; - import com.sun.org.apache.xerces.internal.impl.dv.DatatypeValidator; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; /** * the factory to create/return built-in XML 1.1 DVs and create user-defined DVs @@ -35,7 +35,18 @@ import com.sun.org.apache.xerces.internal.impl.dv.DatatypeValidator; */ public class XML11DTDDVFactoryImpl extends DTDDVFactoryImpl { - static Hashtable fXML11BuiltInTypes = new Hashtable(); + static Map<String, DatatypeValidator> XML11BUILTINTYPES; + static { + Map<String, DatatypeValidator> xml11BuiltInTypes = new HashMap<>(); + xml11BuiltInTypes.put("XML11ID", new XML11IDDatatypeValidator()); + DatatypeValidator dvTemp = new XML11IDREFDatatypeValidator(); + xml11BuiltInTypes.put("XML11IDREF", dvTemp); + xml11BuiltInTypes.put("XML11IDREFS", new ListDatatypeValidator(dvTemp)); + dvTemp = new XML11NMTOKENDatatypeValidator(); + xml11BuiltInTypes.put("XML11NMTOKEN", dvTemp); + xml11BuiltInTypes.put("XML11NMTOKENS", new ListDatatypeValidator(dvTemp)); + XML11BUILTINTYPES = Collections.unmodifiableMap(xml11BuiltInTypes); + } // <clinit> /** * return a dtd type of the given name @@ -45,38 +56,24 @@ public class XML11DTDDVFactoryImpl extends DTDDVFactoryImpl { * @param name the name of the datatype * @return the datatype validator of the given name */ + @Override public DatatypeValidator getBuiltInDV(String name) { - if(fXML11BuiltInTypes.get(name) != null) { - return (DatatypeValidator)fXML11BuiltInTypes.get(name); + if(XML11BUILTINTYPES.get(name) != null) { + return XML11BUILTINTYPES.get(name); } - return (DatatypeValidator)fBuiltInTypes.get(name); + return fBuiltInTypes.get(name); } /** - * get all built-in DVs, which are stored in a hashtable keyed by the name + * get all built-in DVs, which are stored in a Map keyed by the name * New XML 1.1 datatypes are inserted. * - * @return a hashtable which contains all datatypes + * @return a Map which contains all datatypes */ - public Hashtable getBuiltInTypes() { - Hashtable toReturn = (Hashtable)fBuiltInTypes.clone(); - Enumeration xml11Keys = fXML11BuiltInTypes.keys(); - while (xml11Keys.hasMoreElements()) { - Object key = xml11Keys.nextElement(); - toReturn.put(key, fXML11BuiltInTypes.get(key)); - } + @Override + public Map<String, DatatypeValidator> getBuiltInTypes() { + final HashMap<String, DatatypeValidator> toReturn = new HashMap<>(fBuiltInTypes); + toReturn.putAll(XML11BUILTINTYPES); return toReturn; } - - static { - fXML11BuiltInTypes.put("XML11ID", new XML11IDDatatypeValidator()); - DatatypeValidator dvTemp = new XML11IDREFDatatypeValidator(); - fXML11BuiltInTypes.put("XML11IDREF", dvTemp); - fXML11BuiltInTypes.put("XML11IDREFS", new ListDatatypeValidator(dvTemp)); - dvTemp = new XML11NMTOKENDatatypeValidator(); - fXML11BuiltInTypes.put("XML11NMTOKEN", dvTemp); - fXML11BuiltInTypes.put("XML11NMTOKENS", new ListDatatypeValidator(dvTemp)); - } // <clinit> - - }//XML11DTDDVFactoryImpl diff --git a/src/com/sun/org/apache/xerces/internal/impl/io/UTF8Reader.java b/src/com/sun/org/apache/xerces/internal/impl/io/UTF8Reader.java index df9620a..4624205 100644 --- a/src/com/sun/org/apache/xerces/internal/impl/io/UTF8Reader.java +++ b/src/com/sun/org/apache/xerces/internal/impl/io/UTF8Reader.java @@ -529,6 +529,16 @@ public class UTF8Reader invalidByte(4, 4, b2); } + // check if output buffer is large enough to hold 2 surrogate chars + if (out + 1 >= ch.length) { + fBuffer[0] = (byte)b0; + fBuffer[1] = (byte)b1; + fBuffer[2] = (byte)b2; + fBuffer[3] = (byte)b3; + fOffset = 4; + return out - offset; + } + // decode bytes into surrogate characters int uuuuu = ((b0 << 2) & 0x001C) | ((b1 >> 4) & 0x0003); if (uuuuu > 0x10) { diff --git a/src/com/sun/org/apache/xerces/internal/impl/msg/SAXMessages_sv.properties b/src/com/sun/org/apache/xerces/internal/impl/msg/SAXMessages_sv.properties index 064c0ce..f7634f2 100644 --- a/src/com/sun/org/apache/xerces/internal/impl/msg/SAXMessages_sv.properties +++ b/src/com/sun/org/apache/xerces/internal/impl/msg/SAXMessages_sv.properties @@ -16,8 +16,8 @@ schema-already-specified = Egenskapen ''{0}'' kan inte anges om ett Schema-objek # feature messages feature-not-supported = Funktionen ''{0}'' st\u00F6ds inte. feature-not-recognized = Funktionen ''{0}'' \u00E4r ok\u00E4nd. -true-not-supported = True-status f\u00F6r funktionen ''{0}'' st\u00F6ds inte. -false-not-supported = False-status f\u00F6r funktionen ''{0}'' st\u00F6ds inte. +true-not-supported = True-tillst\u00E5nd f\u00F6r funktionen ''{0}'' st\u00F6ds inte. +false-not-supported = False-tillst\u00E5nd f\u00F6r funktionen ''{0}'' st\u00F6ds inte. feature-read-only = Funktionen ''{0}'' \u00E4r skrivskyddad. jaxp-secureprocessing-feature = FEATURE_SECURE_PROCESSING: Funktionen kan inte anges till false om s\u00E4kerhetshanteraren anv\u00E4nds. diff --git a/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages.properties b/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages.properties index 24087e2..e3cbc5f 100644 --- a/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages.properties +++ b/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages.properties @@ -294,10 +294,10 @@ # Implementation limits - EntityExpansionLimitExceeded=JAXP00010001: The parser has encountered more than \"{0}\" entity expansions in this document; this is the limit imposed by the JDK. + EntityExpansionLimit=JAXP00010001: The parser has encountered more than \"{0}\" entity expansions in this document; this is the limit imposed by the JDK. ElementAttributeLimit=JAXP00010002: Element \"{0}\" has more than \"{1}\" attributes, \"{1}\" is the limit imposed by the JDK. MaxEntitySizeLimit=JAXP00010003: The length of entity \"{0}\" is \"{1}\" that exceeds the \"{2}\" limit set by \"{3}\". - TotalEntitySizeLimit=JAXP00010004: The accumulated size \"{0}\" of entities exceeded the \"{1}\" limit set by \"{2}\". - MaxXMLNameLimit=JAXP00010005: The name \"{0}\" exceeded the \"{1}\" limit set by \"{2}\". + TotalEntitySizeLimit=JAXP00010004: The accumulated size of entities is \"{1}\" that exceeded the \"{2}\" limit set by \"{3}\". + MaxXMLNameLimit=JAXP00010005: The length of entity \"{0}\" is \"{1}\" that exceeds the \"{2}\" limit set by \"{3}\". MaxElementDepthLimit=JAXP00010006: The element \"{0}\" has a depth of \"{1}\" that exceeds the limit \"{2}\" set by \"{3}\". diff --git a/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_de.properties b/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_de.properties index 905a5bf..efb5115 100644 --- a/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_de.properties +++ b/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_de.properties @@ -294,10 +294,10 @@ # Implementation limits - EntityExpansionLimitExceeded=JAXP00010001: Der Parser hat mehr als {0} Entit\u00E4tserweiterungen in diesem Dokument gefunden. Dies ist der von JDK vorgeschriebene Grenzwert. + EntityExpansionLimit=JAXP00010001: Der Parser hat mehr als {0} Entit\u00E4tserweiterungen in diesem Dokument gefunden. Dies ist der von JDK vorgeschriebene Grenzwert. ElementAttributeLimit=JAXP00010002: Element "{0}" hat mehr als {1} Attribute. "{1}" ist der von JDK vorgeschriebene Grenzwert. MaxEntitySizeLimit=JAXP00010003: Die L\u00E4nge von Entit\u00E4t "{0}" ist "{1}" und \u00FCberschreitet den Grenzwert "{2}", der von "{3}" festgelegt wurde. - TotalEntitySizeLimit=JAXP00010004: Die akkumulierte Gr\u00F6\u00DFe "{0}" der Entit\u00E4ten \u00FCberschreitet den Grenzwert "{1}", der von "{2}" festgelegt wurde. - MaxXMLNameLimit=JAXP00010005: Der Name "{0}" \u00FCberschreitet den Grenzwert "{1}", der von "{2}" festgelegt wurde. + TotalEntitySizeLimit=JAXP00010004: Die akkumulierte Gr\u00F6\u00DFe von Entitys ist "{1}" und \u00FCberschreitet den Grenzwert "{2}", der von "{3}" festgelegt wurde. + MaxXMLNameLimit=JAXP00010005: Die L\u00E4nge von Entity "{0}" ist "{1}" und \u00FCberschreitet den Grenzwert "{2}", der von "{3}" festgelegt wurde. MaxElementDepthLimit=JAXP00010006: Die Tiefe von Element "{0}" ist "{1}" und \u00FCberschreitet den Grenzwert "{2}", der von "{3}" festgelegt wurde. diff --git a/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_es.properties b/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_es.properties index 30cb90a..d784122 100644 --- a/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_es.properties +++ b/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_es.properties @@ -294,10 +294,10 @@ # Implementation limits - EntityExpansionLimitExceeded=JAXP00010001: el analizador ha encontrado m\u00E1s de "{0}"ampliaciones de entidad en este documento; \u00E9ste es el l\u00EDmite impuesto por el JDK. + EntityExpansionLimit=JAXP00010001: el analizador ha encontrado m\u00E1s de "{0}"ampliaciones de entidad en este documento; \u00E9ste es el l\u00EDmite impuesto por el JDK. ElementAttributeLimit=JAXP00010002: el elemento "{0}" tiene m\u00E1s de "{1}" atributos, "{1}" es el l\u00EDmite impuesto por el JDK. MaxEntitySizeLimit=JAXP00010003: la longitud de la entidad "{0}" es "{1}", que excede el l\u00EDmite de "{2}" que ha definido "{3}". - TotalEntitySizeLimit=JAXP00010004: el tama\u00F1o acumulado "{0}" de las entidades ha excedido el l\u00EDmite de "{1}" que ha definido "{2}". - MaxXMLNameLimit=JAXP00010005: el nombre "{0}" ha excedido el l\u00EDmite de "{1}" que ha definido "{2}". + TotalEntitySizeLimit=JAXP00010004: el tama\u00F1o acumulado de las entidades es "{1}" y excede el l\u00EDmite de "{2}" definido por "{3}". + MaxXMLNameLimit=JAXP00010005: la longitud de la entidad "{0}" es "{1}" y excede el l\u00EDmite de "{2}" definido por "{3}". MaxElementDepthLimit=JAXP00010006: El elemento "{0}" tiene una profundidad de "{1}" que excede el l\u00EDmite "{2}" definido por "{3}". diff --git a/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_fr.properties b/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_fr.properties index 6beb135..c409487 100644 --- a/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_fr.properties +++ b/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_fr.properties @@ -294,10 +294,10 @@ # Implementation limits - EntityExpansionLimitExceeded=JAXP00010001 : L''analyseur a rencontr\u00E9 plus de "{0}" d\u00E9veloppements d''entit\u00E9 dans ce document. Il s''agit de la limite impos\u00E9e par le JDK. + EntityExpansionLimit=JAXP00010001 : L''analyseur a rencontr\u00E9 plus de "{0}" d\u00E9veloppements d''entit\u00E9 dans ce document. Il s''agit de la limite impos\u00E9e par le JDK. ElementAttributeLimit=JAXP00010002 : L''\u00E9l\u00E9ment "{0}" a plus de "{1}" attributs. "{1}" est la limite impos\u00E9e par le JDK. MaxEntitySizeLimit=JAXP00010003 : La longueur de l''entit\u00E9 "{0}" est de "{1}". Cette valeur d\u00E9passe la limite de "{2}" d\u00E9finie par "{3}". - TotalEntitySizeLimit=JAXP00010004 : La taille cumul\u00E9e des entit\u00E9s ("{0}") d\u00E9passe la limite de "{1}" d\u00E9finie par "{2}". - MaxXMLNameLimit=JAXP00010005 : le nom "{0}" d\u00E9passe la limite de "{1}" d\u00E9finie par "{2}". + TotalEntitySizeLimit=JAXP00010004 : La taille cumul\u00E9e des entit\u00E9s est "{1}" et d\u00E9passe la limite de "{2}" d\u00E9finie par "{3}". + MaxXMLNameLimit=JAXP00010005 : La longueur de l''entit\u00E9 "{0}" est de "{1}". Cette valeur d\u00E9passe la limite de "{2}" d\u00E9finie par "{3}". MaxElementDepthLimit=JAXP00010006 : l''\u00E9l\u00E9ment "{0}" a une profondeur de "{1}" qui d\u00E9passe la limite de "{2}" d\u00E9finie par "{3}". diff --git a/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_it.properties b/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_it.properties index 6dce952..b2ed881 100644 --- a/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_it.properties +++ b/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_it.properties @@ -294,10 +294,10 @@ # Implementation limits - EntityExpansionLimitExceeded=JAXP00010001: il parser ha rilevato pi\u00F9 "{0}" espansioni di entit\u00E0 nel documento. Questo \u00E8 il limite imposto dal kit JDK. + EntityExpansionLimit=JAXP00010001: il parser ha rilevato pi\u00F9 "{0}" espansioni di entit\u00E0 nel documento. Questo \u00E8 il limite imposto dal kit JDK. ElementAttributeLimit=JAXP00010002: l''elemento "{0}" contiene pi\u00F9 di "{1}" attributi. "{1}" \u00E8 il limite imposto dal kit JDK. MaxEntitySizeLimit=JAXP00010003: la lunghezza dell''entit\u00E0 "{0}" \u00E8 "{1}". Tale valore supera il limite "{2}" definito da "{3}". - TotalEntitySizeLimit=JAXP00010004: le dimensioni accumulate "{0}" delle entit\u00E0 supera il limite "{1}" definito da "{2}". - MaxXMLNameLimit=JAXP00010005: il nome "{0}" supera il limite "{1}" definito da "{2}". + TotalEntitySizeLimit=JAXP00010004: le dimensioni accumulate delle entit\u00E0 sono pari a "{1}". Tale valore supera il limite "{2}" definito da "{3}". + MaxXMLNameLimit=JAXP00010005: la lunghezza dell''entit\u00E0 "{0}" \u00E8 "{1}". Tale valore supera il limite "{2}" definito da "{3}". MaxElementDepthLimit=JAXP00010006: la profondit\u00E0 dell''elemento "{0}" \u00E8 "{1}". Tale valore supera il limite "{2}" definito da "{3}". diff --git a/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_ja.properties b/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_ja.properties index 3256875..aece337 100644 --- a/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_ja.properties +++ b/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_ja.properties @@ -294,10 +294,10 @@ # Implementation limits - EntityExpansionLimitExceeded=JAXP00010001: \u30D1\u30FC\u30B5\u30FC\u306B\u3088\u3063\u3066\u3001\u3053\u306E\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u5185\u3067"{0}"\u3092\u8D85\u3048\u308B\u30A8\u30F3\u30C6\u30A3\u30C6\u30A3\u62E1\u5F35\u304C\u691C\u51FA\u3055\u308C\u307E\u3057\u305F\u3002\u3053\u308C\u306F\u3001JDK\u306B\u3088\u308B\u5236\u9650\u3067\u3059\u3002 + EntityExpansionLimit=JAXP00010001: \u30D1\u30FC\u30B5\u30FC\u306B\u3088\u3063\u3066\u3001\u3053\u306E\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u5185\u3067"{0}"\u3092\u8D85\u3048\u308B\u30A8\u30F3\u30C6\u30A3\u30C6\u30A3\u62E1\u5F35\u304C\u691C\u51FA\u3055\u308C\u307E\u3057\u305F\u3002\u3053\u308C\u306F\u3001JDK\u306B\u3088\u308B\u5236\u9650\u3067\u3059\u3002 ElementAttributeLimit=JAXP00010002: \u8981\u7D20"{0}"\u306B"{1}"\u3092\u8D85\u3048\u308B\u5C5E\u6027\u304C\u5B58\u5728\u3057\u307E\u3059\u3002"{1}"\u306F\u3001JDK\u306B\u3088\u308B\u5236\u9650\u3067\u3059\u3002 MaxEntitySizeLimit=JAXP00010003: \u30A8\u30F3\u30C6\u30A3\u30C6\u30A3"{0}"\u306E\u9577\u3055\u306F"{1}"\u3067\u3001"{3}"\u3067\u8A2D\u5B9A\u3055\u308C\u305F\u5236\u9650"{2}"\u3092\u8D85\u3048\u3066\u3044\u307E\u3059\u3002 - TotalEntitySizeLimit=JAXP00010004: \u30A8\u30F3\u30C6\u30A3\u30C6\u30A3\u306E\u7D2F\u7A4D\u30B5\u30A4\u30BA"{0}"\u306F\u3001"{2}"\u3067\u8A2D\u5B9A\u3055\u308C\u305F\u5236\u9650"{1}"\u3092\u8D85\u3048\u307E\u3057\u305F\u3002 - MaxXMLNameLimit=JAXP00010005: \u540D\u524D"{0}"\u306F\u3001"{2}"\u3067\u8A2D\u5B9A\u3055\u308C\u305F\u5236\u9650"{1}"\u3092\u8D85\u3048\u3066\u3044\u307E\u3059\u3002 + TotalEntitySizeLimit=JAXP00010004: \u30A8\u30F3\u30C6\u30A3\u30C6\u30A3\u306E\u7D2F\u7A4D\u30B5\u30A4\u30BA"{1}"\u306F\u3001"{3}"\u3067\u8A2D\u5B9A\u3055\u308C\u305F\u5236\u9650"{2}"\u3092\u8D85\u3048\u307E\u3057\u305F\u3002 + MaxXMLNameLimit=JAXP00010005: \u30A8\u30F3\u30C6\u30A3\u30C6\u30A3"{0}"\u306E\u9577\u3055\u306F"{1}"\u3067\u3001"{3}"\u3067\u8A2D\u5B9A\u3055\u308C\u305F\u5236\u9650"{2}"\u3092\u8D85\u3048\u3066\u3044\u307E\u3059\u3002 MaxElementDepthLimit=JAXP00010006: \u8981\u7D20"{0}"\u306E\u6DF1\u3055\u306F"{1}"\u3067\u3001"{3}"\u3067\u8A2D\u5B9A\u3055\u308C\u305F\u5236\u9650"{2}"\u3092\u8D85\u3048\u3066\u3044\u307E\u3059\u3002 diff --git a/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_ko.properties b/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_ko.properties index 961d4a1..f992166 100644 --- a/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_ko.properties +++ b/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_ko.properties @@ -294,10 +294,10 @@ # Implementation limits - EntityExpansionLimitExceeded=JAXP00010001: \uAD6C\uBB38 \uBD84\uC11D\uAE30\uAC00 \uC774 \uBB38\uC11C\uC5D0\uC11C "{0}"\uAC1C\uB97C \uCD08\uACFC\uD558\uB294 \uC5D4\uD2F0\uD2F0 \uD655\uC7A5\uC744 \uBC1C\uACAC\uD588\uC2B5\uB2C8\uB2E4. \uC774\uB294 JDK\uC5D0\uC11C \uC801\uC6A9\uD558\uB294 \uC81C\uD55C\uC785\uB2C8\uB2E4. + EntityExpansionLimit=JAXP00010001: \uAD6C\uBB38 \uBD84\uC11D\uAE30\uAC00 \uC774 \uBB38\uC11C\uC5D0\uC11C "{0}"\uAC1C\uB97C \uCD08\uACFC\uD558\uB294 \uC5D4\uD2F0\uD2F0 \uD655\uC7A5\uC744 \uBC1C\uACAC\uD588\uC2B5\uB2C8\uB2E4. \uC774\uB294 JDK\uC5D0\uC11C \uC801\uC6A9\uD558\uB294 \uC81C\uD55C\uC785\uB2C8\uB2E4. ElementAttributeLimit=JAXP00010002: "{0}" \uC694\uC18C\uC5D0 "{1}"\uAC1C\uB97C \uCD08\uACFC\uD558\uB294 \uC18D\uC131\uC774 \uC788\uC2B5\uB2C8\uB2E4. "{1}"\uC740(\uB294) JDK\uC5D0\uC11C \uC801\uC6A9\uD558\uB294 \uC81C\uD55C\uC785\uB2C8\uB2E4. MaxEntitySizeLimit=JAXP00010003: "{0}" \uC5D4\uD2F0\uD2F0\uC758 \uAE38\uC774\uAC00 "{3}"\uC5D0\uC11C \uC124\uC815\uB41C "{2}" \uC81C\uD55C\uC744 \uCD08\uACFC\uD558\uB294 "{1}"\uC785\uB2C8\uB2E4. - TotalEntitySizeLimit=JAXP00010004: \uC5D4\uD2F0\uD2F0\uC758 \uB204\uC801 \uD06C\uAE30 "{0}"\uC774(\uAC00) "{2}"\uC5D0\uC11C \uC124\uC815\uB41C "{1}" \uC81C\uD55C\uC744 \uCD08\uACFC\uD588\uC2B5\uB2C8\uB2E4. - MaxXMLNameLimit=JAXP00010005: "{0}" \uC774\uB984\uC774 "{2}"\uC5D0\uC11C \uC124\uC815\uB41C "{1}" \uC81C\uD55C\uC744 \uCD08\uACFC\uD588\uC2B5\uB2C8\uB2E4. + TotalEntitySizeLimit=JAXP00010004: \uC5D4\uD2F0\uD2F0\uC758 \uB204\uC801 \uD06C\uAE30\uAC00 "{3}"\uC5D0\uC11C \uC124\uC815\uD55C "{2}" \uC81C\uD55C\uC744 \uCD08\uACFC\uD558\uB294 "{1}"\uC785\uB2C8\uB2E4. + MaxXMLNameLimit=JAXP00010005: "{0}" \uC5D4\uD2F0\uD2F0\uC758 \uAE38\uC774\uAC00 "{3}"\uC5D0\uC11C \uC124\uC815\uD55C "{2}" \uC81C\uD55C\uC744 \uCD08\uACFC\uD558\uB294 "{1}"\uC785\uB2C8\uB2E4. MaxElementDepthLimit=JAXP00010006: "{0}" \uC694\uC18C\uC758 \uAE4A\uC774\uAC00 "{3}"\uC5D0\uC11C \uC124\uC815\uB41C "{2}" \uC81C\uD55C\uC744 \uCD08\uACFC\uD558\uB294 "{1}"\uC785\uB2C8\uB2E4. diff --git a/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_pt_BR.properties b/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_pt_BR.properties index 8715895..473ca3e 100644 --- a/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_pt_BR.properties +++ b/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_pt_BR.properties @@ -294,10 +294,10 @@ # Implementation limits - EntityExpansionLimitExceeded=JAXP00010001: O parser detectou mais de "{0}" expans\u00F5es da entidade neste documento. Este \u00E9 o limite imposto pelo JDK. + EntityExpansionLimit=JAXP00010001: O parser detectou mais de "{0}" expans\u00F5es da entidade neste documento. Este \u00E9 o limite imposto pelo JDK. ElementAttributeLimit=JAXP00010002: o elemento "{0}" tem mais de "{1}" atributos. "{1}" \u00E9 o limite imposto pelo JDK. MaxEntitySizeLimit=JAXP00010003: o tamanho da entidade "{0}" \u00E9 "{1}", o que excede o limite de "{2}" definido por "{3}". - TotalEntitySizeLimit=JAXP00010004: o tamanho acumulado "{0}" de entidades excedeu o limite de "{1}" definido por "{2}". - MaxXMLNameLimit=JAXP00010005: o nome "{0}" excedeu o limite de "{1}" definido por "{2}". + TotalEntitySizeLimit=JAXP00010004: o tamanho acumulado de entidades \u00E9 "{1}", o que excedeu o limite de "{2}" definido por "{3}". + MaxXMLNameLimit=JAXP00010005: o tamanho da entidade "{0}" \u00E9 "{1}", o que excede o limite de "{2}" definido por "{3}". MaxElementDepthLimit=JAXP00010006: o elemento "{0}" tem uma profundidade de "{1}" que excede o limite de "{2}" definido por "{3}". diff --git a/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_sv.properties b/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_sv.properties index ccd9631..48fd780 100644 --- a/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_sv.properties +++ b/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_sv.properties @@ -39,8 +39,8 @@ ContentIllegalInProlog = Inneh\u00E5llet \u00E4r inte till\u00E5tet i prologen. ReferenceIllegalInProlog = Referensen \u00E4r inte till\u00E5ten i prologen. # Trailing Misc - ContentIllegalInTrailingMisc=Inneh\u00E5llet \u00E4r inte till\u00E5tet i efterf\u00F6ljande avsnitt. - ReferenceIllegalInTrailingMisc=Referensen \u00E4r inte till\u00E5ten i efterf\u00F6ljande avsnitt. + ContentIllegalInTrailingMisc=Inneh\u00E5llet \u00E4r inte till\u00E5tet i efterf\u00F6ljande sektion. + ReferenceIllegalInTrailingMisc=Referensen \u00E4r inte till\u00E5ten i efterf\u00F6ljande sektion. # 2.9 Standalone Document Declaration SDDeclInvalid = Deklarationsv\u00E4rdet f\u00F6r frist\u00E5ende dokument m\u00E5ste vara "yes" eller "no", inte "{0}". @@ -121,7 +121,7 @@ InvalidByte = Ogiltig byte {0} i UTF-8-sekvensen f\u00F6r {1}-byte. ExpectedByte = F\u00F6rv\u00E4ntad byte {0} i UTF-8-sekvensen f\u00F6r {1}-byte. InvalidHighSurrogate = H\u00F6ga surrogatbitar i UTF-8-sekvens f\u00E5r inte \u00F6verskrida 0x10, men 0x{0} hittades. - OperationNotSupported = Operation "{0}" st\u00F6ds inte i l\u00E4saren {1}. + OperationNotSupported = \u00C5tg\u00E4rden "{0}" st\u00F6ds inte i l\u00E4saren {1}. InvalidASCII = Byte "{0}" ing\u00E5r inte i ASCII-teckenupps\u00E4ttningen (7 bitar). CharConversionFailure = En enhet som fastst\u00E4lls anv\u00E4nda ett visst kodformat f\u00E5r inte inneh\u00E5lla sekvenser som \u00E4r otill\u00E5tna i kodningen. @@ -129,7 +129,7 @@ # 2.2 Characters InvalidCharInEntityValue = Ett ogiltigt XML-tecken (Unicode: 0x{0}) hittades i det litterala enhetsv\u00E4rdet. InvalidCharInExternalSubset = Ett ogiltigt XML-tecken (Unicode: 0x{0}) hittades i den externa delm\u00E4ngden i DTD. - InvalidCharInIgnoreSect = Ett ogiltigt XML-tecken (Unicode: 0x{0}) hittades i exkluderat villkorsavsnitt. + InvalidCharInIgnoreSect = Ett ogiltigt XML-tecken (Unicode: 0x{0}) hittades i sektionen f\u00F6r exkluderade villkor. InvalidCharInPublicID = Ett ogiltigt XML-tecken (Unicode: 0x{0}) hittades i allm\u00E4n identifierare. InvalidCharInSystemID = Ett ogiltigt XML-tecken (Unicode: 0x{0}) hittades i systemidentifierare. # 2.3 Common Syntactic Constructs @@ -183,8 +183,8 @@ # 3.3.2 Attribute Defaults MSG_SPACE_REQUIRED_AFTER_FIXED_IN_DEFAULTDECL = Tomt utrymme m\u00E5ste anges efter "FIXED" i attributdeklarationen "{1}". # 3.4 Conditional Sections - IncludeSectUnterminated = Inkluderat villkorsavsnitt m\u00E5ste avslutas med "]]>". - IgnoreSectUnterminated = Exkluderat villkorsavsnitt m\u00E5ste avslutas med "]]>". + IncludeSectUnterminated = Sektionen f\u00F6r inkluderade villkor m\u00E5ste avslutas med "]]>". + IgnoreSectUnterminated = Sektionen f\u00F6r exkluderade villkor m\u00E5ste avslutas med "]]>". # 4.1 Character and Entity References NameRequiredInPEReference = Enhetsnamnet m\u00E5ste omedelbart f\u00F6ljas av '%' i parameterreferensen. SemicolonRequiredInPEReference = Parameterreferensen "%{0};" m\u00E5ste avslutas med '';''-avgr\u00E4nsare. @@ -226,7 +226,7 @@ ILL_FORMED_PARAMETER_ENTITY_WHEN_USED_IN_DECL = Ers\u00E4ttningstexten f\u00F6r parameterenheten "{0}" m\u00E5ste inkludera korrekt kapslade deklarationer om enhetsreferensen anv\u00E4nds som fullst\u00E4ndig deklaration. ImproperDeclarationNesting = Ers\u00E4ttningstexten f\u00F6r parameterenheten "{0}" m\u00E5ste inkludera deklarationer som \u00E4r korrekt kapslade. ImproperGroupNesting = Ers\u00E4ttningstexten f\u00F6r parameterenheten "{0}" m\u00E5ste inkludera parentespar som \u00E4r korrekt kapslade. - INVALID_PE_IN_CONDITIONAL = Ers\u00E4ttningstexten f\u00F6r parameterenheten "{0}" m\u00E5st inkludera hela villkorsavsnittet eller endast INCLUDE eller IGNORE. + INVALID_PE_IN_CONDITIONAL = Ers\u00E4ttningstexten f\u00F6r parameterenheten "{0}" m\u00E5st inkludera hela villkorssektionen eller endast INCLUDE eller IGNORE. MSG_ATTRIBUTE_NOT_DECLARED = Attributet "{1}" m\u00E5ste deklareras f\u00F6r elementtyp "{0}". MSG_ATTRIBUTE_VALUE_NOT_IN_LIST = Attributet "{0}" med v\u00E4rdet "{1}" m\u00E5ste ha ett v\u00E4rde fr\u00E5n listan "{2}". MSG_ATTVALUE_CHANGED_DURING_NORMALIZATION_WHEN_STANDALONE = V\u00E4rdet "{1}" f\u00F6r attributet "{0}" f\u00E5r inte \u00E4ndras vid normalisering (till "{2}") i ett frist\u00E5ende dokument. @@ -294,10 +294,10 @@ # Implementation limits - EntityExpansionLimitExceeded=JAXP00010001: Parsern har p\u00E5tr\u00E4ffat fler \u00E4n "{0}" enhetstill\u00E4gg i dokumentet - gr\u00E4nsv\u00E4rdet f\u00F6r JDK har uppn\u00E5tts. + EntityExpansionLimit=JAXP00010001: Parsern har p\u00E5tr\u00E4ffat fler \u00E4n "{0}" enhetstill\u00E4gg i dokumentet - gr\u00E4nsv\u00E4rdet f\u00F6r JDK har uppn\u00E5tts. ElementAttributeLimit=JAXP00010002: Elementet "{0}" har fler \u00E4n "{1}" attribut, "{1}" \u00E4r gr\u00E4nsv\u00E4rdet f\u00F6r JDK. MaxEntitySizeLimit=JAXP00010003: L\u00E4ngden p\u00E5 enheten "{0}" \u00E4r "{1}" som \u00F6verskriver gr\u00E4nsv\u00E4rdet p\u00E5 "{2}" som anges av "{3}". - TotalEntitySizeLimit=JAXP00010004: Den ackumulerade storleken "{0}" f\u00F6r enheter \u00F6verskred gr\u00E4nsv\u00E4rdet p\u00E5 "{1}" som anges av "{2}". - MaxXMLNameLimit=JAXP00010005: Namnet "{0}" \u00F6verskred gr\u00E4nsv\u00E4rdet p\u00E5 "{1}" som anges av "{2}". + TotalEntitySizeLimit=JAXP00010004: Den ackumulerade storleken f\u00F6r enheter \u00E4r "{1}", vilket \u00F6verskrider gr\u00E4nsv\u00E4rdet "{2}" som anges av "{3}". + MaxXMLNameLimit=JAXP00010005: L\u00E4ngden p\u00E5 enheten "{0}" \u00E4r "{1}", vilket \u00F6verskrider gr\u00E4nsv\u00E4rdet "{2}" som anges av "{3}". MaxElementDepthLimit=JAXP00010006: Elementet "{0}" har djupet "{1}" vilket \u00E4r st\u00F6rre \u00E4n gr\u00E4nsen "{2}" som anges av "{3}". diff --git a/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_zh_CN.properties b/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_zh_CN.properties index 1003da9..904174d 100644 --- a/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_zh_CN.properties +++ b/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_zh_CN.properties @@ -294,10 +294,10 @@ # Implementation limits - EntityExpansionLimitExceeded=JAXP00010001: \u89E3\u6790\u5668\u5728\u6B64\u6587\u6863\u4E2D\u9047\u5230\u591A\u4E2A "{0}" \u5B9E\u4F53\u6269\u5C55; \u8FD9\u662F JDK \u65BD\u52A0\u7684\u9650\u5236\u3002 + EntityExpansionLimit=JAXP00010001: \u89E3\u6790\u5668\u5728\u6B64\u6587\u6863\u4E2D\u9047\u5230\u591A\u4E2A "{0}" \u5B9E\u4F53\u6269\u5C55; \u8FD9\u662F JDK \u65BD\u52A0\u7684\u9650\u5236\u3002 ElementAttributeLimit=JAXP00010002: \u5143\u7D20 "{0}" \u5177\u6709\u591A\u4E2A "{1}" \u5C5E\u6027, "{1}" \u662F JDK \u65BD\u52A0\u7684\u9650\u5236\u3002 MaxEntitySizeLimit=JAXP00010003: \u5B9E\u4F53 "{0}" \u7684\u957F\u5EA6\u4E3A "{1}", \u8D85\u8FC7\u4E86 "{3}" \u8BBE\u7F6E\u7684 "{2}" \u9650\u5236\u3002 - TotalEntitySizeLimit=JAXP00010004: \u5B9E\u4F53\u7684\u7D2F\u8BA1\u5927\u5C0F "{0}" \u8D85\u8FC7\u4E86 "{2}" \u8BBE\u7F6E\u7684 "{1}" \u9650\u5236\u3002 - MaxXMLNameLimit=JAXP00010005: \u540D\u79F0 "{0}" \u8D85\u8FC7\u4E86 "{2}" \u8BBE\u7F6E\u7684 "{1}" \u9650\u5236\u3002 + TotalEntitySizeLimit=JAXP00010004: \u5B9E\u4F53\u7684\u7D2F\u8BA1\u5927\u5C0F\u4E3A "{1}", \u8D85\u8FC7\u4E86 "{3}" \u8BBE\u7F6E\u7684 "{2}" \u9650\u5236\u3002 + MaxXMLNameLimit=JAXP00010005: \u5B9E\u4F53 "{0}" \u7684\u957F\u5EA6\u4E3A "{1}", \u8D85\u8FC7\u4E86 "{3}" \u8BBE\u7F6E\u7684 "{2}" \u9650\u5236\u3002 MaxElementDepthLimit=JAXP00010006: \u5143\u7D20 "{0}" \u7684\u6DF1\u5EA6 "{1}" \u8D85\u8FC7\u4E86 "{3}" \u8BBE\u7F6E\u7684\u9650\u5236 "{2}"\u3002 diff --git a/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_zh_TW.properties b/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_zh_TW.properties index f76a479..11efb30 100644 --- a/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_zh_TW.properties +++ b/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_zh_TW.properties @@ -294,10 +294,10 @@ # Implementation limits - EntityExpansionLimitExceeded=JAXP00010001: \u5256\u6790\u5668\u5728\u6B64\u6587\u4EF6\u4E2D\u9047\u5230 "{0}" \u500B\u4EE5\u4E0A\u7684\u5BE6\u9AD4\u64F4\u5145; \u9019\u662F JDK \u6240\u898F\u5B9A\u7684\u9650\u5236\u3002 + EntityExpansionLimit=JAXP00010001: \u5256\u6790\u5668\u5728\u6B64\u6587\u4EF6\u4E2D\u9047\u5230 "{0}" \u500B\u4EE5\u4E0A\u7684\u5BE6\u9AD4\u64F4\u5145; \u9019\u662F JDK \u6240\u898F\u5B9A\u7684\u9650\u5236\u3002 ElementAttributeLimit=JAXP00010002: \u5143\u7D20 "{0}" \u5177\u6709\u8D85\u904E "{1}" \u500B\u4EE5\u4E0A\u7684\u5C6C\u6027\uFF0C"{1}" \u662F JDK \u6240\u898F\u5B9A\u7684\u9650\u5236\u3002 MaxEntitySizeLimit=JAXP00010003: \u5BE6\u9AD4 "{0}" \u7684\u9577\u5EA6\u70BA "{1}"\uFF0C\u8D85\u904E "{3}" \u6240\u8A2D\u5B9A\u7684 "{2}" \u9650\u5236\u3002 - TotalEntitySizeLimit=JAXP00010004: \u5BE6\u9AD4\u7684\u7D2F\u7A4D\u5927\u5C0F "{0}" \u8D85\u904E "{2}" \u8A2D\u5B9A\u7684 "{1}" \u9650\u5236\u3002 - MaxXMLNameLimit=JAXP00010005: \u540D\u7A31 "{0}" \u8D85\u904E "{2}" \u8A2D\u5B9A\u7684 "{1}" \u9650\u5236\u3002 + TotalEntitySizeLimit=JAXP00010004: \u5BE6\u9AD4\u7684\u7D2F\u7A4D\u5927\u5C0F\u70BA "{1}"\uFF0C\u8D85\u904E "{3}" \u6240\u8A2D\u5B9A\u7684 "{2}" \u9650\u5236\u3002 + MaxXMLNameLimit=JAXP00010005: \u5BE6\u9AD4 "{0}" \u7684\u9577\u5EA6\u70BA "{1}"\uFF0C\u8D85\u904E "{3}" \u6240\u8A2D\u5B9A\u7684 "{2}" \u9650\u5236\u3002 MaxElementDepthLimit=JAXP00010006: \u5143\u7D20 "{0}" \u7684\u6DF1\u5EA6\u70BA "{1}"\uFF0C\u8D85\u904E "{3}" \u8A2D\u5B9A\u7684 "{2}" \u9650\u5236\u3002 diff --git a/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages.properties b/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages.properties index 6d63ab8..468eb1b 100644 --- a/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages.properties +++ b/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages.properties @@ -282,7 +282,7 @@ FacetValueFromBase = FacetValueFromBase: In the declaration of type ''{0}'', value ''{1}'' of facet ''{2}'' must be from the value space of the base type, ''{3}''. FixedFacetValue = FixedFacetValue: In the definition of {3}, the value ''{1}'' for the facet ''{0}'' is invalid, because the value for ''{0}'' has been set to ''{2}'' in one of the ancestor types, and '{'fixed'}' = true. InvalidRegex = InvalidRegex: Pattern value ''{0}'' is not a valid regular expression. The reported error was: ''{1}'' at column ''{2}''. - maxOccurLimit = Current configuration of the parser doesn''t allow a maxOccurs attribute value to be set greater than the value {0}. + MaxOccurLimit = Current configuration of the parser doesn''t allow a maxOccurs attribute value to be set greater than the value {0}. PublicSystemOnNotation = PublicSystemOnNotation: At least one of ''public'' and ''system'' must appear in element ''notation''. SchemaLocation = SchemaLocation: schemaLocation value = ''{0}'' must have even number of URI''s. TargetNamespace.1 = TargetNamespace.1: Expecting namespace ''{0}'', but the target namespace of the schema document is ''{1}''. diff --git a/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_de.properties b/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_de.properties index e90b195..33a72a3 100644 --- a/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_de.properties +++ b/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_de.properties @@ -8,240 +8,240 @@ # For internal use Internal-Error = Interner Fehler: {0}. - dt-whitespace = Leerstellen-Facet-Wert ist nicht f\u00FCr Vereinigungsmenge simpleType "{0}" verf\u00FCgbar + dt-whitespace = Leerstellen-Facet-Wert ist nicht f\u00FCr Vereinigungsmenge simpleType ''{0}'' verf\u00FCgbar GrammarConflict = Eine vom Grammatikpool des Benutzers zur\u00FCckgegebene Grammatik steht im Konflikt mit einer anderen Grammatik. # Identity constraints - AbsentKeyValue = Identity Constraint-Fehler (cvc-identity-constraint.4.2.1): Element "{0}" hat einen Schl\u00FCssel ohne Wert. - DuplicateField = Doppelte \u00DCbereinstimmung in Geltungsbereich f\u00FCr Feld "{0}". - DuplicateKey = Doppelter Schl\u00FCsselwert [{0}] f\u00FCr Identity Constraint des Elements "{1}" deklariert. - DuplicateUnique = Doppelter eindeutiger Wert [{0}] f\u00FCr Identity Constraint des Elements "{1}" deklariert. - FieldMultipleMatch = Identity Constraint-Fehler: Feld "{0}" entspricht mehreren Werten im Geltungsbereich seines Selectors. Felder m\u00FCssen eindeutigen Werten entsprechen. - FixedDiffersFromActual = Content dieses Elements entspricht nicht dem Wert des "fixed"-Attributs in der Elementdeklaration im Schema. - KeyMatchesNillable = Identity Constraint-Fehler (cvc-identity-constraint.4.2.3): Element "{0}" hat einen Schl\u00FCssel, der einem Element entspricht, bei dem "nillable" auf "true" gesetzt wurde. - KeyNotEnoughValues = Nicht gen\u00FCgend Werte angegeben f\u00FCr <key name="{1}"> Identity Constraint f\u00FCr Element "{0}". - KeyNotFound = Schl\u00FCssel "{0}" mit Wert "{1}" nicht gefunden f\u00FCr Identity Constraint des Elements "{2}". - KeyRefNotEnoughValues = Nicht gen\u00FCgend Werte angegeben f\u00FCr <keyref name="{1}"> Identity Constraint f\u00FCr Element "{0}". - KeyRefOutOfScope = Identity Constraint-Fehler: Identity Constraint "{0}" hat eine keyref, die zu einem Key- oder Unique-Constraint au\u00DFerhalb des Geltungsbereichs verweist. - KeyRefReferNotFound = Schl\u00FCsselreferenzdeklaration "{0}" verweist auf einen unbekannten Schl\u00FCssel mit dem Namen "{1}". - UniqueNotEnoughValues = Nicht gen\u00FCgend Werte angegeben f\u00FCr <unique> Identity Constraint f\u00FCr Element "{0}". - UnknownField = Interner Identity Constraint-Fehler. Unbekanntes Feld "{0}". + AbsentKeyValue = Identity Constraint-Fehler (cvc-identity-constraint.4.2.1): Element ''{0}'' hat einen Schl\u00FCssel ohne Wert. + DuplicateField = Doppelte \u00DCbereinstimmung in Geltungsbereich f\u00FCr Feld ''{0}''. + DuplicateKey = Doppelter Schl\u00FCsselwert [{0}] f\u00FCr Identity Constraint des Elements ''{1}''deklariert. + DuplicateUnique = Doppelter eindeutiger Wert [{0}] f\u00FCr Identity Constraint des Elements ''{1}'' deklariert. + FieldMultipleMatch = Identity Constraint-Fehler: Feld ''{0}'' entspricht mehreren Werten im Geltungsbereich seines Selektors. Felder m\u00FCssen eindeutigen Werten entsprechen. + FixedDiffersFromActual = Content dieses Elements entspricht nicht dem Wert des 'fixed'-Attributs in der Elementdeklaration im Schema. + KeyMatchesNillable = Identity Constraint-Fehler (cvc-identity-constraint.4.2.3): Element ''{0}'' hat einen Schl\u00FCssel, der einem Element entspricht, bei dem ''nillable'' auf ''true'' gesetzt wurde. + KeyNotEnoughValues = Nicht gen\u00FCgend Werte angegeben f\u00FCr <key name=''{1}''> Identity Constraint f\u00FCr Element ''{0}''. + KeyNotFound = Schl\u00FCssel ''{0}'' mit Wert ''{1}'' nicht gefunden f\u00FCr Identity Constraint des Elements ''{2}''. + KeyRefNotEnoughValues = Nicht gen\u00FCgend Werte angegeben f\u00FCr <keyref name=''{1}''> Identity Constraint f\u00FCr Element ''{0}''. + KeyRefOutOfScope = Identity Constraint-Fehler: Identity Constraint ''{0}'' hat eine keyref, die zu einem Key- oder Unique-Constraint au\u00DFerhalb des Geltungsbereichs verweist. + KeyRefReferNotFound = Schl\u00FCsselreferenzdeklaration ''{0}'' verweist auf einen unbekannten Schl\u00FCssel mit dem Namen ''{1}''. + UniqueNotEnoughValues = Nicht gen\u00FCgend Werte angegeben f\u00FCr <unique> Identity Constraint f\u00FCr Element ''{0}''. + UnknownField = Interner Identity Constraint-Fehler. Unbekanntes Feld ''{0}''. # Ideally, we should only use the following error keys, not the ones under # "Identity constraints". And we should cover all of the following errors. #validation (3.X.4) - cvc-attribute.3 = cvc-attribute.3: Wert "{2}" des Attributs "{1}" bei Element "{0}" hat keinen g\u00FCltigen Typ "{3}". - cvc-attribute.4 = cvc-attribute.4: Wert "{2}" des Attributs "{1}" bei Element "{0}" hat keinen g\u00FCltigen festen "{''value constraint''}". Attribute muss den Wert "{3}" haben. - cvc-complex-type.2.1 = cvc-complex-type.2.1: Element "{0}" darf kein Zeichen- oder Elementinformationselement [untergeordnete Elemente] haben, da der Contenttyp des Typs leer ist. - cvc-complex-type.2.2 = cvc-complex-type.2.2: Element "{0}" darf kein Element [untergeordnete Elemente] haben, und der Wert muss g\u00FCltig sein. - cvc-complex-type.2.3 = cvc-complex-type.2.3: Element "{0}" darf keine Zeichen [untergeordnete Elemente] haben, da der Contenttyp des Typs "element-only" ist. - cvc-complex-type.2.4.a = cvc-complex-type.2.4.a: Ung\u00FCltiger Content wurde beginnend mit Element "{0}" gefunden. "{1}" wird erwartet. - cvc-complex-type.2.4.b = cvc-complex-type.2.4.b: Content des Elements "{0}" ist nicht vollst\u00E4ndig. "{1}" wird erwartet. - cvc-complex-type.2.4.c = cvc-complex-type.2.4.c: \u00DCbereinstimmungsplatzhalter ist streng, aber es kann keine Deklaration f\u00FCr Element "{0}" gefunden werden. - cvc-complex-type.2.4.d = cvc-complex-type.2.4.d: Ung\u00FCltiger Content wurde beginnend mit Element "{0}" gefunden. An dieser Stelle wird kein untergeordnetes Element erwartet. - cvc-complex-type.2.4.e = cvc-complex-type.2.4.d: Ung\u00FCltiger Content wurde beginnend mit Element "{0}" gefunden. An dieser Stelle wird kein untergeordnetes Element "{1}" erwartet. - cvc-complex-type.3.1 = cvc-complex-type.3.1: Wert "{2}" des Attributs "{1}" des Elements "{0}" ist ung\u00FCltig in Bezug auf die entsprechende Attributverwendung. Attribut "{1}" hat den festen Wert "{3}". - cvc-complex-type.3.2.1 = cvc-complex-type.3.2.1: Element "{0}" hat keinen Attributplatzhalter f\u00FCr Attribut "{1}". - cvc-complex-type.3.2.2 = cvc-complex-type.3.2.2: Attribut "{1}" darf nicht in Element "{0}" vorkommen. - cvc-complex-type.4 = cvc-complex-type.4: Attribut "{1}" muss in Element "{0}" vorkommen. - cvc-complex-type.5.1 = cvc-complex-type.5.1: In Element "{0}" ist Attribut "{1}" ein Platzhalter. Es ist aber bereits ein Platzhalter "{2}" vorhanden. Nur ein Platzhalter ist zul\u00E4ssig. - cvc-complex-type.5.2 = cvc-complex-type.5.2: In Element "{0}" ist Attribut "{1}" ein Platzhalter. Es ist aber bereits ein Attribut "{2}" vorhanden, das von einer ID unter den "{''attribute uses''}" abgeleitet wurde. - cvc-datatype-valid.1.2.1 = cvc-datatype-valid.1.2.1: "{0}" ist kein g\u00FCltiger Wert f\u00FCr "{1}". - cvc-datatype-valid.1.2.2 = cvc-datatype-valid.1.2.2: "{0}" ist kein g\u00FCltiger Wert des Listentyps "{1}". - cvc-datatype-valid.1.2.3 = cvc-datatype-valid.1.2.3: "{0}" ist kein g\u00FCltiger Wert des Vereinigungsmengentyps "{1}". - cvc-elt.1 = cvc-elt.1: Deklaration des Elements "{0}" kann nicht gefunden werden. - cvc-elt.2 = cvc-elt.2: Wert von "{"abstract"}" in der Elementdeklaration f\u00FCr "{0}" muss "false" sein. - cvc-elt.3.1 = cvc-elt.3.1: Attribut "{1}" darf nicht in Element "{0}" vorkommen, da die die Eigenschaft "{''nillable''}" von "{0}" "false" ist. - cvc-elt.3.2.1 = cvc-elt.3.2.1: Element "{0}" darf keine Zeichen- oder Elementinformationen [untergeordnete Elemente] haben, da "{1}" angegeben wurde. - cvc-elt.3.2.2 = cvc-elt.3.2.2: Es darf kein fester "{"value constraint"}" f\u00FCr Element "{0}" vorhanden sein, da "{1}" angegeben wurde. - cvc-elt.4.1 = cvc-elt.4.1: Wert "{2}" des Attributs "{1}" von Element "{0}" ist kein g\u00FCltiger QName. - cvc-elt.4.2 = cvc-elt.4.2: "{1}" kann nicht als Typdefinition f\u00FCr Element "{0}" aufgel\u00F6st werden. - cvc-elt.4.3 = cvc-elt.4.3: Typ "{1}" wurde nicht auf g\u00FCltige Weise von der Typdefinition "{2}" des Elements "{0}" abgeleitet. - cvc-elt.5.1.1 = cvc-elt.5.1.1: "{"value constraint"}" "{2}" des Elements "{0}" ist kein g\u00FCltiger Standardwert f\u00FCr Typ "{1}". - cvc-elt.5.2.2.1 = cvc-elt.5.2.2.1: Element "{0}" darf keine Elementinformationselemente [untergeordnete Elemente] haben. - cvc-elt.5.2.2.2.1 = cvc-elt.5.2.2.2.1: Wert "{1}" des Elements "{0}" stimmt nicht mit dem festen "{''value constraint''}"-Wert "{2}" \u00FCberein. - cvc-elt.5.2.2.2.2 = cvc-elt.5.2.2.2.2: Wert "{1}" des Elements "{0}" stimmt nicht mit dem "{''value constraint''}"-Wert "{2}" \u00FCberein. - cvc-enumeration-valid = cvc-enumeration-valid: Wert "{0}" ist nicht Facet-g\u00FCltig in Bezug auf Enumeration "{1}". Er muss ein Wert aus der Enumeration sein. - cvc-fractionDigits-valid = cvc-fractionDigits-valid: Wert "{0}" enth\u00E4lt {1} Bruchziffern, die Anzahl an Bruchziffern wurde aber auf {2} beschr\u00E4nkt. - cvc-id.1 = cvc-id.1: Kein ID/IDREF-Binding f\u00FCr IDREF "{0}" vorhanden. - cvc-id.2 = cvc-id.2: ID-Wert "{0}" kommt mehrmals vor. - cvc-id.3 = cvc-id.3: Ein Feld von Identity Constraint "{0}" entsprach Element "{1}". Dieses Element hat aber keinen Simple Type. - cvc-length-valid = cvc-length-valid: Wert "{0}" mit L\u00E4nge = "{1}" ist nicht Facet-g\u00FCltig in Bezug auf die L\u00E4nge "{2}" f\u00FCr Typ "{3}". - cvc-maxExclusive-valid = cvc-maxExclusive-valid: Wert "{0}" ist nicht Facet-g\u00FCltig in Bezug auf maxExclusive "{1}" f\u00FCr Typ "{2}". - cvc-maxInclusive-valid = cvc-maxInclusive-valid: Wert "{0}" ist nicht Facet-g\u00FCltig in Bezug auf maxInclusive "{1}" f\u00FCr Typ "{2}". - cvc-maxLength-valid = cvc-maxLength-valid: Wert "{0}" mit L\u00E4nge = "{1}" ist nicht Facet-g\u00FCltig in Bezug auf maxLength "{2}" f\u00FCr Typ "{3}". - cvc-minExclusive-valid = cvc-minExclusive-valid: Wert "{0}" ist nicht Facet-g\u00FCltig in Bezug auf minExclusive "{1}" f\u00FCr Typ "{2}". - cvc-minInclusive-valid = cvc-minInclusive-valid: Wert "{0}" ist nicht Facet-g\u00FCltig in Bezug auf minInclusive "{1}" f\u00FCr Typ "{2}". - cvc-minLength-valid = cvc-minLength-valid: Wert "{0}" mit L\u00E4nge = "{1}" ist nicht Facet-g\u00FCltig in Bezug auf minLength "{2}" f\u00FCr Typ "{3}". - cvc-pattern-valid = cvc-pattern-valid: Wert "{0}" ist nicht Facet-g\u00FCltig in Bezug auf Muster "{1}" f\u00FCr Typ "{2}". - cvc-totalDigits-valid = cvc-totalDigits-valid: Wert "{0}" enth\u00E4lt {1} Gesamtziffern, die Anzahl an Gesamtziffern wurde aber auf {2} beschr\u00E4nkt. + cvc-attribute.3 = cvc-attribute.3: Wert ''{2}'' des Attributs ''{1}'' bei Element ''{0}'' hat keinen g\u00FCltigen Typ ''{3}''. + cvc-attribute.4 = cvc-attribute.4: Wert ''{2}'' des Attributs ''{1}'' bei Element ''{0}'' hat keinen g\u00FCltigen festen '{'value constraint'}'. Attribute muss den Wert ''{3}'' haben. + cvc-complex-type.2.1 = cvc-complex-type.2.1: Element ''{0}'' darf kein Zeichen- oder Elementinformationselement [untergeordnete Elemente] haben, da der Contenttyp des Typs leer ist. + cvc-complex-type.2.2 = cvc-complex-type.2.2: Element ''{0}'' darf kein Element [untergeordnete Elemente] haben, und der Wert muss g\u00FCltig sein. + cvc-complex-type.2.3 = cvc-complex-type.2.3: Element ''{0}'' darf keine Zeichen [untergeordnete Elemente] haben, da der Contenttyp des Typs ''element-only'' ist. + cvc-complex-type.2.4.a = cvc-complex-type.2.4.a: Ung\u00FCltiger Content wurde beginnend mit Element ''{0}'' gefunden. ''{1}'' wird erwartet. + cvc-complex-type.2.4.b = cvc-complex-type.2.4.b: Content des Elements ''{0}'' ist nicht vollst\u00E4ndig. ''{1}'' wird erwartet. + cvc-complex-type.2.4.c = cvc-complex-type.2.4.c: \u00DCbereinstimmungsplatzhalter ist streng, aber es kann keine Deklaration f\u00FCr Element ''{0}'' gefunden werden. + cvc-complex-type.2.4.d = cvc-complex-type.2.4.d: Ung\u00FCltiger Content wurde beginnend mit Element ''{0}'' gefunden. An dieser Stelle wird kein untergeordnetes Element erwartet. + cvc-complex-type.2.4.e = cvc-complex-type.2.4.d: Ung\u00FCltiger Content wurde beginnend mit Element ''{0}'' gefunden. An dieser Stelle wird kein untergeordnetes Element ''{1}'' erwartet. + cvc-complex-type.3.1 = cvc-complex-type.3.1: Wert ''{2}'' des Attributs ''{1}'' des Elements ''{0}'' ist ung\u00FCltig in Bezug auf die entsprechende Attributverwendung. Attribut ''{1}'' hat den festen Wert ''{3}''. + cvc-complex-type.3.2.1 = cvc-complex-type.3.2.1: Element ''{0}'' hat keinen Attributplatzhalter f\u00FCr Attribut ''{1}''. + cvc-complex-type.3.2.2 = cvc-complex-type.3.2.2: Attribut ''{1}'' darf nicht in Element ''{0}'' vorkommen. + cvc-complex-type.4 = cvc-complex-type.4: Attribut ''{1}'' muss in Element ''{0}'' vorkommen. + cvc-complex-type.5.1 = cvc-complex-type.5.1: In Element ''{0}'' ist Attribut ''{1}'' ein Platzhalter. Es ist aber bereits ein Platzhalter ''{2}'' vorhanden. Nur ein Platzhalter ist zul\u00E4ssig. + cvc-complex-type.5.2 = cvc-complex-type.5.2: In Element ''{0}'' ist Attribut ''{1}'' ein Platzhalter. Es ist aber bereits ein Attribut ''{2}'' vorhanden, das von einer ID unter den '{'attribute uses'}' abgeleitet wurde. + cvc-datatype-valid.1.2.1 = cvc-datatype-valid.1.2.1: ''{0}'' ist kein g\u00FCltiger Wert f\u00FCr ''{1}''. + cvc-datatype-valid.1.2.2 = cvc-datatype-valid.1.2.2: ''{0}'' ist kein g\u00FCltiger Wert des Listentyps ''{1}''. + cvc-datatype-valid.1.2.3 = cvc-datatype-valid.1.2.3: ''{0}'' ist kein g\u00FCltiger Wert des Vereinigungsmengentyps ''{1}''. + cvc-elt.1 = cvc-elt.1: Deklaration des Elements ''{0}'' kann nicht gefunden werden. + cvc-elt.2 = cvc-elt.2: Wert von '{'abstract'}' in der Elementdeklaration f\u00FCr ''{0}'' muss ''false'' sein. + cvc-elt.3.1 = cvc-elt.3.1: Attribut ''{1}'' darf nicht in Element ''{0}'' vorkommen, da die die Eigenschaft '{'nillable'}' von ''{0}'' ''false'' ist. + cvc-elt.3.2.1 = cvc-elt.3.2.1: Element ''{0}'' darf keine Zeichen- oder Elementinformationen [untergeordnete Elemente] haben, da ''{1}'' angegeben wurde. + cvc-elt.3.2.2 = cvc-elt.3.2.2: Es darf kein fester '{'value constraint'}' f\u00FCr Element ''{0}'' vorhanden sein, da ''{1}'' angegeben wurde. + cvc-elt.4.1 = cvc-elt.4.1: Wert ''{2}'' des Attributs ''{1}'' von Element ''{0}'' ist kein g\u00FCltiger QName. + cvc-elt.4.2 = cvc-elt.4.2: ''{1}'' kann nicht als Typdefinition f\u00FCr Element ''{0}'' aufgel\u00F6st werden. + cvc-elt.4.3 = cvc-elt.4.3: Typ ''{1}'' wurde nicht auf g\u00FCltige Weise von der Typdefinition ''{2}'' des Elements ''{0}'' abgeleitet. + cvc-elt.5.1.1 = cvc-elt.5.1.1: '{'value constraint'}' ''{2}'' des Elements ''{0}'' ist kein g\u00FCltiger Standardwert f\u00FCr Typ ''{1}''. + cvc-elt.5.2.2.1 = cvc-elt.5.2.2.1: Element ''{0}'' darf keine Elementinformationselemente [untergeordnete Elemente] haben. + cvc-elt.5.2.2.2.1 = cvc-elt.5.2.2.2.1: Wert ''{1}'' des Elements ''{0}'' stimmt nicht mit dem festen '{'value constraint'}'-Wert ''{2}'' \u00FCberein. + cvc-elt.5.2.2.2.2 = cvc-elt.5.2.2.2.2: Wert ''{1}'' des Elements ''{0}'' stimmt nicht mit dem '{'value constraint'}'-Wert ''{2}'' \u00FCberein. + cvc-enumeration-valid = cvc-enumeration-valid: Wert ''{0}'' ist nicht Facet-g\u00FCltig in Bezug auf Enumeration ''{1}''. Er muss ein Wert aus der Enumeration sein. + cvc-fractionDigits-valid = cvc-fractionDigits-valid: Wert ''{0}'' enth\u00E4lt {1} Bruchziffern, die Anzahl an Bruchziffern wurde aber auf {2} beschr\u00E4nkt. + cvc-id.1 = cvc-id.1: Kein ID/IDREF-Binding f\u00FCr IDREF ''{0}'' vorhanden. + cvc-id.2 = cvc-id.2: ID-Wert ''{0}'' kommt mehrmals vor. + cvc-id.3 = cvc-id.3: Ein Feld von Identity Constraint ''{0}'' entsprach Element ''{1}''. Dieses Element hat aber keinen Simple Type. + cvc-length-valid = cvc-length-valid: Wert ''{0}'' mit L\u00E4nge = ''{1}'' ist nicht Facet-g\u00FCltig in Bezug auf die L\u00E4nge ''{2}'' f\u00FCr Typ ''{3}''. + cvc-maxExclusive-valid = cvc-maxExclusive-valid: Wert ''{0}'' ist nicht Facet-g\u00FCltig in Bezug auf maxExclusive ''{1}'' f\u00FCr Typ ''{2}''. + cvc-maxInclusive-valid = cvc-maxInclusive-valid: Wert ''{0}'' ist nicht Facet-g\u00FCltig in Bezug auf maxInclusive ''{1}'' f\u00FCr Typ ''{2}''. + cvc-maxLength-valid = cvc-maxLength-valid: Wert ''{0}'' mit L\u00E4nge = ''{1}'' ist nicht Facet-g\u00FCltig in Bezug auf maxLength ''{2}'' f\u00FCr Typ ''{3}''. + cvc-minExclusive-valid = cvc-minExclusive-valid: Wert ''{0}'' ist nicht Facet-g\u00FCltig in Bezug auf minExclusive ''{1}'' f\u00FCr Typ ''{2}''. + cvc-minInclusive-valid = cvc-minInclusive-valid: Wert ''{0}'' ist nicht Facet-g\u00FCltig in Bezug auf minInclusive ''{1}'' f\u00FCr Typ ''{2}''. + cvc-minLength-valid = cvc-minLength-valid: Wert ''{0}'' mit L\u00E4nge = ''{1}'' ist nicht Facet-g\u00FCltig in Bezug auf minLength ''{2}'' f\u00FCr Typ ''{3}''. + cvc-pattern-valid = cvc-pattern-valid: Wert ''{0}'' ist nicht Facet-g\u00FCltig in Bezug auf Muster ''{1}'' f\u00FCr Typ ''{2}''. + cvc-totalDigits-valid = cvc-totalDigits-valid: Wert ''{0}'' enth\u00E4lt {1} Gesamtziffern, die Anzahl an Gesamtziffern wurde aber auf {2} beschr\u00E4nkt. cvc-type.2 = cvc-type.2: Typdefinition kann nicht abstrakt f\u00FCr Element {0} sein. - cvc-type.3.1.1 = cvc-type.3.1.1: Element "{0}" ist Simple Type und kann daher keine Attribute haben, mit Ausnahme der Attribute, deren Namespace-Name mit "http://www.w3.org/2001/XMLSchema-instance" identisch ist und deren [lokaler Name] "type", "nil", "schemaLocation" oder "noNamespaceSchemaLocation" lautet. Es wurde allerdings das Attribut "{1}" gefunden. - cvc-type.3.1.2 = cvc-type.3.1.2: Element "{0}" ist Simple Type und darf daher keine Elementinformationselemente [untergeordnete Elemente] haben. - cvc-type.3.1.3 = cvc-type.3.1.3: Wert "{1}" des Elements "{0}" ist ung\u00FCltig. + cvc-type.3.1.1 = cvc-type.3.1.1: Element ''{0}'' ist Simple Type und kann daher keine Attribute haben, mit Ausnahme der Attribute, deren Namespace-Name mit ''http://www.w3.org/2001/XMLSchema-instance'' identisch ist und deren [lokaler Name] ''type'', ''nil'', ''schemaLocation'' oder ''noNamespaceSchemaLocation'' lautet. Es wurde allerdings das Attribut ''{1}'' gefunden. + cvc-type.3.1.2 = cvc-type.3.1.2: Element ''{0}'' ist Simple Type und darf daher keine Elementinformationselemente [untergeordnete Elemente] haben. + cvc-type.3.1.3 = cvc-type.3.1.3: Wert ''{1}'' des Elements ''{0}'' ist ung\u00FCltig. #schema valid (3.X.3) - schema_reference.access = schema_reference: Schemadokument "{0}" konnte nicht gelesen werden, weil der "{1}"-Zugriff wegen der von der Eigenschaft accessExternalSchema festgelegten Einschr\u00E4nkung nicht zul\u00E4ssig ist. - schema_reference.4 = schema_reference.4: Schemadokument "{0}" konnte nicht gelesen werden, da 1) das Dokument nicht gefunden werden konnte; 2) das Dokument nicht gelesen werden konnte; 3) das Root-Element des Dokuments nicht <xsd:schema> ist. - src-annotation = src-annotation: <annotation>-Elemente k\u00F6nnen nur <appinfo>- und <documentation>-Elemente enthalten, aber es wurde "{0}" gefunden. - src-attribute.1 = src-attribute.1: Die Eigenschaften "default" und "fixed" k\u00F6nnen nicht beide in der Attributdeklaration "{0}" vorhanden sein. Verwenden Sie nur eine dieser Eigenschaften. - src-attribute.2 = src-attribute.2: : Eigenschaft "default" ist im Attribut "{0}" vorhanden. Daher muss der Wert von "use" "optional" lauten. - src-attribute.3.1 = src-attribute.3.1: "ref" oder "name" muss in einer lokalen Attributdeklaration vorhanden sein. - src-attribute.3.2 = src-attribute.3.2: Content muss mit (annotation?) f\u00FCr die Attributreferenz "{0}" \u00FCbereinstimmen. - src-attribute.4 = src-attribute.4: Attribut "{0}" hat sowohl das Attribut "type" als auch ein anonymes untergeordnetes Element "simpleType". Nur eins davon ist f\u00FCr Attribute zul\u00E4ssig. - src-attribute_group.2 = src-attribute_group.2: Schnittmenge von Platzhaltern kann nicht f\u00FCr Attributgruppe "{0}" ausgedr\u00FCckt werden. - src-attribute_group.3 = src-attribute_group.3: Zyklische Definitionen f\u00FCr Attributgruppe "{0}" ermittelt. Das rekursive Folgen von Attributgruppenreferenzen f\u00FChrt schlie\u00DFlich zu sich selbst zur\u00FCck. - src-ct.1 = src-ct.1: Darstellungsfehler bei Complex Type-Definition f\u00FCr Typ "{0}". Wenn <complexContent> verwendet wird, muss der Basistyp ein complexType sein. "{1}" ist ein simpleType. - src-ct.2.1 = src-ct.2.1: Darstellungsfehler bei Complex Type-Definition f\u00FCr Typ "{0}". Wenn <simpleContent> verwendet wird, muss der Basistyp ein complexType sein, dessen Contenttyp "simple" ist, oder, wenn eine Einschr\u00E4nkung angegeben wurde, ein "complex"-Typ mit gemischtem Content und einem Partikel, das geleert werden kann, oder, wenn eine Erweiterung angegeben wurde, ein "simple"-Typ. "{1}" erf\u00FCllt keine dieser Bedingungen. - src-ct.2.2 = src-ct.2.2: Darstellungsfehler bei Complex Type-Definition f\u00FCr Typ "{0}". Wenn ein complexType mit simpleContent einen complexType mit gemischtem Content und einem Partikel, das geleert werden kann, einschr\u00E4nkt, muss ein <simpleType> in den untergeordneten Elementen von <restriction> enthalten sein. - src-ct.4 = src-ct.4: Darstellungsfehler bei Complex Type-Definition f\u00FCr Typ "{0}". Die Schnittmenge der Platzhalter kann nicht ausgedr\u00FCckt werden. - src-ct.5 = src-ct.5: Darstellungsfehler bei Complex Type-Definition f\u00FCr Typ "{0}". Die Vereinigungsmenge der Platzhalter kann nicht ausgedr\u00FCckt werden. - src-element.1 = src-element.1: Die Eigenschaften "default" und "fixed" k\u00F6nnen nicht beide in der Elementdeklaration "{0}" vorhanden sein. Verwenden Sie nur eine dieser Eigenschaften. - src-element.2.1 = src-element.2.1: : "ref" oder "name" muss in einer lokalen Elementdeklaration vorhanden sein. - src-element.2.2 = src-element.2.2: Da "{0}" das Attribut "ref" enth\u00E4lt, muss der Content (annotation?) entsprechen. Es wurde allerdings "{1}" gefunden. - src-element.3 = src-element.3: Element "{0}" hat sowohl das Attribut "type" als auch ein untergeordnetes Element "anonymous type". Nur eins davon ist f\u00FCr Elemente zul\u00E4ssig. - src-import.1.1 = src-import.1.1: Namespace-Attribut "{0}" eines <import>-Elementinformationselements darf nicht mit dem targetNamespace des Schemas identisch sein, in dem es vorhanden ist. + schema_reference.access = schema_reference: Schemadokument ''{0}'' konnte nicht gelesen werden, weil der ''{1}''-Zugriff wegen der von der Eigenschaft accessExternalSchema festgelegten Einschr\u00E4nkung nicht zul\u00E4ssig ist. + schema_reference.4 = schema_reference.4: Schemadokument ''{0}'' konnte nicht gelesen werden, da 1) das Dokument nicht gefunden werden konnte; 2) das Dokument nicht gelesen werden konnte; 3) das Root-Element des Dokuments nicht <xsd:schema> ist. + src-annotation = src-annotation: <annotation>-Elemente k\u00F6nnen nur <appinfo>- und <documentation>-Elemente enthalten, aber es wurde ''{0}'' gefunden. + src-attribute.1 = src-attribute.1: Die Eigenschaften ''default'' und ''fixed'' k\u00F6nnen nicht beide in der Attributdeklaration ''{0}'' vorhanden sein. Verwenden Sie nur eine dieser Eigenschaften. + src-attribute.2 = src-attribute.2: : Eigenschaft ''default'' ist im Attribut ''{0}'' vorhanden. Daher muss der Wert von ''use'' ''optional'' lauten. + src-attribute.3.1 = src-attribute.3.1: 'ref' oder 'name' muss in einer lokalen Attributdeklaration vorhanden sein. + src-attribute.3.2 = src-attribute.3.2: Content muss mit (annotation?) f\u00FCr die Attributreferenz ''{0}'' \u00FCbereinstimmen. + src-attribute.4 = src-attribute.4: Attribut ''{0}'' hat sowohl das Attribut ''type'' als auch ein anonymes untergeordnetes Element ''simpleType''. Nur eins davon ist f\u00FCr Attribute zul\u00E4ssig. + src-attribute_group.2 = src-attribute_group.2: Schnittmenge von Platzhaltern kann nicht f\u00FCr Attributgruppe ''{0}'' ausgedr\u00FCckt werden. + src-attribute_group.3 = src-attribute_group.3: Zyklische Definitionen f\u00FCr Attributgruppe ''{0}'' ermittelt. Das rekursive Folgen von Attributgruppenreferenzen f\u00FChrt schlie\u00DFlich zu sich selbst zur\u00FCck. + src-ct.1 = src-ct.1: Darstellungsfehler bei Complex Type-Definition f\u00FCr Typ ''{0}''. Wenn <complexContent> verwendet wird, muss der Basistyp ein complexType sein. ''{1}'' ist ein simpleType. + src-ct.2.1 = src-ct.2.1: Darstellungsfehler bei Complex Type-Definition f\u00FCr Typ ''{0}''. Wenn <simpleContent> verwendet wird, muss der Basistyp ein complexType sein, dessen Contenttyp ''simple'' ist, oder, wenn eine Einschr\u00E4nkung angegeben wurde, ein ''complex''-Typ mit gemischtem Content und einem Partikel, das geleert werden kann, oder, wenn eine Erweiterung angegeben wurde, ein ''simple''-Typ. ''{1}'' erf\u00FCllt keine dieser Bedingungen. + src-ct.2.2 = src-ct.2.2: Darstellungsfehler bei Complex Type-Definition f\u00FCr Typ ''{0}''. Wenn ein complexType mit simpleContent einen complexType mit gemischtem Content und einem Partikel, das geleert werden kann, einschr\u00E4nkt, muss ein <simpleType> in den untergeordneten Elementen von <restriction> enthalten sein. + src-ct.4 = src-ct.4: Darstellungsfehler bei Complex Type-Definition f\u00FCr Typ ''{0}''. Die Schnittmenge der Platzhalter kann nicht ausgedr\u00FCckt werden. + src-ct.5 = src-ct.5: Darstellungsfehler bei Complex Type-Definition f\u00FCr Typ ''{0}''. Die Vereinigungsmenge der Platzhalter kann nicht ausgedr\u00FCckt werden. + src-element.1 = src-element.1: Die Eigenschaften ''default'' und ''fixed'' k\u00F6nnen nicht beide in der Elementdeklaration ''{0}'' vorhanden sein. Verwenden Sie nur eine dieser Eigenschaften. + src-element.2.1 = src-element.2.1: : 'ref' oder 'name' muss in einer lokalen Elementdeklaration vorhanden sein. + src-element.2.2 = src-element.2.2: Da ''{0}'' das Attribut ''ref'' enth\u00E4lt, muss der Content (annotation?) entsprechen. Es wurde allerdings ''{1}'' gefunden. + src-element.3 = src-element.3: Element ''{0}'' hat sowohl das Attribut ''type'' als auch ein untergeordnetes Element ''anonymous type''. Nur eins davon ist f\u00FCr Elemente zul\u00E4ssig. + src-import.1.1 = src-import.1.1: Namespace-Attribut ''{0}'' eines <import>-Elementinformationselements darf nicht mit dem targetNamespace des Schemas identisch sein, in dem es vorhanden ist. src-import.1.2 = src-import.1.2: Wenn das Namespace-Attribut nicht bei einem <import>-Elementinformationselement vorhanden ist, muss das einschlie\u00DFende Schema einen targetNamespace haben. - src-import.2 = src-import.2: Das Root-Element des Dokuments "{0}" muss den Namespace-Namen "http://www.w3.org/2001/XMLSchema" und den lokalen Namen "schema" haben. - src-import.3.1 = src-import.3.1: Namespace-Attribut "{0}" eines <import>-Elementinformationselements muss mit dem targetNamespace-Attribut "{1}" des importierten Dokuments identisch sein. - src-import.3.2 = src-import.3.2: Es wurde ein <import>-Elementinformationselement ohne Namespace-Attribut gefunden. Daher kann das importierte Dokument kein targetNamespace-Attribut haben. targetNamespace "{1}" wurde aber im importierten Dokument gefunden. - src-include.1 = src-include.1: Das Root-Element des Dokuments "{0}" muss den Namespace-Namen "http://www.w3.org/2001/XMLSchema" und den lokalen Namen "schema" haben. - src-include.2.1 = src-include.2.1: targetNamespace des referenzierten Schemas (derzeit "{1}") muss mit dem im umfassenden Schema (derzeit "{0}") identisch sein. - src-redefine.2 = src-redefine.2: Das Root-Element des Dokuments "{0}" muss den Namespace-Namen "http://www.w3.org/2001/XMLSchema" und den lokalen Namen "schema" haben. - src-redefine.3.1 = src-redefine.3.1: targetNamespace des referenzierten Schemas (derzeit "{1}") muss mit dem im neu definierenden Schema (derzeit "{0}") identisch sein. - src-redefine.5.a.a = src-redefine.5.a.a: Keine untergeordneten Nicht-Annotationselemente von <simpleType> gefunden. Untergeordnete <simpleType>-Elemente von <redefine>-Elementen m\u00FCssen <restriction>-Nachkommen mit "base"-Attributen haben, die auf sich selbst verweisen. - src-redefine.5.a.b = src-redefine.5.a.b: "{0}" ist kein g\u00FCltiges untergeordnetes Element. Untergeordnete <simpleType>-Elemente von <redefine>-Elementen m\u00FCssen <restriction>-Nachkommen mit "base"-Attributen haben, die auf sich selbst verweisen. - src-redefine.5.a.c = src-redefine.5.a.c: "{0}" hat kein "base"-Attribut, das auf das neu definierte Element "{1}" verweist. Untergeordnete <simpleType>-Elemente von <redefine>-Elementen m\u00FCssen <restriction>-Nachkommen mit "base"-Attributen haben, die auf sich selbst verweisen. - src-redefine.5.b.a = src-redefine.5.b.a: Keine untergeordneten Nicht-Annotationselemente von <complexType> gefunden. Untergeordnete <complexType>-Elemente von <redefine>-Elementen m\u00FCssen <extension>- oder <restriction>-Nachkommen mit "base"-Attributen haben, die auf sich selbst verweisen. - src-redefine.5.b.b = src-redefine.5.b.b: Keine untergeordneten Nicht-Annotationselemente der zweiten Generation von <complexType> gefunden. Untergeordnete <complexType>-Elemente von <redefine>-Elementen m\u00FCssen <extension>- oder <restriction>-Nachkommen mit "base"-Attributen haben, die auf sich selbst verweisen. - src-redefine.5.b.c = src-redefine.5.b.c: "{0}" ist kein g\u00FCltiges untergeordnetes Element der zweiten Generation. Untergeordnete <complexType>-Elemente von <redefine>-Elementen m\u00FCssen <extension>- oder <restriction>-Nachkommen mit "base"-Attributen haben, die auf sich selbst verweisen. - src-redefine.5.b.d = src-redefine.5.b.d: "{0}" hat kein "base"-Attribut, das auf das neu definierte Element "{1}" verweist. Untergeordnete <complexType>-Elemente von <redefine>-Elementen m\u00FCssen <extension>- oder <restriction>-Nachkommen mit "base"-Attributen haben, die auf sich selbst verweisen. - src-redefine.6.1.1 = src-redefine.6.1.1: Wenn ein untergeordnetes Gruppenelement eines <redefine>-Elements eine Gruppe enth\u00E4lt, die auf sich selbst verweist, muss genau 1 vorhanden sein. Hier sind "{0}" vorhanden. - src-redefine.6.1.2 = src-redefine.6.1.2: Bei Gruppe "{0}", die eine Referenz zu einer Gruppe enth\u00E4lt, die neu definiert wird, muss "minOccurs" = "maxOccurs" = 1 gelten. - src-redefine.6.2.1 = src-redefine.6.2.1: Keine Gruppe im neu definierten Schema hat einen Namen, der "{0}" entspricht. - src-redefine.6.2.2 = src-redefine.6.2.2: Gruppe "{0}" schr\u00E4nkt die Gruppe, die neu definiert wird, nicht ordnungsgem\u00E4\u00DF ein. Verletzter Constraint: "{1}". + src-import.2 = src-import.2: Das Root-Element des Dokuments ''{0}'' muss den Namespace-Namen ''http://www.w3.org/2001/XMLSchema'' und den lokalen Namen ''schema'' haben. + src-import.3.1 = src-import.3.1: Namespace-Attribut ''{0}'' eines <import>-Elementinformationselements muss mit dem targetNamespace-Attribut ''{1}'' des importierten Dokuments identisch sein. + src-import.3.2 = src-import.3.2: Es wurde ein <import>-Elementinformationselement ohne Namespace-Attribut gefunden. Daher kann das importierte Dokument kein targetNamespace-Attribut haben. targetNamespace ''{1}'' wurde aber im importierten Dokument gefunden. + src-include.1 = src-include.1: Das Root-Element des Dokuments ''{0}'' muss den Namespace-Namen ''http://www.w3.org/2001/XMLSchema'' und den lokalen Namen ''schema'' haben. + src-include.2.1 = src-include.2.1: targetNamespace des referenzierten Schemas, derzeit ''{1}'', muss mit dem im umfassenden Schema, derzeit ''{0}'', identisch sein. + src-redefine.2 = src-redefine.2: Das Root-Element des Dokuments ''{0}'' muss den Namespace-Namen ''http://www.w3.org/2001/XMLSchema'' und den lokalen Namen ''schema'' haben. + src-redefine.3.1 = src-redefine.3.1: targetNamespace des referenzierten Schemas, derzeit ''{1}'', muss mit dem im neu definierenden Schema, derzeit ''{0}'', identisch sein. + src-redefine.5.a.a = src-redefine.5.a.a: Keine untergeordneten Nicht-Annotationselemente von <simpleType> gefunden. Untergeordnete <simpleType>-Elemente von <redefine>-Elementen m\u00FCssen <restriction>-Nachkommen mit 'base'-Attributen haben, die auf sich selbst verweisen. + src-redefine.5.a.b = src-redefine.5.a.b: ''{0}'' ist kein g\u00FCltiges untergeordnetes Element. Untergeordnete <simpleType>-Elemente von <redefine>-Elementen m\u00FCssen <restriction>-Nachkommen mit ''base''-Attributen haben, die auf sich selbst verweisen. + src-redefine.5.a.c = src-redefine.5.a.c: ''{0}'' hat kein ''base''-Attribut, das auf das neu definierte Element ''{1}'' verweist. Untergeordnete <simpleType>-Elemente von <redefine>-Elementen m\u00FCssen <restriction>-Nachkommen mit ''base''-Attributen haben, die auf sich selbst verweisen. + src-redefine.5.b.a = src-redefine.5.b.a: Keine untergeordneten Nicht-Annotationselemente von <complexType> gefunden. Untergeordnete <complexType>-Elemente von <redefine>-Elementen m\u00FCssen <extension>- oder <restriction>-Nachkommen mit 'base'-Attributen haben, die auf sich selbst verweisen. + src-redefine.5.b.b = src-redefine.5.b.b: Keine untergeordneten Nicht-Annotationselemente der zweiten Generation von <complexType> gefunden. Untergeordnete <complexType>-Elemente von <redefine>-Elementen m\u00FCssen <extension>- oder <restriction>-Nachkommen mit 'base'-Attributen haben, die auf sich selbst verweisen. + src-redefine.5.b.c = src-redefine.5.b.c: ''{0}'' ist kein g\u00FCltiges untergeordnetes Element der zweiten Generation. Untergeordnete <complexType>-Elemente von <redefine>-Elementen m\u00FCssen <extension>- oder <restriction>-Nachkommen mit ''base''-Attributen haben, die auf sich selbst verweisen. + src-redefine.5.b.d = src-redefine.5.b.d: ''{0}'' hat kein ''base''-Attribut, das auf das neu definierte Element ''{1}'' verweist. Untergeordnete <complexType>-Elemente von <redefine>-Elementen m\u00FCssen <extension>- oder <restriction>-Nachkommen mit ''base''-Attributen haben, die auf sich selbst verweisen. + src-redefine.6.1.1 = src-redefine.6.1.1: Wenn ein untergeordnetes Gruppenelement eines <redefine>-Elements eine Gruppe enth\u00E4lt, die auf sich selbst verweist, muss genau 1 vorhanden sein. Hier sind ''{0}'' vorhanden. + src-redefine.6.1.2 = src-redefine.6.1.2: Bei Gruppe ''{0}'', die eine Referenz zu einer Gruppe enth\u00E4lt, die neu definiert wird, muss ''minOccurs'' = ''maxOccurs'' = 1 gelten. + src-redefine.6.2.1 = src-redefine.6.2.1: Keine Gruppe im neu definierten Schema hat einen Namen, der ''{0}'' entspricht. + src-redefine.6.2.2 = src-redefine.6.2.2: Gruppe ''{0}'' schr\u00E4nkt die Gruppe, die neu definiert wird, nicht ordnungsgem\u00E4\u00DF ein. Verletzter Constraint: ''{1}''. src-redefine.7.1 = src-redefine.7.1: Wenn ein untergeordnetes attributeGroup-Element eines <redefine>-Elements eine attributeGroup enth\u00E4lt, die auf sich selbst verweist, muss genau 1 vorhanden sein. Hier sind {0} vorhanden. - src-redefine.7.2.1 = src-redefine.7.2.1: Keine attributeGroup im neu definierten Schema hat einen Namen, der "{0}" entspricht. - src-redefine.7.2.2 = src-redefine.7.2.2: attributeGroup "{0}" schr\u00E4nkt die attributeGroup, die neu definiert wird, nicht ordnungsgem\u00E4\u00DF ein. Verletzter Constraint: "{1}". - src-resolve = src-resolve: Name "{0}" kann nicht als "{1}"-Komponente aufgel\u00F6st werden. - src-resolve.4.1 = src-resolve.4.1: Fehler beim Aufl\u00F6sen von Komponente "{2}". Es wurde ermittelt, dass "{2}" keinen Namespace hat, aber Komponenten ohne Ziel-Namespace k\u00F6nnen nicht aus Schemadokument "{0}" referenziert werden. Wenn "{2}" einen Namespace haben soll, muss m\u00F6glicherweise ein Pr\u00E4fix angegeben werden. Wenn "{2}" keinen Namespace haben soll, muss ein "import" ohne "namespace"-Attribut zu "{0}" hinzugef\u00FCgt werden. - src-resolve.4.2 = src-resolve.4.2: Fehler beim Aufl\u00F6sen von Komponente "{2}". Es wurde ermittelt, dass "{2}" in Namespace "{1}" vorhanden ist, aber Komponenten aus diesem Namespace k\u00F6nnen nicht aus Schemadokument "{0}" referenziert werden. Wenn dies der falsche Namespace ist, muss m\u00F6glicherweise das Pr\u00E4fix von "{2}" ge\u00E4ndert werden. Wenn dies der richtige Namespace ist, muss ein entsprechendes "import"-Tag zu "{0}" hinzugef\u00FCgt werden. - src-simple-type.2.a = src-simple-type.2.a: Es wurde ein <restriction>-Element gefunden, das sowohl ein "base"-[Attribut] als auch ein <simpleType>-Element in seinen [untergeordneten Elementen] enth\u00E4lt. Nur eines davon ist zul\u00E4ssig. - src-simple-type.2.b = src-simple-type.2.b: Es wurde ein <restriction>-Element gefunden, das weder ein "base"-[Attribut] noch ein <simpleType>-Element in seinen [untergeordneten Elementen] enth\u00E4lt. Eines davon ist erforderlich. - src-simple-type.3.a = src-simple-type.3.a: Es wurde ein <list>-Element gefunden, das sowohl ein "itemType"-[Attribut] als auch ein <simpleType>-Element in seinen [untergeordneten Elementen] enth\u00E4lt. Nur eines davon ist zul\u00E4ssig. - src-simple-type.3.b = src-simple-type.3.b: Es wurde ein <list>-Element gefunden, das weder ein "itemType"-[Attribut] noch ein <simpleType>-Element in seinen [untergeordneten Elementen] enth\u00E4lt. Eines davon ist erforderlich. - src-single-facet-value = src-single-facet-value: Facet "{0}" ist mehrmals definiert. + src-redefine.7.2.1 = src-redefine.7.2.1: Keine attributeGroup im neu definierten Schema hat einen Namen, der ''{0}'' entspricht. + src-redefine.7.2.2 = src-redefine.7.2.2: attributeGroup ''{0}'' schr\u00E4nkt die attributeGroup, die neu definiert wird, nicht ordnungsgem\u00E4\u00DF ein. Verletzter Constraint: ''{1}''. + src-resolve = src-resolve: Name ''{0}'' kann nicht als ''{1}''-Komponente aufgel\u00F6st werden. + src-resolve.4.1 = src-resolve.4.1: Fehler beim Aufl\u00F6sen von Komponente ''{2}''. Es wurde ermittelt, dass ''{2}'' keinen Namespace hat, aber Komponenten ohne Ziel-Namespace k\u00F6nnen nicht aus Schemadokument ''{0}'' referenziert werden. Wenn ''{2}'' einen Namespace haben soll, muss m\u00F6glicherweise ein Pr\u00E4fix angegeben werden. Wenn ''{2}'' keinen Namespace haben soll, muss ein ''import'' ohne ''namespace''-Attribut zu ''{0}'' hinzugef\u00FCgt werden. + src-resolve.4.2 = src-resolve.4.2: Fehler beim Aufl\u00F6sen von Komponente ''{2}''. Es wurde ermittelt, dass ''{2}'' in Namespace ''{1}'' vorhanden ist, aber Komponenten aus diesem Namespace k\u00F6nnen nicht aus Schemadokument ''{0}'' referenziert werden. Wenn dies der falsche Namespace ist, muss m\u00F6glicherweise das Pr\u00E4fix von ''{2}'' ge\u00E4ndert werden. Wenn dies der richtige Namespace ist, muss ein entsprechendes ''import''-Tag zu ''{0}'' hinzugef\u00FCgt werden. + src-simple-type.2.a = src-simple-type.2.a: Es wurde ein <restriction>-Element gefunden, das sowohl ein 'base'-[Attribut] als auch ein <simpleType>-Element in seinen [untergeordneten Elementen] enth\u00E4lt. Nur eines davon ist zul\u00E4ssig. + src-simple-type.2.b = src-simple-type.2.b: Es wurde ein <restriction>-Element gefunden, das weder ein 'base'-[Attribut] noch ein <simpleType>-Element in seinen [untergeordneten Elementen] enth\u00E4lt. Eines davon ist erforderlich. + src-simple-type.3.a = src-simple-type.3.a: Es wurde ein <list>-Element gefunden, das sowohl ein 'itemType'-[Attribut] als auch ein <simpleType>-Element in seinen [untergeordneten Elementen] enth\u00E4lt. Nur eines davon ist zul\u00E4ssig. + src-simple-type.3.b = src-simple-type.3.b: Es wurde ein <list>-Element gefunden, das weder ein 'itemType'-[Attribut] noch ein <simpleType>-Element in seinen [untergeordneten Elementen] enth\u00E4lt. Eines davon ist erforderlich. + src-single-facet-value = src-single-facet-value: Facet ''{0}'' ist mehrmals definiert. src-union-memberTypes-or-simpleTypes = src-union-memberTypes-or-simpleTypes: Ein <union>-Element muss entweder ein nicht leeres memberTypes-[Attribut] oder mindestens ein <simpleType>-Element in seinen [untergeordneten Elementen] enthalten. #constraint valid (3.X.6) - ag-props-correct.2 = ag-props-correct.2: Fehler bei Attributgruppe "{0}". Es wurden doppelte Attributverwendungen mit demselben Namen und Ziel-Namespace angegeben. Name der doppelten Attributverwendung lautet "{1}". - ag-props-correct.3 = ag-props-correct.3: Fehler bei Attributgruppe "{0}". Zwei Attributdeklarationen ("{1}" und "{2}") haben Typen, die aus ID abgeleitet wurden. - a-props-correct.2 = a-props-correct.2: Ung\u00FCltiger Werte-Constraint-Wert "{1}" in Attribut "{0}". - a-props-correct.3 = a-props-correct.3: Bei Attribut "{0}" kann "fixed" oder "default" nicht verwendet werden, da die "{''type definition''}" des Attributs "ID" ist oder aus ID abgeleitet wurde. - au-props-correct.2 = au-props-correct.2: In der Attributdeklaration von "{0}" wurde der feste Wert "{1}" angegeben. Wenn also die Attributverwendung, die auf "{0}" verweist, auch einen "{''value constraint''}" hat, muss sie fest sein, und der Wert muss "{1}" lauten. - cos-all-limited.1.2 = cos-all-limited.1.2: Eine "all"-Modellgruppe muss in einem Partikel mit "{'min occurs'}" = "{'max occurs'}" = 1 vorkommen, und dieses Partikel muss zu einem Paar geh\u00F6ren, das den "{'content type'}" einer Complex Type-Definition darstellt. - cos-all-limited.2 = cos-all-limited.2: "{"max occurs"}" eines Elements in einer "all"-Modellgruppe muss 0 oder 1 sein. Der Wert "{0}" f\u00FCr Element "{1}" ist ung\u00FCltig. - cos-applicable-facets = cos-applicable-facets: Facet "{0}" ist nicht zul\u00E4ssig f\u00FCr Typ {1}. - cos-ct-extends.1.1 = cos-ct-extends.1.1: Typ "{0}" wurde durch die Erweiterung von Typ "{1}" abgeleitet. Das Attribut "final" von "{1}" l\u00E4sst die Ableitung durch Erweiterung aber nicht zu. - cos-ct-extends.1.4.3.2.2.1.a = cos-ct-extends.1.4.3.2.2.1.a: Der Contenttyp eines abgeleiteten Typs und der seiner Basis m\u00FCssen beide "mixed" oder "element-only" sein. Typ "{0}" ist "element only", aber sein Basistyp nicht. - cos-ct-extends.1.4.3.2.2.1.b = cos-ct-extends.1.4.3.2.2.1.b: Der Contenttyp eines abgeleiteten Typs und der seiner Basis m\u00FCssen beide "mixed" oder "element-only" sein. Typ "{0}" ist "mixed", aber sein Basistyp nicht. - cos-element-consistent = cos-element-consistent: Fehler bei Typ "{0}". Mehrere Elemente mit Namen "{1}" und unterschiedlichen Typen kommen in der Modellgruppe vor. - cos-list-of-atomic = cos-list-of-atomic: In der Definition von Listentyp "{0}" ist Typ "{1}" ein ung\u00FCltiger Listenelementtyp, da er nicht atomar ist ("{1}" ist entweder ein Listentyp oder ein Vereinigungsmengentyp, der eine Liste enth\u00E4lt). - cos-nonambig = cos-nonambig: {0} und {1} (oder Elemente aus ihrer Substitutionsgruppe) verletzen "Unique Particle Attribution". Bei der Validierung f\u00FCr dieses Schema w\u00FCrde eine Mehrdeutigkeit f\u00FCr diese beiden Partikel erstellt. + ag-props-correct.2 = ag-props-correct.2: Fehler bei Attributgruppe ''{0}''. Es wurden doppelte Attributverwendungen mit demselben Namen und Ziel-Namespace angegeben. Name der doppelten Attributverwendung lautet ''{1}''. + ag-props-correct.3 = ag-props-correct.3: Fehler bei Attributgruppe ''{0}''. Zwei Attributdeklarationen (''{1}'' und ''{2}'') haben Typen, die aus ID abgeleitet wurden. + a-props-correct.2 = a-props-correct.2: Ung\u00FCltiger Werte-Constraint-Wert ''{1}'' in Attribut ''{0}''. + a-props-correct.3 = a-props-correct.3: Bei Attribut ''{0}'' kann ''fixed'' oder ''default'' nicht verwendet werden, da die '{'type definition'}' des Attributs ''ID'' ist oder aus ID abgeleitet wurde. + au-props-correct.2 = au-props-correct.2: In der Attributdeklaration von ''{0}'' wurde der feste Wert ''{1}'' angegeben. Wenn also die Attributverwendung, die auf ''{0}'' verweist, auch einen '{'value constraint'}' hat, muss sie fest sein, und der Wert muss ''{1}'' lauten. + cos-all-limited.1.2 = cos-all-limited.1.2: Eine 'all'-Modellgruppe muss in einem Partikel mit '{'min occurs'}' = '{'max occurs'}' = 1 vorkommen, und dieses Partikel muss zu einem Paar geh\u00F6ren, das den '{'content type'}' einer Complex Type-Definition darstellt. + cos-all-limited.2 = cos-all-limited.2: '{'max occurs'}' eines Elements in einer ''all''-Modellgruppe muss 0 oder 1 sein. Der Wert ''{0}'' f\u00FCr Element ''{1}'' ist ung\u00FCltig. + cos-applicable-facets = cos-applicable-facets: Facet ''{0}'' ist nicht zul\u00E4ssig f\u00FCr Typ {1}. + cos-ct-extends.1.1 = cos-ct-extends.1.1: Typ ''{0}'' wurde durch die Erweiterung von Typ ''{1}'' abgeleitet. Das Attribut ''final'' von ''{1}'' l\u00E4sst die Ableitung durch Erweiterung aber nicht zu. + cos-ct-extends.1.4.3.2.2.1.a = cos-ct-extends.1.4.3.2.2.1.a: Der Contenttyp eines abgeleiteten Typs und der seiner Basis m\u00FCssen beide ''mixed'' oder ''element-only'' sein. Typ ''{0}'' ist ''element only'', aber sein Basistyp nicht. + cos-ct-extends.1.4.3.2.2.1.b = cos-ct-extends.1.4.3.2.2.1.b: Der Contenttyp eines abgeleiteten Typs und der seiner Basis m\u00FCssen beide ''mixed'' oder ''element-only'' sein. Typ ''{0}'' ist ''mixed'', aber sein Basistyp nicht. + cos-element-consistent = cos-element-consistent: Fehler bei Typ ''{0}''. Mehrere Elemente mit Namen ''{1}'' und unterschiedlichen Typen kommen in der Modellgruppe vor. + cos-list-of-atomic = cos-list-of-atomic: In der Definition von Listentyp ''{0}'' ist Typ ''{1}'' ein ung\u00FCltiger Listenelementtyp, da er nicht atomar ist (''{1}'' ist entweder ein Listentyp oder ein Vereinigungsmengentyp, der eine Liste enth\u00E4lt). + cos-nonambig = cos-nonambig: {0} und {1} (oder Elemente aus ihrer Substitutionsgruppe) verletzen ''Unique Particle Attribution''. Bei der Validierung f\u00FCr dieses Schema w\u00FCrde eine Mehrdeutigkeit f\u00FCr diese beiden Partikel erstellt. cos-particle-restrict.a = cos-particle-restrict.a: Abgeleitetes Partikel ist leer, und die Basis kann nicht geleert werden. cos-particle-restrict.b = cos-particle-restrict.b: Basispartikel ist leer, aber das abgeleitete Partikel ist nicht leer. - cos-particle-restrict.2 = cos-particle-restrict.2: Unzul\u00E4ssige Partikeleinschr\u00E4nkung: "{0}". - cos-st-restricts.1.1 = cos-st-restricts.1.1: Typ "{1}" ist atomar. Daher muss die zugeh\u00F6rige "{''base type definition''}" "{0}" eine atomare Simple Type-Definition oder ein integrierter primitiver Datentyp sein. - cos-st-restricts.2.1 = cos-st-restricts.2.1: In der Definition von Listentyp "{0}" ist Typ "{1}" ein ung\u00FCltiger Elementtyp, da er entweder ein Listentyp oder ein Vereinigungsmengentyp ist, der eine Liste enth\u00E4lt. - cos-st-restricts.2.3.1.1 = cos-st-restricts.2.3.1.1: Komponente "{"final"}" der "{"item type definition"}" "{0}" enth\u00E4lt "list". Dies bedeutet, dass "{0}" nicht als Elementtyp f\u00FCr Listentyp "{1}" verwendet werden kann. - cos-st-restricts.3.3.1.1 = cos-st-restricts.3.3.1.1: Komponente "{"final"}" der "{"member type definitions"}" "{0}" enth\u00E4lt "union". Dies bedeutet, dass "{0}" nicht als Mitgliedstyp f\u00FCr Vereinigungsmengentyp "{1}" verwendet werden kann. - cos-valid-default.2.1 = cos-valid-default.2.1: Element "{0}" hat einen Werte-Constraint und muss ein Misch- oder ein einfaches Contentmodell haben. - cos-valid-default.2.2.2 = cos-valid-default.2.2.2: Da Element "{0}" einen "{''value constraint''}" hat und seine Typdefinition einen gemischten "{''content type''}" hat, muss das Partikel des "{''content type''}" geleert werden k\u00F6nnen. - c-props-correct.2 = c-props-correct.2: Kardinalit\u00E4t von Feldern f\u00FCr keyref "{0}" und Schl\u00FCssel "{1}" muss sich gegenseitig entsprechen. - ct-props-correct.3 = ct-props-correct.3: Zyklische Definitionen f\u00FCr Complex Type "{0}" ermittelt. Dies bedeutet, dass "{0}" in der eigenen Typhierarchie enthalten ist. Dies ist ein Fehler. - ct-props-correct.4 = ct-props-correct.4: Fehler bei Typ "{0}". Es wurden doppelte Attributverwendungen mit demselben Namen und Ziel-Namespace angegeben. Name der doppelten Attributverwendung lautet "{1}". - ct-props-correct.5 = ct-props-correct.5: Fehler bei Typ "{0}". Zwei Attributdeklarationen ("{1}" und "{2}") haben Typen, die aus ID abgeleitet wurden. - derivation-ok-restriction.1 = derivation-ok-restriction.1: Typ "{0}" wurde durch die Einschr\u00E4nkung von Typ "{1}" abgeleitet. "{1}" hat aber eine "{''final''}"-Eigenschaft, die die Ableitung durch Einschr\u00E4nkung nicht zul\u00E4sst. - derivation-ok-restriction.2.1.1 = derivation-ok-restriction.2.1.1: Fehler bei Typ "{0}". Attributverwendung "{1}" in diesem Typ hat den "use"-Wert "{2}", der nicht mit dem Wert von "required" in einer \u00FCbereinstimmenden Attributverwendung im Basistyp konsistent ist. - derivation-ok-restriction.2.1.2 = derivation-ok-restriction.2.1.2: Fehler bei Typ "{0}". Attributverwendung "{1}" in diesem Typ hat den Typ "{2}", der nicht auf g\u00FCltige Weise von "{3}" abgeleitet wurde, dem Typ der \u00FCbereinstimmenden Attributverwendung im Basistyp. - derivation-ok-restriction.2.1.3.a = derivation-ok-restriction.2.1.3.a: Fehler bei Typ "{0}". Attributverwendung "{1}" in diesem Typ hat einen effektiven Werte-Constraint, der nicht fest ist, und der effektive Werte-Constraint der \u00FCbereinstimmenden Attributverwendung im Basistyp ist fest. - derivation-ok-restriction.2.1.3.b = derivation-ok-restriction.2.1.3.b: Fehler bei Typ "{0}". Attributverwendung "{1}" in diesem Typ hat einen effektiven festen Werte-Constraint mit dem Wert "{2}". Dies ist nicht mit dem Wert "{3}" f\u00FCr den festen effektiven Werte-Constraint der \u00FCbereinstimmenden Attributverwendung im Basistyp konsistent. - derivation-ok-restriction.2.2.a = derivation-ok-restriction.2.2.a: Fehler bei Typ "{0}". Attributverwendung "{1}" in diesem Typ hat keine \u00FCbereinstimmende Attributverwendung in der Basis, und der Basistyp hat kein Platzhalterattribut. - derivation-ok-restriction.2.2.b = derivation-ok-restriction.2.2.b: Fehler bei Typ "{0}". Attributverwendung "{1}" in diesem Typ hat keine \u00FCbereinstimmende Attributverwendung in der Basis, und der Platzhalter im Basistyp l\u00E4sst den Namespace "{2}" dieser Attributverwendung nicht zu. - derivation-ok-restriction.3 = derivation-ok-restriction.3: Fehler bei Typ "{0}". Bei Attributverwendung "{1}" im Basistyp ist REQUIRED "true", aber es ist keine \u00FCbereinstimmende Attributverwendung im abgeleiteten Typ vorhanden. - derivation-ok-restriction.4.1 = derivation-ok-restriction.4.1: Fehler bei Typ "{0}". Ableitung hat einen Attributplatzhalter, aber die Basis hat keinen. - derivation-ok-restriction.4.2 = derivation-ok-restriction.4.2: Fehler bei Typ "{0}". Platzhalter in der Ableitung ist keine g\u00FCltige Platzhalter-Teilmenge des Platzhalters in der Basis. - derivation-ok-restriction.4.3 = derivation-ok-restriction.4.3: Fehler bei Typ "{0}". Prozesscontent des Platzhalters in der Ableitung ({1}) ist schw\u00E4cher als der Content in der Basis ({2}). - derivation-ok-restriction.5.2.2.1 = derivation-ok-restriction.5.2.2.1: Fehler bei Typ "{0}". Einfacher Contenttyp dieses Typs "{1}" ist keine g\u00FCltige Einschr\u00E4nkung des einfachen Contenttyps der Basis "{2}". - derivation-ok-restriction.5.3.2 = derivation-ok-restriction.5.3.2: Fehler bei Typ "{0}". Contenttyp dieses Typs ist leer, aber der Contenttyps der Basis "{1}" ist nicht leer oder kann nicht geleert werden. - derivation-ok-restriction.5.4.1.2 = derivation-ok-restriction.5.4.1.2: Fehler bei Typ "{0}". Contenttyp dieses Typs ist "mixed", aber der Contenttyps der Basis "{1}" nicht. - derivation-ok-restriction.5.4.2 = derivation-ok-restriction.5.4.2: Fehler bei Typ "{0}". Partikel des Typs ist keine g\u00FCltige Einschr\u00E4nkung des Partikels der Basis. - enumeration-required-notation = enumeration-required-notation: NOTATION-Typ "{0}", der von {2} "{1}" verwendet wird, muss einen Enumerations-Facet-Wert haben, der die von diesem Typ verwendeten Notationselemente angibt. - enumeration-valid-restriction = enumeration-valid-restriction: Enumerationswert "{0}" ist nicht im Wertebereich des Basistyps {1} vorhanden. - e-props-correct.2 = e-props-correct.2: Ung\u00FCltiger Werte-Constraint-Wert "{1}" in Element "{0}". - e-props-correct.4 = e-props-correct.4: "{"type definition"}" von Element "{0}" wurde nicht auf g\u00FCltige Weise von der "{"type definition"}" von substitutionHead "{1}" abgeleitet, oder die "{"substitution group exclusions"}"-Eigenschaft von "{1}" l\u00E4sst diese Ableitung nicht zu. - e-props-correct.5 = e-props-correct.5: "{"value constraint"}" darf nicht bei Element "{0}" vorhanden sein, da die "{"type definition"}" des Elements oder der "{"content type"}" der "{"type definition"}" "ID" ist oder von ID abgeleitet wurde. - e-props-correct.6 = e-props-correct.6: Zyklische Substitutionsgruppe f\u00FCr Element "{0}" ermittelt. - fractionDigits-valid-restriction = fractionDigits-valid-restriction: In der Definition von {2} ist der Wert "{0}" f\u00FCr Facet "fractionDigits" ung\u00FCltig, da er <= dem Wert f\u00FCr "fractionDigits" sein muss, der in einem der Vorg\u00E4ngertypen auf "{1}" gesetzt wurde. - fractionDigits-totalDigits = fractionDigits-totalDigits: In der Definition von {2} ist der Wert "{0}" f\u00FCr Facet "fractionDigits" ung\u00FCltig, da der Wert <= dem Wert f\u00FCr "totalDigits" sein muss, der "{1}" ist. - length-minLength-maxLength.1.1 = length-minLength-maxLength.1.1: Bei Typ {0} gilt es als Fehler, wenn der Wert von length "{1}" kleiner als der Wert von minLength "{2}" ist. + cos-particle-restrict.2 = cos-particle-restrict.2: Unzul\u00E4ssige Partikeleinschr\u00E4nkung: ''{0}''. + cos-st-restricts.1.1 = cos-st-restricts.1.1: Typ ''{1}'' ist atomar. Daher muss die zugeh\u00F6rige '{'base type definition'}' ''{0}'' eine atomare Simple Type-Definition oder ein integrierter primitiver Datentyp sein. + cos-st-restricts.2.1 = cos-st-restricts.2.1: In der Definition von Listentyp ''{0}'' ist Typ ''{1}'' ein ung\u00FCltiger Elementtyp, da er entweder ein Listentyp oder ein Vereinigungsmengentyp ist, der eine Liste enth\u00E4lt. + cos-st-restricts.2.3.1.1 = cos-st-restricts.2.3.1.1: Komponente '{'final'}' der '{'item type definition'}' ''{0}'' enth\u00E4lt ''list''. Dies bedeutet, dass ''{0}'' nicht als Elementtyp f\u00FCr Listentyp ''{1}'' verwendet werden kann. + cos-st-restricts.3.3.1.1 = cos-st-restricts.3.3.1.1: Komponente '{'final'}' der '{'member type definitions'}' ''{0}'' enth\u00E4lt ''union''. Dies bedeutet, dass ''{0}'' nicht als Mitgliedstyp f\u00FCr Vereinigungsmengentyp ''{1}'' verwendet werden kann. + cos-valid-default.2.1 = cos-valid-default.2.1: Element ''{0}'' hat einen Werte-Constraint und muss ein Misch- oder ein einfaches Contentmodell haben. + cos-valid-default.2.2.2 = cos-valid-default.2.2.2: Da Element ''{0}'' einen '{'value constraint'}' hat und seine Typdefinition einen gemischten '{'content type'}' hat, muss das Partikel des '{'content type'}' geleert werden k\u00F6nnen. + c-props-correct.2 = c-props-correct.2: Kardinalit\u00E4t von Feldern f\u00FCr keyref ''{0}'' und Schl\u00FCssel ''{1}'' muss sich gegenseitig entsprechen. + ct-props-correct.3 = ct-props-correct.3: Zyklische Definitionen f\u00FCr Complex Type ''{0}'' ermittelt. Dies bedeutet, dass ''{0}'' in der eigenen Typhierarchie enthalten ist. Dies ist ein Fehler. + ct-props-correct.4 = ct-props-correct.4: Fehler bei Typ ''{0}''. Es wurden doppelte Attributverwendungen mit demselben Namen und Ziel-Namespace angegeben. Name der doppelten Attributverwendung lautet ''{1}''. + ct-props-correct.5 = ct-props-correct.5: Fehler bei Typ ''{0}''. Zwei Attributdeklarationen (''{1}'' und ''{2}'') haben Typen, die aus ID abgeleitet wurden. + derivation-ok-restriction.1 = derivation-ok-restriction.1: Typ ''{0}'' wurde durch die Einschr\u00E4nkung von Typ ''{1}'' abgeleitet. ''{1}'' hat aber eine '{'final'}'-Eigenschaft, die die Ableitung durch Einschr\u00E4nkung nicht zul\u00E4sst. + derivation-ok-restriction.2.1.1 = derivation-ok-restriction.2.1.1: Fehler bei Typ ''{0}''. Attributverwendung ''{1}'' in diesem Typ hat den ''use''-Wert ''{2}'', der nicht mit dem Wert von ''required'' in einer \u00FCbereinstimmenden Attributverwendung im Basistyp konsistent ist. + derivation-ok-restriction.2.1.2 = derivation-ok-restriction.2.1.2: Fehler bei Typ ''{0}''. Attributverwendung ''{1}'' in diesem Typ hat den Typ ''{2}'', der nicht auf g\u00FCltige Weise von ''{3}'' abgeleitet wurde, dem Typ der \u00FCbereinstimmenden Attributverwendung im Basistyp. + derivation-ok-restriction.2.1.3.a = derivation-ok-restriction.2.1.3.a: Fehler bei Typ ''{0}''. Attributverwendung ''{1}'' in diesem Typ hat einen effektiven Werte-Constraint, der nicht fest ist, und der effektive Werte-Constraint der \u00FCbereinstimmenden Attributverwendung im Basistyp ist fest. + derivation-ok-restriction.2.1.3.b = derivation-ok-restriction.2.1.3.b: Fehler bei Typ ''{0}''. Attributverwendung ''{1}'' in diesem Typ hat einen effektiven festen Werte-Constraint mit dem Wert ''{2}''. Dies ist nicht mit dem Wert ''{3}'' f\u00FCr den festen effektiven Werte-Constraint der \u00FCbereinstimmenden Attributverwendung im Basistyp konsistent. + derivation-ok-restriction.2.2.a = derivation-ok-restriction.2.2.a: Fehler bei Typ ''{0}''. Attributverwendung ''{1}'' in diesem Typ hat keine \u00FCbereinstimmende Attributverwendung in der Basis, und der Basistyp hat kein Platzhalterattribut. + derivation-ok-restriction.2.2.b = derivation-ok-restriction.2.2.b: Fehler bei Typ ''{0}''. Attributverwendung ''{1}'' in diesem Typ hat keine \u00FCbereinstimmende Attributverwendung in der Basis, und der Platzhalter im Basistyp l\u00E4sst den Namespace ''{2}'' dieser Attributverwendung nicht zu. + derivation-ok-restriction.3 = derivation-ok-restriction.3: Fehler bei Typ ''{0}''. Bei Attributverwendung ''{1}'' im Basistyp ist REQUIRED ''true'', aber es ist keine \u00FCbereinstimmende Attributverwendung im abgeleiteten Typ vorhanden. + derivation-ok-restriction.4.1 = derivation-ok-restriction.4.1: Fehler bei Typ ''{0}''. Ableitung hat einen Attributplatzhalter, aber die Basis hat keinen. + derivation-ok-restriction.4.2 = derivation-ok-restriction.4.2: Fehler bei Typ ''{0}''. Platzhalter in der Ableitung ist keine g\u00FCltige Platzhalter-Teilmenge des Platzhalters in der Basis. + derivation-ok-restriction.4.3 = derivation-ok-restriction.4.3: Fehler bei Typ ''{0}''. Prozesscontent des Platzhalters in der Ableitung ({1}) ist schw\u00E4cher als der Content in der Basis ({2}). + derivation-ok-restriction.5.2.2.1 = derivation-ok-restriction.5.2.2.1: Fehler bei Typ ''{0}''. Einfacher Contenttyp dieses Typs ''{1}'' ist keine g\u00FCltige Einschr\u00E4nkung des einfachen Contenttyps der Basis ''{2}''. + derivation-ok-restriction.5.3.2 = derivation-ok-restriction.5.3.2: Fehler bei Typ ''{0}''. Contenttyp dieses Typs ist leer, aber der Contenttyps der Basis ''{1}'' ist nicht leer oder kann nicht geleert werden. + derivation-ok-restriction.5.4.1.2 = derivation-ok-restriction.5.4.1.2: Fehler bei Typ ''{0}''. Contenttyp dieses Typs ist ''mixed'', aber der Contenttyps der Basis ''{1}'' nicht. + derivation-ok-restriction.5.4.2 = derivation-ok-restriction.5.4.2: Fehler bei Typ ''{0}''. Partikel des Typs ist keine g\u00FCltige Einschr\u00E4nkung des Partikels der Basis. + enumeration-required-notation = enumeration-required-notation: NOTATION-Typ ''{0}'', der von {2} ''{1}'' verwendet wird, muss einen Enumerations-Facet-Wert haben, der die von diesem Typ verwendeten Notationselemente angibt. + enumeration-valid-restriction = enumeration-valid-restriction: Enumerationswert ''{0}'' ist nicht im Wertebereich des Basistyps {1} vorhanden. + e-props-correct.2 = e-props-correct.2: Ung\u00FCltiger Werte-Constraint-Wert ''{1}'' in Element ''{0}''. + e-props-correct.4 = e-props-correct.4: '{'type definition'}' von Element ''{0}'' wurde nicht auf g\u00FCltige Weise von der '{'type definition'}' von substitutionHead ''{1}'' abgeleitet, oder die '{'substitution group exclusions'}'-Eigenschaft von ''{1}'' l\u00E4sst diese Ableitung nicht zu. + e-props-correct.5 = e-props-correct.5: '{'value constraint'}' darf nicht bei Element ''{0}'' vorhanden sein, da die '{'type definition'}' des Elements oder der '{'content type'}' der '{'type definition'}' ID ist oder von ID abgeleitet wurde. + e-props-correct.6 = e-props-correct.6: Zyklische Substitutionsgruppe f\u00FCr Element ''{0}'' ermittelt. + fractionDigits-valid-restriction = fractionDigits-valid-restriction: In der Definition von {2} ist der Wert ''{0}'' f\u00FCr Facet ''fractionDigits'' ung\u00FCltig, da er <= dem Wert f\u00FCr ''fractionDigits'' sein muss, der in einem der Vorg\u00E4ngertypen auf ''{1}'' gesetzt wurde. + fractionDigits-totalDigits = fractionDigits-totalDigits: In der Definition von {2} ist der Wert ''{0}'' f\u00FCr Facet ''fractionDigits'' ung\u00FCltig, da der Wert <= dem Wert f\u00FCr ''totalDigits'' sein muss, der ''{1}'' ist. + length-minLength-maxLength.1.1 = length-minLength-maxLength.1.1: Bei Typ {0} gilt es als Fehler, wenn der Wert von length ''{1}'' kleiner als der Wert von minLength ''{2}'' ist. length-minLength-maxLength.1.2.a = length-minLength-maxLength.1.2.a: Bei Typ {0} gilt es als Fehler, wenn die Basis kein minLength-Facet hat, wenn die aktuelle Einschr\u00E4nkung das minLength-Facet und die aktuelle Einschr\u00E4nkung oder Basis das length-Facet hat. - length-minLength-maxLength.1.2.b = length-minLength-maxLength.1.2.b: Bei Typ {0} gilt es als Fehler, wenn die aktuelle minLength "{1}" nicht mit der Basis-minLength "{2}" identisch ist. - length-minLength-maxLength.2.1 = length-minLength-maxLength.2.1: Bei Typ {0} gilt es als Fehler, wenn der Wert von length "{1}" gr\u00F6\u00DFer als der Wert von maxLength "{2}" ist. + length-minLength-maxLength.1.2.b = length-minLength-maxLength.1.2.b: Bei Typ {0} gilt es als Fehler, wenn die aktuelle minLength ''{1}'' nicht mit der Basis-minLength ''{2}'' identisch ist. + length-minLength-maxLength.2.1 = length-minLength-maxLength.2.1: Bei Typ {0} gilt es als Fehler, wenn der Wert von length ''{1}'' gr\u00F6\u00DFer als der Wert von maxLength ''{2}'' ist. length-minLength-maxLength.2.2.a = length-minLength-maxLength.2.2.a: Bei Typ {0} gilt es als Fehler, wenn die Basis kein maxLength-Facet hat, wenn die aktuelle Einschr\u00E4nkung das maxLength-Facet und die aktuelle Einschr\u00E4nkung oder Basis das length-Facet hat. - length-minLength-maxLength.2.2.b = length-minLength-maxLength.2.2.b: Bei Typ {0} gilt es als Fehler, wenn die aktuelle maxLength "{1}" nicht mit der Basis-maxLength "{2}" identisch ist. - length-valid-restriction = length-valid-restriction: Fehler bei Typ "{2}". Der Wert von length = "{0}" muss mit dem Wert des Basistyps "{1}" identisch sein. - maxExclusive-valid-restriction.1 = maxExclusive-valid-restriction.1: Fehler bei Typ "{2}". maxExclusive-Wert ="{0}" muss <= maxExclusive des Basistyps "{1}" sein. - maxExclusive-valid-restriction.2 = maxExclusive-valid-restriction.2: Fehler bei Typ "{2}". maxExclusive-Wert ="{0}" muss <= maxInclusive des Basistyps "{1}" sein. - maxExclusive-valid-restriction.3 = maxExclusive-valid-restriction.3: Fehler bei Typ "{2}". maxExclusive-Wert ="{0}" muss > minInclusive des Basistyps "{1}" sein. - maxExclusive-valid-restriction.4 = maxExclusive-valid-restriction.4: Fehler bei Typ "{2}". maxExclusive-Wert ="{0}" muss > minExclusive des Basistyps "{1}" sein. - maxInclusive-maxExclusive = maxInclusive-maxExclusive: Es gilt als Fehler, wenn sowohl maxInclusive als auch maxExclusive f\u00FCr denselben Datentyp angegeben werden. In {2} gilt: maxInclusive = "{0}" und maxExclusive = "{1}". - maxInclusive-valid-restriction.1 = maxInclusive-valid-restriction.1: Fehler bei Typ "{2}". maxInclusive-Wert ="{0}" muss <= maxInclusive des Basistyps "{1}" sein. - maxInclusive-valid-restriction.2 = maxInclusive-valid-restriction.2: Fehler bei Typ "{2}". maxInclusive-Wert ="{0}" muss < maxExclusive des Basistyps "{1}" sein. - maxInclusive-valid-restriction.3 = maxInclusive-valid-restriction.3: Fehler bei Typ "{2}". maxInclusive-Wert ="{0}" muss >= maxInclusive des Basistyps "{1}" sein. - maxInclusive-valid-restriction.4 = maxInclusive-valid-restriction.4: Fehler bei Typ "{2}". maxInclusive-Wert ="{0}" muss > minExclusive des Basistyps "{1}" sein. - maxLength-valid-restriction = maxLength-valid-restriction: In der Definition von {2} muss maxLength-Wert = "{0}" <= dem Wert des Basistyps "{1}" sein. - mg-props-correct.2 = mg-props-correct.2: Zyklische Definitionen f\u00FCr Gruppe "{0}" ermittelt. Rekursives Folgen der "{''term''}"-Werte der Partikel f\u00FChrt zu einem Partikel, dessen "{''term''}" die Gruppe selbst ist. - minExclusive-less-than-equal-to-maxExclusive = minExclusive-less-than-equal-to-maxExclusive: In der Definition von {2} muss minExclusive-Wert = "{0}" <= maxExclusive-Wert = "{1}" sein. - minExclusive-less-than-maxInclusive = minExclusive-less-than-maxInclusive: In der Definition von {2} muss minExclusive-Wert = "{0}" < maxInclusive-Wert = "{1}" sein. - minExclusive-valid-restriction.1 = minExclusive-valid-restriction.1: Fehler bei Typ "{2}". minExclusive-Wert ="{0}" muss >= minExclusive des Basistyps "{1}" sein. - minExclusive-valid-restriction.2 = minExclusive-valid-restriction.2: Fehler bei Typ "{2}". minExclusive-Wert ="{0}" muss <= maxInclusive des Basistyps "{1}" sein. - minExclusive-valid-restriction.3 = minExclusive-valid-restriction.3: Fehler bei Typ "{2}". minExclusive-Wert ="{0}" muss >= minInclusive des Basistyps "{1}" sein. - minExclusive-valid-restriction.4 = minExclusive-valid-restriction.4: Fehler bei Typ "{2}". minExclusive-Wert ="{0}" muss < maxExclusive des Basistyps "{1}" sein. - minInclusive-less-than-equal-to-maxInclusive = minInclusive-less-than-equal-to-maxInclusive: In der Definition von {2} muss minInclusive-Wert = "{0}" <= maxInclusive-Wert = "{1}" sein. - minInclusive-less-than-maxExclusive = minInclusive-less-than-maxExclusive: In der Definition von {2} muss minInclusive-Wert = "{0}" < maxExclusive-Wert = "{1}" sein. - minInclusive-minExclusive = minInclusive-minExclusive: Es gilt als Fehler, wenn sowohl minInclusive als auch minExclusive f\u00FCr denselben Datentyp angegeben werden. In {2} gilt: minInclusive = "{0}" und minExclusive = "{1}". - minInclusive-valid-restriction.1 = minInclusive-valid-restriction.1: Fehler bei Typ "{2}". minInclusive-Wert ="{0}" muss >= minInclusive des Basistyps "{1}" sein. - minInclusive-valid-restriction.2 = minInclusive-valid-restriction.2: Fehler bei Typ "{2}". minInclusive-Wert ="{0}" muss <= maxInclusive des Basistyps "{1}" sein. - minInclusive-valid-restriction.3 = minInclusive-valid-restriction.3: Fehler bei Typ "{2}". minInclusive-Wert ="{0}" muss > minExclusive des Basistyps "{1}" sein. - minInclusive-valid-restriction.4 = minInclusive-valid-restriction.4: Fehler bei Typ "{2}". minInclusive-Wert ="{0}" muss < maxExclusive des Basistyps "{1}" sein. - minLength-less-than-equal-to-maxLength = minLength-less-than-equal-to-maxLength: In der Definition von {2} muss der Wert von minLength = "{0}" < dem Wert von maxLength = "{1}" sein. - minLength-valid-restriction = minLength-valid-restriction: In der Definition von {2} muss minLength = "{0}" >= dem Wert des Basistyps "{1}" sein. - no-xmlns = no-xmlns: {name} einer Attributdeklaration darf nicht mit "xmlns" \u00FCbereinstimmen. - no-xsi = no-xsi: "{"target namespace"}" einer Attributdeklaration darf nicht mit "{0}" \u00FCbereinstimmen. - p-props-correct.2.1 = p-props-correct.2.1: In der Deklaration von "{0}" ist der Wert von "minOccurs" "{1}", er darf aber nicht gr\u00F6\u00DFer als der Wert von "maxOccurs" sein, der "{2}" lautet. + length-minLength-maxLength.2.2.b = length-minLength-maxLength.2.2.b: Bei Typ {0} gilt es als Fehler, wenn die aktuelle maxLength ''{1}'' nicht mit der Basis-maxLength ''{2}'' identisch ist. + length-valid-restriction = length-valid-restriction: Fehler bei Typ ''{2}''. Der Wert von length = ''{0}'' muss mit dem Wert des Basistyps ''{1}'' identisch sein. + maxExclusive-valid-restriction.1 = maxExclusive-valid-restriction.1: Fehler bei Typ ''{2}''. maxExclusive-Wert =''{0}'' muss <= maxExclusive des Basistyps ''{1}'' sein. + maxExclusive-valid-restriction.2 = maxExclusive-valid-restriction.2: Fehler bei Typ ''{2}''. maxExclusive-Wert =''{0}'' muss <= maxInclusive des Basistyps ''{1}'' sein. + maxExclusive-valid-restriction.3 = maxExclusive-valid-restriction.3: Fehler bei Typ ''{2}''. maxExclusive-Wert =''{0}'' muss > minInclusive des Basistyps ''{1}'' sein. + maxExclusive-valid-restriction.4 = maxExclusive-valid-restriction.4: Fehler bei Typ ''{2}''. maxExclusive-Wert =''{0}'' muss > minExclusive des Basistyps ''{1}'' sein. + maxInclusive-maxExclusive = maxInclusive-maxExclusive: Es gilt als Fehler, wenn sowohl maxInclusive als auch maxExclusive f\u00FCr denselben Datentyp angegeben werden. In {2} gilt: maxInclusive = ''{0}'' und maxExclusive = ''{1}''. + maxInclusive-valid-restriction.1 = maxInclusive-valid-restriction.1: Fehler bei Typ ''{2}''. maxInclusive-Wert =''{0}'' muss <= maxInclusive des Basistyps ''{1}'' sein. + maxInclusive-valid-restriction.2 = maxInclusive-valid-restriction.2: Fehler bei Typ ''{2}''. maxInclusive-Wert =''{0}'' muss < maxExclusive des Basistyps ''{1}'' sein. + maxInclusive-valid-restriction.3 = maxInclusive-valid-restriction.3: Fehler bei Typ ''{2}''. maxInclusive-Wert =''{0}'' muss >= maxInclusive des Basistyps ''{1}'' sein. + maxInclusive-valid-restriction.4 = maxInclusive-valid-restriction.4: Fehler bei Typ ''{2}''. maxInclusive-Wert =''{0}'' muss > minExclusive des Basistyps ''{1}'' sein. + maxLength-valid-restriction = maxLength-valid-restriction: In der Definition von {2} muss maxLength-Wert = ''{0}'' <= dem Wert des Basistyps ''{1}'' sein. + mg-props-correct.2 = mg-props-correct.2: Zyklische Definitionen f\u00FCr Gruppe ''{0}'' ermittelt. Rekursives Folgen der '{'term'}'-Werte der Partikel f\u00FChrt zu einem Partikel, dessen '{'term'}' die Gruppe selbst ist. + minExclusive-less-than-equal-to-maxExclusive = minExclusive-less-than-equal-to-maxExclusive: In der Definition von {2} muss minExclusive-Wert = ''{0}'' <= maxExclusive-Wert = ''{1}'' sein. + minExclusive-less-than-maxInclusive = minExclusive-less-than-maxInclusive: In der Definition von {2} muss minExclusive-Wert = ''{0}'' < maxInclusive-Wert = ''{1}'' sein. + minExclusive-valid-restriction.1 = minExclusive-valid-restriction.1: Fehler bei Typ ''{2}''. minExclusive-Wert =''{0}'' muss >= minExclusive des Basistyps ''{1}'' sein. + minExclusive-valid-restriction.2 = minExclusive-valid-restriction.2: Fehler bei Typ ''{2}''. minExclusive-Wert =''{0}'' muss <= maxInclusive des Basistyps ''{1}'' sein. + minExclusive-valid-restriction.3 = minExclusive-valid-restriction.3: Fehler bei Typ ''{2}''. minExclusive-Wert =''{0}'' muss >= minInclusive des Basistyps ''{1}'' sein. + minExclusive-valid-restriction.4 = minExclusive-valid-restriction.4: Fehler bei Typ ''{2}''. minExclusive-Wert =''{0}'' muss < maxExclusive des Basistyps ''{1}'' sein. + minInclusive-less-than-equal-to-maxInclusive = minInclusive-less-than-equal-to-maxInclusive: In der Definition von {2} muss minInclusive-Wert = ''{0}'' <= maxInclusive-Wert = ''{1}'' sein. + minInclusive-less-than-maxExclusive = minInclusive-less-than-maxExclusive: In der Definition von {2} muss minInclusive-Wert = ''{0}'' < maxExclusive-Wert = ''{1}'' sein. + minInclusive-minExclusive = minInclusive-minExclusive: Es gilt als Fehler, wenn sowohl minInclusive als auch minExclusive f\u00FCr denselben Datentyp angegeben werden. In {2} gilt: minInclusive = ''{0}'' und minExclusive = ''{1}''. + minInclusive-valid-restriction.1 = minInclusive-valid-restriction.1: Fehler bei Typ ''{2}''. minInclusive-Wert =''{0}'' muss >= minInclusive des Basistyps ''{1}'' sein. + minInclusive-valid-restriction.2 = minInclusive-valid-restriction.2: Fehler bei Typ ''{2}''. minInclusive-Wert =''{0}'' muss <= maxInclusive des Basistyps ''{1}'' sein. + minInclusive-valid-restriction.3 = minInclusive-valid-restriction.3: Fehler bei Typ ''{2}''. minInclusive-Wert =''{0}'' muss > minExclusive des Basistyps ''{1}'' sein. + minInclusive-valid-restriction.4 = minInclusive-valid-restriction.4: Fehler bei Typ ''{2}''. minInclusive-Wert =''{0}'' muss < maxExclusive des Basistyps ''{1}'' sein. + minLength-less-than-equal-to-maxLength = minLength-less-than-equal-to-maxLength: In der Definition von {2} muss der Wert von minLength = ''{0}'' < dem Wert von maxLength = ''{1}'' sein. + minLength-valid-restriction = minLength-valid-restriction: In der Definition von {2} muss minLength = ''{0}'' >= dem Wert des Basistyps ''{1}'' sein. + no-xmlns = no-xmlns: {name} einer Attributdeklaration darf nicht mit 'xmlns' \u00FCbereinstimmen. + no-xsi = no-xsi: '{'target namespace'}' einer Attributdeklaration darf nicht mit ''{0}'' \u00FCbereinstimmen. + p-props-correct.2.1 = p-props-correct.2.1: In der Deklaration von ''{0}'' ist der Wert von ''minOccurs'' ''{1}'', er darf aber nicht gr\u00F6\u00DFer als der Wert von ''maxOccurs'' sein, der ''{2}'' lautet. rcase-MapAndSum.1 = rcase-MapAndSum.1: Es ist keine vollst\u00E4ndige Funktionszuordnung zwischen den Partikeln vorhanden. rcase-MapAndSum.2 = rcase-MapAndSum.2: Vorkommensbereich der Gruppe ({0},{1}) ist keine g\u00FCltige Einschr\u00E4nkung des Vorkommensbereichs der Basisgruppe ({2},{3}). - rcase-NameAndTypeOK.1 = rcase-NameAndTypeOK.1: Elemente haben Namen und Ziel-Namespaces, die nicht identisch sind: Element "{0}" in Namespace "{1}" und Element "{2}" in Namespace "{3}". - rcase-NameAndTypeOK.2 = rcase-NameAndTypeOK.2: Fehler beim Partikel, dessen "{"term"}" die Elementdeklaration "{0}" ist. "{"nillable"}" ist bei der Elementdeklaration "true", aber das entsprechende Partikel im Basistyp hat eine Elementdeklaration, bei der "{"nillable"}" "false" ist. - rcase-NameAndTypeOK.3 = rcase-NameAndTypeOK.3: Fehler beim Partikel, dessen "{"term"}" die Elementdeklaration "{0}" ist. Der Vorkommensbereich ({1},{2}) ist keine g\u00FCltige Einschr\u00E4nkung des Bereichs ({3},{4}) des entsprechenden Partikels im Basistyp. - rcase-NameAndTypeOK.4.a = rcase-NameAndTypeOK.4.a: Element "{0}" ist nicht fest, aber das entsprechende Element im Basistyp ist fest mit Wert "{1}". - rcase-NameAndTypeOK.4.b = rcase-NameAndTypeOK.4.b: Element "{0}" ist fest mit dem Wert "{1}", aber das entsprechende Element im Basistyp ist fest mit Wert "{2}". - rcase-NameAndTypeOK.5 = rcase-NameAndTypeOK.5: Identity Constraints f\u00FCr Element "{0}" sind keine Teilmenge der Constraints in der Basis. - rcase-NameAndTypeOK.6 = rcase-NameAndTypeOK.6: Die unzul\u00E4ssigen Substitutionen f\u00FCr Element "{0}" sind keine Obermenge der Substitutionen in der Basis. - rcase-NameAndTypeOK.7 = rcase-NameAndTypeOK.7: Typ des Elements "{0}" "{1}" wurde nicht vom Typ des Basiselements "{2}" abgeleitet. - rcase-NSCompat.1 = rcase-NSCompat.1: Element "{0}" hat den Namespace "{1}". Dies wird vom Platzhalter in der Basis nicht zugelassen. - rcase-NSCompat.2 = rcase-NSCompat.2: Fehler beim Partikel, dessen "{"term"}" die Elementdeklaration "{0}" ist. Der Vorkommensbereich ({1},{2}) ist keine g\u00FCltige Einschr\u00E4nkung des Bereichs ({3},{4}) des entsprechenden Partikels im Basistyp. + rcase-NameAndTypeOK.1 = rcase-NameAndTypeOK.1: Elemente haben Namen und Ziel-Namespaces, die nicht identisch sind: Element ''{0}'' in Namespace ''{1}'' und Element ''{2}'' in Namespace ''{3}''. + rcase-NameAndTypeOK.2 = rcase-NameAndTypeOK.2: Fehler beim Partikel, dessen '{'term'}' die Elementdeklaration ''{0}'' ist. '{'nillable'}' ist bei der Elementdeklaration ''true'', aber das entsprechende Partikel im Basistyp hat eine Elementdeklaration, bei der '{'nillable'}' ''false'' ist. + rcase-NameAndTypeOK.3 = rcase-NameAndTypeOK.3: Fehler beim Partikel, dessen '{'term'}' die Elementdeklaration ''{0}'' ist. Der Vorkommensbereich ({1},{2}) ist keine g\u00FCltige Einschr\u00E4nkung des Bereichs ({3},{4}) des entsprechenden Partikels im Basistyp. + rcase-NameAndTypeOK.4.a = rcase-NameAndTypeOK.4.a: Element ''{0}'' ist nicht fest, aber das entsprechende Element im Basistyp ist fest mit Wert ''{1}''. + rcase-NameAndTypeOK.4.b = rcase-NameAndTypeOK.4.b: Element ''{0}'' ist fest mit dem Wert ''{1}'', aber das entsprechende Element im Basistyp ist fest mit Wert ''{2}''. + rcase-NameAndTypeOK.5 = rcase-NameAndTypeOK.5: Identity Constraints f\u00FCr Element ''{0}'' sind keine Teilmenge der Constraints in der Basis. + rcase-NameAndTypeOK.6 = rcase-NameAndTypeOK.6: Die unzul\u00E4ssigen Substitutionen f\u00FCr Element ''{0}'' sind keine Obermenge der Substitutionen in der Basis. + rcase-NameAndTypeOK.7 = rcase-NameAndTypeOK.7: Typ des Elements ''{0}'' ''{1}'' wurde nicht vom Typ des Basiselements ''{2}'' abgeleitet. + rcase-NSCompat.1 = rcase-NSCompat.1: Element ''{0}'' hat den Namespace ''{1}''. Dies wird vom Platzhalter in der Basis nicht zugelassen. + rcase-NSCompat.2 = rcase-NSCompat.2: Fehler beim Partikel, dessen '{'term'}' die Elementdeklaration ''{0}'' ist. Der Vorkommensbereich ({1},{2}) ist keine g\u00FCltige Einschr\u00E4nkung des Bereichs ({3},{4}) des entsprechenden Partikels im Basistyp. rcase-NSRecurseCheckCardinality.1 = rcase-NSRecurseCheckCardinality.1: Es ist keine vollst\u00E4ndige Funktionszuordnung zwischen den Partikeln vorhanden. rcase-NSRecurseCheckCardinality.2 = rcase-NSRecurseCheckCardinality.2: Vorkommensbereich der Gruppe ({0},{1}) ist keine g\u00FCltige Einschr\u00E4nkung des Bereichs des Basisplatzhalters ({2},{3}). rcase-NSSubset.1 = rcase-NSSubset.1: Platzhalter ist keine Teilmenge des entsprechenden Platzhalters in der Basis. rcase-NSSubset.2 = rcase-NSSubset.2: Vorkommensbereich des Platzhalters ({0},{1}) ist keine g\u00FCltige Einschr\u00E4nkung des Bereichs in der Basis ({2},{3}). - rcase-NSSubset.3 = rcase-NSSubset.3: Prozesscontent des Platzhalters ("{0}") ist schw\u00E4cher als der in der Basis "{1}". + rcase-NSSubset.3 = rcase-NSSubset.3: Prozesscontent des Platzhalters (''{0}'') ist schw\u00E4cher als der in der Basis ''{1}''. rcase-Recurse.1 = rcase-Recurse.1: Vorkommensbereich der Gruppe ({0},{1}) ist keine g\u00FCltige Einschr\u00E4nkung des Vorkommensbereichs der Basisgruppe ({2},{3}). rcase-Recurse.2 = rcase-Recurse.2: Es ist keine vollst\u00E4ndige Funktionszuordnung zwischen den Partikeln vorhanden. rcase-RecurseLax.1 = rcase-RecurseLax.1: Vorkommensbereich der Gruppe ({0},{1}) ist keine g\u00FCltige Einschr\u00E4nkung des Vorkommensbereichs der Basisgruppe ({2},{3}). @@ -250,42 +250,42 @@ rcase-RecurseUnordered.2 = rcase-RecurseUnordered.2: Es ist keine vollst\u00E4ndige Funktionszuordnung zwischen den Partikeln vorhanden. # We're using sch-props-correct.2 instead of the old src-redefine.1 # src-redefine.1 = src-redefine.1: The component ''{0}'' is begin redefined, but its corresponding component isn't in the schema document being redefined (with namespace ''{2}''), but in a different document, with namespace ''{1}''. - sch-props-correct.2 = sch-props-correct.2: Ein Schema kann nicht zwei globale Komponenten mit demselben Namen enthalten. Dieses Schema enth\u00E4lt zwei Vorkommen von "{0}". - st-props-correct.2 = st-props-correct.2: Zyklische Definitionen wurden f\u00FCr Simple Type "{0}" ermittelt. Dies bedeutet, dass "{0}" in der eigenen Typhierarchie enthalten ist. Dies ist ein Fehler. - st-props-correct.3 = st-props-correct.3: Fehler bei Typ "{0}". Der Wert von "{''final''}" der "{''base type definition''}" "{1}" l\u00E4sst keine Ableitung durch Einschr\u00E4nkung zu. - totalDigits-valid-restriction = totalDigits-valid-restriction: In der Definition von {2} ist der Wert "{0}" f\u00FCr Facet "totalDigits" ung\u00FCltig, da er <= dem Wert f\u00FCr "totalDigits" sein muss, der in einem der Vorg\u00E4ngertypen auf "{1}" gesetzt wurde. - whiteSpace-valid-restriction.1 = whiteSpace-valid-restriction.1: In der Definition von {0} ist der Wert "{1}" f\u00FCr Facet "whitespace" ung\u00FCltig, da der Wert f\u00FCr "whitespace" in einem der Vorg\u00E4ngertypen auf "collapse" gesetzt wurde. - whiteSpace-valid-restriction.2 = whiteSpace-valid-restriction.2: In der Definition von {0} ist der Wert "preserve" f\u00FCr Facet "whitespace" ung\u00FCltig, da der Wert f\u00FCr "whitespace" in einem der Vorg\u00E4ngertypen auf "replace" gesetzt wurde. + sch-props-correct.2 = sch-props-correct.2: Ein Schema kann nicht zwei globale Komponenten mit demselben Namen enthalten. Dieses Schema enth\u00E4lt zwei Vorkommen von ''{0}''. + st-props-correct.2 = st-props-correct.2: Zyklische Definitionen wurden f\u00FCr Simple Type ''{0}'' ermittelt. Dies bedeutet, dass ''{0}'' in der eigenen Typhierarchie enthalten ist. Dies ist ein Fehler. + st-props-correct.3 = st-props-correct.3: Fehler bei Typ ''{0}''. Der Wert von '{'final'}' der '{'base type definition'}' ''{1}'' l\u00E4sst keine Ableitung durch Einschr\u00E4nkung zu. + totalDigits-valid-restriction = totalDigits-valid-restriction: In der Definition von {2} ist der Wert ''{0}'' f\u00FCr Facet ''totalDigits'' ung\u00FCltig, da er <= dem Wert f\u00FCr ''totalDigits'' sein muss, der in einem der Vorg\u00E4ngertypen auf ''{1}'' gesetzt wurde. + whiteSpace-valid-restriction.1 = whiteSpace-valid-restriction.1: In der Definition von {0} ist der Wert ''{1}'' f\u00FCr Facet ''whitespace'' ung\u00FCltig, da der Wert f\u00FCr ''whitespace'' in einem der Vorg\u00E4ngertypen auf ''collapse'' gesetzt wurde. + whiteSpace-valid-restriction.2 = whiteSpace-valid-restriction.2: In der Definition von {0} ist der Wert ''preserve'' f\u00FCr Facet ''whitespace'' ung\u00FCltig, da der Wert f\u00FCr ''whitespace'' in einem der Vorg\u00E4ngertypen auf ''replace'' gesetzt wurde. #schema for Schemas - s4s-att-invalid-value = s4s-att-invalid-value: Ung\u00FCltiger Attributwert f\u00FCr "{1}" in Element "{0}". Aufgezeichneter Grund: {2} - s4s-att-must-appear = s4s-att-must-appear: Attribut "{1}" muss in Element "{0}" vorkommen. - s4s-att-not-allowed = s4s-att-not-allowed: Attribut "{1}" darf nicht in Element "{0}" vorkommen. - s4s-elt-invalid = s4s-elt-invalid: Element "{0}" ist kein g\u00FCltiges Element in einem Schemadokument. - s4s-elt-must-match.1 = s4s-elt-must-match.1: Content von "{0}" muss {1} entsprechen. Beim Start bei {2} ist ein Problem aufgetreten. - s4s-elt-must-match.2 = s4s-elt-must-match.2: Content von "{0}" muss {1} entsprechen. Nicht gen\u00FCgend Elemente gefunden. + s4s-att-invalid-value = s4s-att-invalid-value: Ung\u00FCltiger Attributwert f\u00FCr ''{1}'' in Element ''{0}''. Aufgezeichneter Grund: {2} + s4s-att-must-appear = s4s-att-must-appear: Attribut ''{1}'' muss in Element ''{0}'' vorkommen. + s4s-att-not-allowed = s4s-att-not-allowed: Attribut ''{1}'' darf nicht in Element ''{0}'' vorkommen. + s4s-elt-invalid = s4s-elt-invalid: Element ''{0}'' ist kein g\u00FCltiges Element in einem Schemadokument. + s4s-elt-must-match.1 = s4s-elt-must-match.1: Content von ''{0}'' muss {1} entsprechen. Beim Start bei {2} ist ein Problem aufgetreten. + s4s-elt-must-match.2 = s4s-elt-must-match.2: Content von ''{0}'' muss {1} entsprechen. Nicht gen\u00FCgend Elemente gefunden. # the "invalid-content" messages provide less information than the "must-match" counterparts above. They're used for complex types when providing a "match" would be an information dump - s4s-elt-invalid-content.1 = s4s-elt-invalid-content.1: Content von "{0}" ist ung\u00FCltig. Element "{1}" ist ung\u00FCltig, nicht an der erwarteten Stelle oder kommt zu oft vor. - s4s-elt-invalid-content.2 = s4s-elt-invalid-content.2: Content von "{0}" ist ung\u00FCltig. Element "{1}" darf nicht leer sein. - s4s-elt-invalid-content.3 = s4s-elt-invalid-content.3: Elemente mit dem Typ "{0}" k\u00F6nnen nicht nach Deklarationen als untergeordnete Elemente eines <schema>-Elements vorkommen. - s4s-elt-schema-ns = s4s-elt-schema-ns: Namespace des Elements "{0}" muss aus dem Schema-Namespace "http://www.w3.org/2001/XMLSchema" stammen. - s4s-elt-character = s4s-elt-character: In anderen Schemaelementen als "xs:appinfo" und "xs:documentation" sind nur Leerstellen zul\u00E4ssig. "{0}" gefunden. + s4s-elt-invalid-content.1 = s4s-elt-invalid-content.1: Content von ''{0}'' ist ung\u00FCltig. Element ''{1}'' ist ung\u00FCltig, nicht an der erwarteten Stelle oder kommt zu oft vor. + s4s-elt-invalid-content.2 = s4s-elt-invalid-content.2: Content von ''{0}'' ist ung\u00FCltig. Element ''{1}'' darf nicht leer sein. + s4s-elt-invalid-content.3 = s4s-elt-invalid-content.3: Elemente mit dem Typ ''{0}'' k\u00F6nnen nicht nach Deklarationen als untergeordnete Elemente eines <schema>-Elements vorkommen. + s4s-elt-schema-ns = s4s-elt-schema-ns: Namespace des Elements ''{0}'' muss aus dem Schema-Namespace ''http://www.w3.org/2001/XMLSchema'' stammen. + s4s-elt-character = s4s-elt-character: In anderen Schemaelementen als ''xs:appinfo'' und ''xs:documentation'' sind nur Leerstellen zul\u00E4ssig. ''{0}'' gefunden. # codes not defined by the spec - c-fields-xpaths = c-fields-xpaths: Feldwert = "{0}" ist ung\u00FCltig. - c-general-xpath = c-general-xpath: Ausdruck "{0}" ist ung\u00FCltig in Bezug auf die vom XML-Schema unterst\u00FCtzte XPath-Teilmenge. - c-general-xpath-ns = c-general-xpath-ns: Namespace-Pr\u00E4fix in XPath-Ausdruck "{0}" war an einen Namespace gebunden. - c-selector-xpath = c-selector-xpath: Selector-Wert = "{0}" ist ung\u00FCltig. Selector-XPaths k\u00F6nnen keine Attribute enthalten. - EmptyTargetNamespace = EmptyTargetNamespace: In Schemadokument "{0}" kann der Wert des "targetNamespace"-Attributs keine leere Zeichenfolge sein. - FacetValueFromBase = FacetValueFromBase: In der Deklaration von Typ "{0}" muss der Wert "{1}" von Facet "{2}" aus dem Wertebereich des Basistyps "{3}" stammen. - FixedFacetValue = FixedFacetValue: In der Definition von {3} ist der Wert "{1}" f\u00FCr Facet "{0}" ung\u00FCltig, da der Wert f\u00FCr "{0}" in einem der Vorg\u00E4ngertypen auf "{2}" gesetzt wurde und "{''fixed''}" = "true" ist. - InvalidRegex = InvalidRegex: Musterwert "{0}" ist kein g\u00FCltiger regul\u00E4rer Ausdruck. Der gemeldete Fehler war: "{1}" bei Spalte "{2}". - maxOccurLimit = Aktuelle Konfiguration des Parsers l\u00E4sst nicht zu, dass ein maxOccurs-Attributwert auf einen h\u00F6heren Wert als {0} gesetzt wird. - PublicSystemOnNotation = PublicSystemOnNotation: Mindestens eines der Elemente "public" und "system" muss im Element "notation" vorkommen. - SchemaLocation = SchemaLocation: schemaLocation-Wert = "{0}" muss eine gerade Anzahl an URIs haben. - TargetNamespace.1 = TargetNamespace.1: Namespace "{0}" wird erwartet, aber der Ziel-Namespace des Schemadokuments ist "{1}". - TargetNamespace.2 = TargetNamespace.2: Kein Namespace wird erwartet, aber das Schemadokument hat den Ziel-Namespace "{1}". - UndeclaredEntity = UndeclaredEntity: Entit\u00E4t "{0}" ist nicht deklariert. - UndeclaredPrefix = UndeclaredPrefix: "{0}" kann nicht als QName aufgel\u00F6st werden: Pr\u00E4fix "{1}" ist nicht deklariert. + c-fields-xpaths = c-fields-xpaths: Feldwert = ''{0}'' ist ung\u00FCltig. + c-general-xpath = c-general-xpath: Ausdruck ''{0}'' ist ung\u00FCltig in Bezug auf die vom XML-Schema unterst\u00FCtzte XPath-Teilmenge. + c-general-xpath-ns = c-general-xpath-ns: Namespace-Pr\u00E4fix in XPath-Ausdruck ''{0}'' war an einen Namespace gebunden. + c-selector-xpath = c-selector-xpath: Selektor-Wert = ''{0}'' ist ung\u00FCltig. Selektor-XPaths k\u00F6nnen keine Attribute enthalten. + EmptyTargetNamespace = EmptyTargetNamespace: In Schemadokument ''{0}'' kann der Wert des ''targetNamespace''-Attributs keine leere Zeichenfolge sein. + FacetValueFromBase = FacetValueFromBase: In der Deklaration von Typ ''{0}'' muss der Wert ''{1}'' von Facet ''{2}'' aus dem Wertebereich des Basistyps ''{3}'' stammen. + FixedFacetValue = FixedFacetValue: In der Definition von {3} ist der Wert ''{1}'' f\u00FCr Facet ''{0}'' ung\u00FCltig, da der Wert f\u00FCr ''{0}'' in einem der Vorg\u00E4ngertypen auf ''{2}'' gesetzt wurde und ''{''fixed'}''' = true ist. + InvalidRegex = InvalidRegex: Musterwert ''{0}'' ist kein g\u00FCltiger regul\u00E4rer Ausdruck. Der gemeldete Fehler war: ''{1}'' bei Spalte ''{2}''. + MaxOccurLimit = Aktuelle Konfiguration des Parsers l\u00E4sst nicht zu, dass ein maxOccurs-Attributwert auf einen h\u00F6heren Wert als {0} gesetzt wird. + PublicSystemOnNotation = PublicSystemOnNotation: Mindestens eines der Elemente 'public' und 'system' muss im Element 'notation' vorkommen. + SchemaLocation = SchemaLocation: schemaLocation-Wert = ''{0}'' muss eine gerade Anzahl an URIs haben. + TargetNamespace.1 = TargetNamespace.1: Namespace ''{0}'' wird erwartet, aber der Ziel-Namespace des Schemadokuments ist ''{1}''. + TargetNamespace.2 = TargetNamespace.2: Kein Namespace wird erwartet, aber das Schemadokument hat den Ziel-Namespace ''{1}''. + UndeclaredEntity = UndeclaredEntity: Entit\u00E4t ''{0}'' ist nicht deklariert. + UndeclaredPrefix = UndeclaredPrefix: ''{0}'' kann nicht als QName aufgel\u00F6st werden: Pr\u00E4fix ''{1}'' ist nicht deklariert. diff --git a/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_es.properties b/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_es.properties index eecf814..2e22ced 100644 --- a/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_es.properties +++ b/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_es.properties @@ -282,7 +282,7 @@ FacetValueFromBase = FacetValueFromBase: En la declaraci\u00F3n de tipo ''{0}'', el valor ''{1}'' de la faceta ''{2}'' debe proceder del espacio reservado para el valor del tipo base, ''{3}''. FixedFacetValue = FixedFacetValue: En la definici\u00F3n de {3}, el valor ''{1}'' para la faceta ''{0}'' no es v\u00E1lido porque el valor de ''{0}'' se ha definido en ''{2}'' en uno de los tipos de ascendientes y '{'fixed'}' = true. InvalidRegex = InvalidRegex: El valor del patr\u00F3n ''{0}'' no es una expresi\u00F3n regular v\u00E1lida. El error registrado ha sido: ''{1}'' en la columna ''{2}''. - maxOccurLimit = La configuraci\u00F3n actual del analizador no permite que la definici\u00F3n del valor del atributo maxOccurs sea mayor que {0}. + MaxOccurLimit = La configuraci\u00F3n actual del analizador no permite que la definici\u00F3n del valor del atributo maxOccurs sea mayor que {0}. PublicSystemOnNotation = PublicSystemOnNotation: Al menos un valor de ''public'' y ''system'' debe aparecer en el elemento ''notation''. SchemaLocation = SchemaLocation: El valor de schemaLocation = ''{0}'' debe tener un n\u00FAmero par de URI. TargetNamespace.1 = TargetNamespace.1: Se esperaba el espacio de nombres ''{0}'', pero el espacio de nombres de destino del documento de esquema es ''{1}''. diff --git a/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_fr.properties b/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_fr.properties index 2523c07..74ae32c 100644 --- a/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_fr.properties +++ b/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_fr.properties @@ -282,7 +282,7 @@ FacetValueFromBase = FacetValueFromBase : Dans la d\u00E9claration de type ''{0}'', la valeur ''{1}'' du facet ''{2}'' doit \u00EAtre issue de l''espace de valeurs du type de base, ''{3}''. FixedFacetValue = FixedFacetValue : Dans la d\u00E9finition de {3}, la valeur ''{1}'' du facet ''{0}'' n''est pas valide, car la valeur de ''{0}'' a \u00E9t\u00E9 d\u00E9finie sur ''{2}'' dans l''un des types d''anc\u00EAtre, et '{'fixed'}' = true. InvalidRegex = InvalidRegex : La valeur de mod\u00E8le ''{0}'' n''est pas une expression r\u00E9guli\u00E8re valide. L''erreur signal\u00E9e est ''{1}'', au niveau de la colonne ''{2}''. - maxOccurLimit = La configuration en cours de l''analyseur ne permet pas de d\u00E9finir une valeur d''attribut maxOccurs sur une valeur sup\u00E9rieure \u00E0 {0}. + MaxOccurLimit = La configuration en cours de l''analyseur ne permet pas de d\u00E9finir une valeur d''attribut maxOccurs sur une valeur sup\u00E9rieure \u00E0 {0}. PublicSystemOnNotation = PublicSystemOnNotation : Au moins une des valeurs ''public'' et ''system'' doit figurer dans l'\u00E9l\u00E9ment ''notation''. SchemaLocation = SchemaLocation : La valeur schemaLocation ''{0}'' doit comporter un nombre pair d''URI. TargetNamespace.1 = TargetNamespace.1 : Espace de noms "{0}" attendu mais l''espace de noms cible du document de sch\u00E9ma est ''{1}''. diff --git a/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_it.properties b/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_it.properties index aef31a7..1a80b3d 100644 --- a/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_it.properties +++ b/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_it.properties @@ -282,7 +282,7 @@ FacetValueFromBase = FacetValueFromBase: nella dichiarazione del tipo ''{0}'' il valore ''{1}'' del facet ''{2}'' deve provenire dallo spazio di valori del tipo di base ''{3}''. FixedFacetValue = FixedFacetValue: nella definizione di {3}, il valore ''{1}'' per il facet ''{0}'' non \u00E8 valido. Il valore per ''{0}'' \u00E8 stato impostato su ''{2}'' in uno dei tipi di predecessore e '{'fixed'}' = true. InvalidRegex = InvalidRegex: il valore di pattern "{0}" non \u00E8 un''espressione regolare valida. Errore segnalato ''{1}'' nella colonna ''{2}''. - maxOccurLimit = La configurazione corrente del parser non consente che un valore di attributo maxOccurs sia impostato su un valore maggiore del valore {0}. + MaxOccurLimit = La configurazione corrente del parser non consente che un valore di attributo maxOccurs sia impostato su un valore maggiore del valore {0}. PublicSystemOnNotation = PublicSystemOnNotation: almeno uno tra ''public'' e ''system'' deve essere presente nell'elemento ''notation''. SchemaLocation = SchemaLocation: il valore = ''{0}'' di schemaLocation deve avere un numero pari di URI. TargetNamespace.1 = TargetNamespace.1: lo spazio di nomi previsto \u00E8 "{0}", ma lo spazio di nomi di destinazione del documento dello schema \u00E8 "{1}". diff --git a/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_ja.properties b/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_ja.properties index 7d65017..f04867d 100644 --- a/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_ja.properties +++ b/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_ja.properties @@ -282,7 +282,7 @@ FacetValueFromBase = FacetValueFromBase: \u30BF\u30A4\u30D7''{0}''\u306E\u5BA3\u8A00\u3067\u306F\u3001\u30D5\u30A1\u30BB\u30C3\u30C8''{2}''\u306E\u5024''{1}''\u306F\u30D9\u30FC\u30B9\u30FB\u30BF\u30A4\u30D7''{3}''\u306E\u5024\u7A7A\u9593\u304B\u3089\u306E\u3082\u306E\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002 FixedFacetValue = FixedFacetValue: {3}\u306E\u5B9A\u7FA9\u3067\u306F\u30D5\u30A1\u30BB\u30C3\u30C8''{0}''\u306E\u5024''{1}''\u306F\u7121\u52B9\u3067\u3059\u3002\u3053\u308C\u306F\u3001''{0}''\u306E\u5024\u304C\u7956\u5148\u30BF\u30A4\u30D7\u306E\u3044\u305A\u308C\u304B\u3067''{2}''\u306B\u8A2D\u5B9A\u3055\u308C\u3066\u304A\u308A\u3001'{'fixed'}' = true\u3067\u3042\u308B\u305F\u3081\u3067\u3059\u3002 InvalidRegex = InvalidRegex: pattern\u306E\u5024''{0}''\u306F\u7121\u52B9\u306A\u6B63\u898F\u8868\u73FE\u3067\u3059\u3002\u5217''{2}''\u3067''{1}''\u30A8\u30E9\u30FC\u304C\u5831\u544A\u3055\u308C\u307E\u3057\u305F\u3002 - maxOccurLimit = \u73FE\u5728\u306E\u30D1\u30FC\u30B5\u30FC\u306E\u69CB\u6210\u3067\u306F\u3001maxOccurs\u5C5E\u6027\u306B\u5024{0}\u3088\u308A\u5927\u304D\u3044\u5024\u3092\u8A2D\u5B9A\u3067\u304D\u307E\u305B\u3093\u3002 + MaxOccurLimit = \u73FE\u5728\u306E\u30D1\u30FC\u30B5\u30FC\u306E\u69CB\u6210\u3067\u306F\u3001maxOccurs\u5C5E\u6027\u306B\u5024{0}\u3088\u308A\u5927\u304D\u3044\u5024\u3092\u8A2D\u5B9A\u3067\u304D\u307E\u305B\u3093\u3002 PublicSystemOnNotation = PublicSystemOnNotation: \u8981\u7D20''notation''\u306B\u306F''public''\u304A\u3088\u3073''system''\u306E\u5C11\u306A\u304F\u3068\u30821\u3064\u304C\u5FC5\u8981\u3067\u3059\u3002 SchemaLocation = SchemaLocation: schemaLocation\u306E\u5024''{0}''\u306B\u306F\u5076\u6570\u500B\u306EURI\u3092\u6307\u5B9A\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002 TargetNamespace.1 = TargetNamespace.1: \u30CD\u30FC\u30E0\u30B9\u30DA\u30FC\u30B9''{0}''\u304C\u5FC5\u8981\u3067\u3059\u304C\u3001\u30B9\u30AD\u30FC\u30DE\u30FB\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u306E\u30BF\u30FC\u30B2\u30C3\u30C8\u30FB\u30CD\u30FC\u30E0\u30B9\u30DA\u30FC\u30B9\u306F''{1}''\u3067\u3059\u3002 diff --git a/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_ko.properties b/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_ko.properties index 910df12..fc3b3d3 100644 --- a/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_ko.properties +++ b/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_ko.properties @@ -282,7 +282,7 @@ FacetValueFromBase = FacetValueFromBase: ''{0}'' \uC720\uD615\uC758 \uC120\uC5B8\uC5D0\uC11C ''{2}'' \uBA74\uC758 ''{1}'' \uAC12\uC740 \uAE30\uBCF8 \uC720\uD615 ''{3}''\uC758 \uAC12 \uACF5\uBC31\uC5D0\uC11C \uC640\uC57C \uD569\uB2C8\uB2E4. FixedFacetValue = FixedFacetValue: {3}\uC758 \uC815\uC758\uC5D0\uC11C ''{0}'' \uBA74\uC5D0 \uB300\uD55C ''{1}'' \uAC12\uC774 \uBD80\uC801\uD569\uD569\uB2C8\uB2E4. ''{0}''\uC5D0 \uB300\uD55C \uAC12\uC774 \uC870\uC0C1 \uC720\uD615 \uC911 \uD558\uB098\uC5D0\uC11C ''{2}''(\uC73C)\uB85C \uC124\uC815\uB418\uC5C8\uC73C\uBA70 '{'fixed'}' = true\uC774\uAE30 \uB54C\uBB38\uC785\uB2C8\uB2E4. InvalidRegex = InvalidRegex: \uD328\uD134 \uAC12 ''{0}''\uC740(\uB294) \uC801\uD569\uD55C \uC815\uADDC \uD45C\uD604\uC2DD\uC774 \uC544\uB2D9\uB2C8\uB2E4. ''{2}'' \uC5F4\uC5D0\uC11C ''{1}'' \uC624\uB958\uAC00 \uBCF4\uACE0\uB418\uC5C8\uC2B5\uB2C8\uB2E4. - maxOccurLimit = \uAD6C\uBB38 \uBD84\uC11D\uAE30\uC758 \uD604\uC7AC \uAD6C\uC131\uC5D0\uC11C maxOccurs \uC18D\uC131\uAC12\uC744 {0} \uAC12\uBCF4\uB2E4 \uD06C\uAC8C \uC124\uC815\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. + MaxOccurLimit = \uAD6C\uBB38 \uBD84\uC11D\uAE30\uC758 \uD604\uC7AC \uAD6C\uC131\uC5D0\uC11C maxOccurs \uC18D\uC131\uAC12\uC744 {0} \uAC12\uBCF4\uB2E4 \uD06C\uAC8C \uC124\uC815\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. PublicSystemOnNotation = PublicSystemOnNotation: \uD558\uB098 \uC774\uC0C1\uC758 ''public''\uACFC ''system''\uC774 ''notation'' \uC694\uC18C\uC5D0 \uB098\uD0C0\uB098\uC57C \uD569\uB2C8\uB2E4. SchemaLocation = SchemaLocation: schemaLocation \uAC12 = ''{0}''\uC5D0\uB294 \uC9DD\uC218 \uAC1C\uC758 URI\uAC00 \uC788\uC5B4\uC57C \uD569\uB2C8\uB2E4. TargetNamespace.1 = TargetNamespace.1: ''{0}'' \uB124\uC784\uC2A4\uD398\uC774\uC2A4\uAC00 \uD544\uC694\uD558\uC9C0\uB9CC \uC2A4\uD0A4\uB9C8 \uBB38\uC11C\uC758 \uB300\uC0C1 \uB124\uC784\uC2A4\uD398\uC774\uC2A4\uAC00 ''{1}''\uC785\uB2C8\uB2E4. diff --git a/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_pt_BR.properties b/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_pt_BR.properties index 229ed0b..d063302 100644 --- a/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_pt_BR.properties +++ b/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_pt_BR.properties @@ -282,7 +282,7 @@ FacetValueFromBase = FacetValueFromBase: Na declara\u00E7\u00E3o do tipo ''{0}'', o valor ''{1}'' do aspecto ''{2}'' deve ser proveniente do espa\u00E7o de valor do tipo de base, ''{3}''. FixedFacetValue = FixedFacetValue: Na defini\u00E7\u00E3o de {3}, o valor ''{1}'' do aspecto ''{0}'' \u00E9 inv\u00E1lido porque o valor de ''{0}'' foi enviado para ''{2}'' em um dos tipos de ancestrais e '{'fixed'}' = true. InvalidRegex = InvalidRegex: O valor do padr\u00E3o ''{0}'' n\u00E3o \u00E9 uma express\u00E3o regular v\u00E1lida. O erro reportado foi: ''{1}'' na coluna ''{2}''. - maxOccurLimit = A configura\u00E7\u00E3o atual do parser n\u00E3o permite que o valor de um atributo maxOccurs seja definido como maior que o valor {0}. + MaxOccurLimit = A configura\u00E7\u00E3o atual do parser n\u00E3o permite que o valor de um atributo maxOccurs seja definido como maior que o valor {0}. PublicSystemOnNotation = PublicSystemOnNotation: Pelo menos ''public'' e ''system'' devem aparecer no elemento ''notation''. SchemaLocation = SchemaLocation: schemaLocation value = ''{0}''deve ter n\u00FAmero par de URIs. TargetNamespace.1 = TargetNamespace.1: Esperava o namespace ''{0}'', mas o namespace de destino do documento do esquema \u00E9 ''{1}''. diff --git a/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_sv.properties b/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_sv.properties index f3b07f2..ffe9d79 100644 --- a/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_sv.properties +++ b/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_sv.properties @@ -282,7 +282,7 @@ FacetValueFromBase = FacetValueFromBase: I deklarationen av typ ''{0}'' m\u00E5ste v\u00E4rdet ''{1}'' f\u00F6r aspekt ''{2}'' komma fr\u00E5n v\u00E4rdeutrymmet i bastypen ''{3}''. FixedFacetValue = FixedFacetValue: I definitionen f\u00F6r {3} \u00E4r v\u00E4rdet ''{1}'' f\u00F6r aspekten ''{0}'' ogiltigt eftersom v\u00E4rdet f\u00F6r ''{0}'' har angetts som ''{2}'' i n\u00E5gon av typerna f\u00F6r \u00F6verordnade samtidigt som '{'fast'}' = true. InvalidRegex = InvalidRegex: M\u00F6nsterv\u00E4rdet ''{0}'' \u00E4r inte n\u00E5got giltigt regulj\u00E4rt uttryck. Det rapporterade felet \u00E4r: ''{1}'' i kolumn ''{2}''. - maxOccurLimit = Den aktuella konfigurationen f\u00F6r parsern till\u00E5ter inte att attributv\u00E4rdet f\u00F6r Occurs anges som st\u00F6rre \u00E4n v\u00E4rdet {0}. + MaxOccurLimit = Den aktuella konfigurationen f\u00F6r parsern till\u00E5ter inte att attributv\u00E4rdet f\u00F6r Occurs anges som st\u00F6rre \u00E4n v\u00E4rdet {0}. PublicSystemOnNotation = PublicSystemOnNotation: \u00C5tminstone ett av ''public'' och ''system'' m\u00E5ste anges i elementets ''notation''. SchemaLocation = SchemaLocation: schemaLocation-v\u00E4rdet ''{0}'' m\u00E5ste anges med ett j\u00E4mnt antal URI:er. TargetNamespace.1 = TargetNamespace.1: F\u00F6rv\u00E4ntade namnrymden ''{0}'', men m\u00E5lnamnrymden f\u00F6r schemadokumentet \u00E4r ''{1}''. diff --git a/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_zh_CN.properties b/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_zh_CN.properties index e13c063..c05aacc 100644 --- a/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_zh_CN.properties +++ b/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_zh_CN.properties @@ -282,7 +282,7 @@ FacetValueFromBase = FacetValueFromBase: \u5728\u7C7B\u578B ''{0}'' \u7684\u58F0\u660E\u4E2D, \u9762 ''{2}'' \u7684\u503C ''{1}'' \u5FC5\u987B\u6765\u81EA\u57FA\u7C7B\u578B\u7684\u503C\u7A7A\u95F4 ''{3}''\u3002 FixedFacetValue = FixedFacetValue: \u5728 {3} \u7684\u5B9A\u4E49\u4E2D, \u9762 ''{0}'' \u7684\u503C ''{1}'' \u65E0\u6548, \u56E0\u4E3A ''{0}'' \u7684\u503C\u5DF2\u5728\u539F\u7EA7\u7C7B\u578B\u4E4B\u4E00\u4E2D\u8BBE\u7F6E\u4E3A ''{2}'', \u5E76\u4E14 '{'fixed'}' = true\u3002 InvalidRegex = InvalidRegex: \u6A21\u5F0F\u503C ''{0}'' \u4E0D\u662F\u6709\u6548\u7684\u6B63\u5219\u8868\u8FBE\u5F0F\u3002\u5217 ''{2}'' \u4E0A\u62A5\u544A\u7684\u9519\u8BEF\u4E3A: ''{1}''\u3002 - maxOccurLimit = \u89E3\u6790\u5668\u7684\u5F53\u524D\u914D\u7F6E\u4E0D\u5141\u8BB8\u5C06 maxOccurs \u5C5E\u6027\u503C\u8BBE\u7F6E\u4E3A\u5927\u4E8E\u503C {0}\u3002 + MaxOccurLimit = \u89E3\u6790\u5668\u7684\u5F53\u524D\u914D\u7F6E\u4E0D\u5141\u8BB8\u5C06 maxOccurs \u5C5E\u6027\u503C\u8BBE\u7F6E\u4E3A\u5927\u4E8E\u503C {0}\u3002 PublicSystemOnNotation = PublicSystemOnNotation: \u5143\u7D20 ''notation'' \u4E2D\u5FC5\u987B\u81F3\u5C11\u51FA\u73B0 ''public'' \u548C ''system'' \u4E2D\u7684\u4E00\u4E2A\u3002 SchemaLocation = SchemaLocation: schemaLocation \u503C ''{0}'' \u5FC5\u987B\u5177\u6709\u5076\u6570\u4E2A URI\u3002 TargetNamespace.1 = TargetNamespace.1: \u5E94\u4E3A\u540D\u79F0\u7A7A\u95F4 ''{0}'', \u4F46\u65B9\u6848\u6587\u6863\u7684\u76EE\u6807\u540D\u79F0\u7A7A\u95F4\u4E3A ''{1}''\u3002 diff --git a/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_zh_TW.properties b/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_zh_TW.properties index d2a7885..06d8a05 100644 --- a/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_zh_TW.properties +++ b/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_zh_TW.properties @@ -282,7 +282,7 @@ FacetValueFromBase = FacetValueFromBase: \u5728\u985E\u578B ''{0}'' \u7684\u5BA3\u544A\u4E2D\uFF0Cfacet ''{2}'' \u7684\u503C ''{1}'' \u5FC5\u9808\u4F86\u81EA\u57FA\u790E\u985E\u578B\u7684\u503C\u7A7A\u9593 ''{3}''\u3002 FixedFacetValue = FixedFacetValue: \u5728 {3} \u7684\u5B9A\u7FA9\u4E2D\uFF0Cfacet ''{0}'' \u7684\u503C ''{1}'' \u7121\u6548\uFF0C\u56E0\u70BA ''{0}'' \u7684\u503C\u4EE5\u5176\u4E2D\u4E00\u500B\u7956\u7CFB\u985E\u578B\u8A2D\u70BA ''{2}''\uFF0C\u4E14 '{'fixed'}' = true\u3002 InvalidRegex = InvalidRegex: \u6A23\u5F0F\u503C ''{0}'' \u4E0D\u662F\u6709\u6548\u7684\u6B63\u898F\u8868\u793A\u5F0F\u3002\u5831\u544A\u7684\u932F\u8AA4: \u4F4D\u65BC\u8CC7\u6599\u6B04 ''{2}'' \u7684 ''{1}''\u3002 - maxOccurLimit = \u5256\u6790\u5668\u76EE\u524D\u7684\u7D44\u614B\u4E0D\u5141\u8A31 maxOccurs \u5C6C\u6027\u503C\u8A2D\u70BA\u5927\u65BC\u503C {0}\u3002 + MaxOccurLimit = \u5256\u6790\u5668\u76EE\u524D\u7684\u7D44\u614B\u4E0D\u5141\u8A31 maxOccurs \u5C6C\u6027\u503C\u8A2D\u70BA\u5927\u65BC\u503C {0}\u3002 PublicSystemOnNotation = PublicSystemOnNotation: ''public'' \u8207 ''system'' \u81F3\u5C11\u5176\u4E2D\u4E4B\u4E00\u5FC5\u9808\u51FA\u73FE\u5728\u5143\u7D20 ''notation'' \u4E2D\u3002 SchemaLocation = \u7B49\u65BC ''{0}'' \u7684 SchemaLocation: schemaLocation \u503C\u5FC5\u9808\u5177\u6709\u5076\u6578\u500B URI\u3002 TargetNamespace.1 = TargetNamespace.1: \u9810\u671F\u547D\u540D\u7A7A\u9593 ''{0}''\uFF0C\u4F46\u662F\u7DB1\u8981\u6587\u4EF6\u7684\u76EE\u6A19\u547D\u540D\u7A7A\u9593\u70BA ''{1}''\u3002 diff --git a/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSerializerMessages_sv.properties b/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSerializerMessages_sv.properties index 9be2a87..d35c17d 100644 --- a/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSerializerMessages_sv.properties +++ b/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSerializerMessages_sv.properties @@ -13,7 +13,7 @@ NoWriterSupplied = Det finns ingen skrivare f\u00F6r serializer. MethodNotSupported = Metoden ''{0}'' st\u00F6ds inte i denna fabriksinst\u00E4llning. ResetInMiddle = Serializer kan inte \u00E5terst\u00E4llas under p\u00E5g\u00E5ende serialisering. - Internal = Internt fel: elementstatus \u00E4r noll. + Internal = Internt fel: elementtillst\u00E5nd \u00E4r noll. NoName = Det finns inget rawName och localName \u00E4r null. ElementQName = Elementnamnet ''{0}'' \u00E4r inte n\u00E5got QName. ElementPrefix = Elementet ''{0}'' tillh\u00F6r inte n\u00E5gon namnrymd: prefixet kanske inte har deklarerats eller \u00E4r bundet till annan namnrymd. diff --git a/src/com/sun/org/apache/xerces/internal/impl/xpath/XPath.java b/src/com/sun/org/apache/xerces/internal/impl/xpath/XPath.java index eb652a8..be2e311 100644 --- a/src/com/sun/org/apache/xerces/internal/impl/xpath/XPath.java +++ b/src/com/sun/org/apache/xerces/internal/impl/xpath/XPath.java @@ -1,13 +1,13 @@ /* - * reserved comment block - * DO NOT REMOVE OR ALTER! + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. */ /* - * Copyright 2000-2002,2004,2005 The Apache Software Foundation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * @@ -20,13 +20,14 @@ package com.sun.org.apache.xerces.internal.impl.xpath; -import java.util.Vector; - import com.sun.org.apache.xerces.internal.util.SymbolTable; -import com.sun.org.apache.xerces.internal.util.XMLSymbols; import com.sun.org.apache.xerces.internal.util.XMLChar; +import com.sun.org.apache.xerces.internal.util.XMLSymbols; import com.sun.org.apache.xerces.internal.xni.NamespaceContext; import com.sun.org.apache.xerces.internal.xni.QName; +import java.util.HashMap; +import java.util.Map; +import java.util.Vector; /** * Bare minimum XPath parser. @@ -858,10 +859,10 @@ public class XPath { private SymbolTable fSymbolTable; // REVISIT: Code something better here. -Ac - private java.util.Hashtable fSymbolMapping = new java.util.Hashtable(); + private Map<String, Integer> fSymbolMapping = new HashMap<>(); // REVISIT: Code something better here. -Ac - private java.util.Hashtable fTokenNames = new java.util.Hashtable(); + private Map<Integer, String> fTokenNames = new HashMap<>(); /** * Current position in the token list. @@ -882,57 +883,57 @@ public class XPath { "self", }; for (int i = 0; i < symbols.length; i++) { - fSymbolMapping.put(fSymbolTable.addSymbol(symbols[i]), new Integer(i)); + fSymbolMapping.put(fSymbolTable.addSymbol(symbols[i]), i); } - fTokenNames.put(new Integer(EXPRTOKEN_OPEN_PAREN), "EXPRTOKEN_OPEN_PAREN"); - fTokenNames.put(new Integer(EXPRTOKEN_CLOSE_PAREN), "EXPRTOKEN_CLOSE_PAREN"); - fTokenNames.put(new Integer(EXPRTOKEN_OPEN_BRACKET), "EXPRTOKEN_OPEN_BRACKET"); - fTokenNames.put(new Integer(EXPRTOKEN_CLOSE_BRACKET), "EXPRTOKEN_CLOSE_BRACKET"); - fTokenNames.put(new Integer(EXPRTOKEN_PERIOD), "EXPRTOKEN_PERIOD"); - fTokenNames.put(new Integer(EXPRTOKEN_DOUBLE_PERIOD), "EXPRTOKEN_DOUBLE_PERIOD"); - fTokenNames.put(new Integer(EXPRTOKEN_ATSIGN), "EXPRTOKEN_ATSIGN"); - fTokenNames.put(new Integer(EXPRTOKEN_COMMA), "EXPRTOKEN_COMMA"); - fTokenNames.put(new Integer(EXPRTOKEN_DOUBLE_COLON), "EXPRTOKEN_DOUBLE_COLON"); - fTokenNames.put(new Integer(EXPRTOKEN_NAMETEST_ANY), "EXPRTOKEN_NAMETEST_ANY"); - fTokenNames.put(new Integer(EXPRTOKEN_NAMETEST_NAMESPACE), "EXPRTOKEN_NAMETEST_NAMESPACE"); - fTokenNames.put(new Integer(EXPRTOKEN_NAMETEST_QNAME), "EXPRTOKEN_NAMETEST_QNAME"); - fTokenNames.put(new Integer(EXPRTOKEN_NODETYPE_COMMENT), "EXPRTOKEN_NODETYPE_COMMENT"); - fTokenNames.put(new Integer(EXPRTOKEN_NODETYPE_TEXT), "EXPRTOKEN_NODETYPE_TEXT"); - fTokenNames.put(new Integer(EXPRTOKEN_NODETYPE_PI), "EXPRTOKEN_NODETYPE_PI"); - fTokenNames.put(new Integer(EXPRTOKEN_NODETYPE_NODE), "EXPRTOKEN_NODETYPE_NODE"); - fTokenNames.put(new Integer(EXPRTOKEN_OPERATOR_AND), "EXPRTOKEN_OPERATOR_AND"); - fTokenNames.put(new Integer(EXPRTOKEN_OPERATOR_OR), "EXPRTOKEN_OPERATOR_OR"); - fTokenNames.put(new Integer(EXPRTOKEN_OPERATOR_MOD), "EXPRTOKEN_OPERATOR_MOD"); - fTokenNames.put(new Integer(EXPRTOKEN_OPERATOR_DIV), "EXPRTOKEN_OPERATOR_DIV"); - fTokenNames.put(new Integer(EXPRTOKEN_OPERATOR_MULT), "EXPRTOKEN_OPERATOR_MULT"); - fTokenNames.put(new Integer(EXPRTOKEN_OPERATOR_SLASH), "EXPRTOKEN_OPERATOR_SLASH"); - fTokenNames.put(new Integer(EXPRTOKEN_OPERATOR_DOUBLE_SLASH), "EXPRTOKEN_OPERATOR_DOUBLE_SLASH"); - fTokenNames.put(new Integer(EXPRTOKEN_OPERATOR_UNION), "EXPRTOKEN_OPERATOR_UNION"); - fTokenNames.put(new Integer(EXPRTOKEN_OPERATOR_PLUS), "EXPRTOKEN_OPERATOR_PLUS"); - fTokenNames.put(new Integer(EXPRTOKEN_OPERATOR_MINUS), "EXPRTOKEN_OPERATOR_MINUS"); - fTokenNames.put(new Integer(EXPRTOKEN_OPERATOR_EQUAL), "EXPRTOKEN_OPERATOR_EQUAL"); - fTokenNames.put(new Integer(EXPRTOKEN_OPERATOR_NOT_EQUAL), "EXPRTOKEN_OPERATOR_NOT_EQUAL"); - fTokenNames.put(new Integer(EXPRTOKEN_OPERATOR_LESS), "EXPRTOKEN_OPERATOR_LESS"); - fTokenNames.put(new Integer(EXPRTOKEN_OPERATOR_LESS_EQUAL), "EXPRTOKEN_OPERATOR_LESS_EQUAL"); - fTokenNames.put(new Integer(EXPRTOKEN_OPERATOR_GREATER), "EXPRTOKEN_OPERATOR_GREATER"); - fTokenNames.put(new Integer(EXPRTOKEN_OPERATOR_GREATER_EQUAL), "EXPRTOKEN_OPERATOR_GREATER_EQUAL"); - fTokenNames.put(new Integer(EXPRTOKEN_FUNCTION_NAME), "EXPRTOKEN_FUNCTION_NAME"); - fTokenNames.put(new Integer(EXPRTOKEN_AXISNAME_ANCESTOR), "EXPRTOKEN_AXISNAME_ANCESTOR"); - fTokenNames.put(new Integer(EXPRTOKEN_AXISNAME_ANCESTOR_OR_SELF), "EXPRTOKEN_AXISNAME_ANCESTOR_OR_SELF"); - fTokenNames.put(new Integer(EXPRTOKEN_AXISNAME_ATTRIBUTE), "EXPRTOKEN_AXISNAME_ATTRIBUTE"); - fTokenNames.put(new Integer(EXPRTOKEN_AXISNAME_CHILD), "EXPRTOKEN_AXISNAME_CHILD"); - fTokenNames.put(new Integer(EXPRTOKEN_AXISNAME_DESCENDANT), "EXPRTOKEN_AXISNAME_DESCENDANT"); - fTokenNames.put(new Integer(EXPRTOKEN_AXISNAME_DESCENDANT_OR_SELF), "EXPRTOKEN_AXISNAME_DESCENDANT_OR_SELF"); - fTokenNames.put(new Integer(EXPRTOKEN_AXISNAME_FOLLOWING), "EXPRTOKEN_AXISNAME_FOLLOWING"); - fTokenNames.put(new Integer(EXPRTOKEN_AXISNAME_FOLLOWING_SIBLING), "EXPRTOKEN_AXISNAME_FOLLOWING_SIBLING"); - fTokenNames.put(new Integer(EXPRTOKEN_AXISNAME_NAMESPACE), "EXPRTOKEN_AXISNAME_NAMESPACE"); - fTokenNames.put(new Integer(EXPRTOKEN_AXISNAME_PARENT), "EXPRTOKEN_AXISNAME_PARENT"); - fTokenNames.put(new Integer(EXPRTOKEN_AXISNAME_PRECEDING), "EXPRTOKEN_AXISNAME_PRECEDING"); - fTokenNames.put(new Integer(EXPRTOKEN_AXISNAME_PRECEDING_SIBLING), "EXPRTOKEN_AXISNAME_PRECEDING_SIBLING"); - fTokenNames.put(new Integer(EXPRTOKEN_AXISNAME_SELF), "EXPRTOKEN_AXISNAME_SELF"); - fTokenNames.put(new Integer(EXPRTOKEN_LITERAL), "EXPRTOKEN_LITERAL"); - fTokenNames.put(new Integer(EXPRTOKEN_NUMBER), "EXPRTOKEN_NUMBER"); - fTokenNames.put(new Integer(EXPRTOKEN_VARIABLE_REFERENCE), "EXPRTOKEN_VARIABLE_REFERENCE"); + fTokenNames.put(EXPRTOKEN_OPEN_PAREN, "EXPRTOKEN_OPEN_PAREN"); + fTokenNames.put(EXPRTOKEN_CLOSE_PAREN, "EXPRTOKEN_CLOSE_PAREN"); + fTokenNames.put(EXPRTOKEN_OPEN_BRACKET, "EXPRTOKEN_OPEN_BRACKET"); + fTokenNames.put(EXPRTOKEN_CLOSE_BRACKET, "EXPRTOKEN_CLOSE_BRACKET"); + fTokenNames.put(EXPRTOKEN_PERIOD, "EXPRTOKEN_PERIOD"); + fTokenNames.put(EXPRTOKEN_DOUBLE_PERIOD, "EXPRTOKEN_DOUBLE_PERIOD"); + fTokenNames.put(EXPRTOKEN_ATSIGN, "EXPRTOKEN_ATSIGN"); + fTokenNames.put(EXPRTOKEN_COMMA, "EXPRTOKEN_COMMA"); + fTokenNames.put(EXPRTOKEN_DOUBLE_COLON, "EXPRTOKEN_DOUBLE_COLON"); + fTokenNames.put(EXPRTOKEN_NAMETEST_ANY, "EXPRTOKEN_NAMETEST_ANY"); + fTokenNames.put(EXPRTOKEN_NAMETEST_NAMESPACE, "EXPRTOKEN_NAMETEST_NAMESPACE"); + fTokenNames.put(EXPRTOKEN_NAMETEST_QNAME, "EXPRTOKEN_NAMETEST_QNAME"); + fTokenNames.put(EXPRTOKEN_NODETYPE_COMMENT, "EXPRTOKEN_NODETYPE_COMMENT"); + fTokenNames.put(EXPRTOKEN_NODETYPE_TEXT, "EXPRTOKEN_NODETYPE_TEXT"); + fTokenNames.put(EXPRTOKEN_NODETYPE_PI, "EXPRTOKEN_NODETYPE_PI"); + fTokenNames.put(EXPRTOKEN_NODETYPE_NODE, "EXPRTOKEN_NODETYPE_NODE"); + fTokenNames.put(EXPRTOKEN_OPERATOR_AND, "EXPRTOKEN_OPERATOR_AND"); + fTokenNames.put(EXPRTOKEN_OPERATOR_OR, "EXPRTOKEN_OPERATOR_OR"); + fTokenNames.put(EXPRTOKEN_OPERATOR_MOD, "EXPRTOKEN_OPERATOR_MOD"); + fTokenNames.put(EXPRTOKEN_OPERATOR_DIV, "EXPRTOKEN_OPERATOR_DIV"); + fTokenNames.put(EXPRTOKEN_OPERATOR_MULT, "EXPRTOKEN_OPERATOR_MULT"); + fTokenNames.put(EXPRTOKEN_OPERATOR_SLASH, "EXPRTOKEN_OPERATOR_SLASH"); + fTokenNames.put(EXPRTOKEN_OPERATOR_DOUBLE_SLASH, "EXPRTOKEN_OPERATOR_DOUBLE_SLASH"); + fTokenNames.put(EXPRTOKEN_OPERATOR_UNION, "EXPRTOKEN_OPERATOR_UNION"); + fTokenNames.put(EXPRTOKEN_OPERATOR_PLUS, "EXPRTOKEN_OPERATOR_PLUS"); + fTokenNames.put(EXPRTOKEN_OPERATOR_MINUS, "EXPRTOKEN_OPERATOR_MINUS"); + fTokenNames.put(EXPRTOKEN_OPERATOR_EQUAL, "EXPRTOKEN_OPERATOR_EQUAL"); + fTokenNames.put(EXPRTOKEN_OPERATOR_NOT_EQUAL, "EXPRTOKEN_OPERATOR_NOT_EQUAL"); + fTokenNames.put(EXPRTOKEN_OPERATOR_LESS, "EXPRTOKEN_OPERATOR_LESS"); + fTokenNames.put(EXPRTOKEN_OPERATOR_LESS_EQUAL, "EXPRTOKEN_OPERATOR_LESS_EQUAL"); + fTokenNames.put(EXPRTOKEN_OPERATOR_GREATER, "EXPRTOKEN_OPERATOR_GREATER"); + fTokenNames.put(EXPRTOKEN_OPERATOR_GREATER_EQUAL, "EXPRTOKEN_OPERATOR_GREATER_EQUAL"); + fTokenNames.put(EXPRTOKEN_FUNCTION_NAME, "EXPRTOKEN_FUNCTION_NAME"); + fTokenNames.put(EXPRTOKEN_AXISNAME_ANCESTOR, "EXPRTOKEN_AXISNAME_ANCESTOR"); + fTokenNames.put(EXPRTOKEN_AXISNAME_ANCESTOR_OR_SELF, "EXPRTOKEN_AXISNAME_ANCESTOR_OR_SELF"); + fTokenNames.put(EXPRTOKEN_AXISNAME_ATTRIBUTE, "EXPRTOKEN_AXISNAME_ATTRIBUTE"); + fTokenNames.put(EXPRTOKEN_AXISNAME_CHILD, "EXPRTOKEN_AXISNAME_CHILD"); + fTokenNames.put(EXPRTOKEN_AXISNAME_DESCENDANT, "EXPRTOKEN_AXISNAME_DESCENDANT"); + fTokenNames.put(EXPRTOKEN_AXISNAME_DESCENDANT_OR_SELF, "EXPRTOKEN_AXISNAME_DESCENDANT_OR_SELF"); + fTokenNames.put(EXPRTOKEN_AXISNAME_FOLLOWING, "EXPRTOKEN_AXISNAME_FOLLOWING"); + fTokenNames.put(EXPRTOKEN_AXISNAME_FOLLOWING_SIBLING, "EXPRTOKEN_AXISNAME_FOLLOWING_SIBLING"); + fTokenNames.put(EXPRTOKEN_AXISNAME_NAMESPACE, "EXPRTOKEN_AXISNAME_NAMESPACE"); + fTokenNames.put(EXPRTOKEN_AXISNAME_PARENT, "EXPRTOKEN_AXISNAME_PARENT"); + fTokenNames.put(EXPRTOKEN_AXISNAME_PRECEDING, "EXPRTOKEN_AXISNAME_PRECEDING"); + fTokenNames.put(EXPRTOKEN_AXISNAME_PRECEDING_SIBLING, "EXPRTOKEN_AXISNAME_PRECEDING_SIBLING"); + fTokenNames.put(EXPRTOKEN_AXISNAME_SELF, "EXPRTOKEN_AXISNAME_SELF"); + fTokenNames.put(EXPRTOKEN_LITERAL, "EXPRTOKEN_LITERAL"); + fTokenNames.put(EXPRTOKEN_NUMBER, "EXPRTOKEN_NUMBER"); + fTokenNames.put(EXPRTOKEN_VARIABLE_REFERENCE, "EXPRTOKEN_VARIABLE_REFERENCE"); } // @@ -946,16 +947,21 @@ public class XPath { // } // public String getTokenString(int token) { - return (String)fTokenNames.get(new Integer(token)); + return fTokenNames.get(token); } public void addToken(String tokenStr) { - Integer tokenInt = (Integer)fTokenNames.get(tokenStr); + Integer tokenInt = null; + for (Map.Entry<Integer, String> entry : fTokenNames.entrySet()) { + if (entry.getValue().equals(tokenStr)) { + tokenInt = entry.getKey(); + } + } if (tokenInt == null) { - tokenInt = new Integer(fTokenNames.size()); + tokenInt = fTokenNames.size(); fTokenNames.put(tokenInt, tokenStr); } - addToken(tokenInt.intValue()); + addToken(tokenInt); } public void addToken(int token) { diff --git a/src/com/sun/org/apache/xerces/internal/impl/xpath/regex/ParserForXMLSchema.java b/src/com/sun/org/apache/xerces/internal/impl/xpath/regex/ParserForXMLSchema.java index 22e2a71..427069b 100644 --- a/src/com/sun/org/apache/xerces/internal/impl/xpath/regex/ParserForXMLSchema.java +++ b/src/com/sun/org/apache/xerces/internal/impl/xpath/regex/ParserForXMLSchema.java @@ -1,13 +1,13 @@ /* - * reserved comment block - * DO NOT REMOVE OR ALTER! + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. */ /* - * Copyright 1999-2005 The Apache Software Foundation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * @@ -20,8 +20,9 @@ package com.sun.org.apache.xerces.internal.impl.xpath.regex; -import java.util.Hashtable; +import java.util.HashMap; import java.util.Locale; +import java.util.Map; /** * A regular expression parser for the XML Schema. @@ -369,12 +370,12 @@ class ParserForXMLSchema extends RegexParser { return c; } - static private Hashtable ranges = null; - static private Hashtable ranges2 = null; + static private Map<String, Token> ranges = null; + static private Map<String, Token> ranges2 = null; static synchronized protected RangeToken getRange(String name, boolean positive) { if (ranges == null) { - ranges = new Hashtable(); - ranges2 = new Hashtable(); + ranges = new HashMap<>(); + ranges2 = new HashMap<>(); Token tok = Token.createRange(); setupRange(tok, SPACES); @@ -390,7 +391,7 @@ class ParserForXMLSchema extends RegexParser { tok = Token.createRange(); setupRange(tok, LETTERS); setupRange(tok, LETTERS_INT); - tok.mergeRanges((Token)ranges.get("xml:isDigit")); + tok.mergeRanges(ranges.get("xml:isDigit")); ranges.put("xml:isWord", tok); ranges2.put("xml:isWord", Token.complementRanges(tok)); diff --git a/src/com/sun/org/apache/xerces/internal/impl/xpath/regex/Token.java b/src/com/sun/org/apache/xerces/internal/impl/xpath/regex/Token.java index a395e47..e364995 100644 --- a/src/com/sun/org/apache/xerces/internal/impl/xpath/regex/Token.java +++ b/src/com/sun/org/apache/xerces/internal/impl/xpath/regex/Token.java @@ -1,13 +1,13 @@ /* - * reserved comment block - * DO NOT REMOVE OR ALTER! + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. */ /* - * Copyright 1999-2002,2004,2005 The Apache Software Foundation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * @@ -20,8 +20,18 @@ package com.sun.org.apache.xerces.internal.impl.xpath.regex; +import java.io.IOException; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; +import java.io.ObjectStreamField; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; import java.util.Vector; -import java.util.Hashtable; /** * This class represents a node in parse tree. @@ -583,8 +593,8 @@ class Token implements java.io.Serializable { } // ------------------------------------------------------ - private final static Hashtable categories = new Hashtable(); - private final static Hashtable categories2 = new Hashtable(); + private final static Map<String, Token> categories = new HashMap<>(); + private final static Map<String, Token> categories2 = new HashMap<>(); private static final String[] categoryNames = { "Cn", "Lu", "Ll", "Lt", "Lm", "Lo", "Mn", "Me", "Mc", "Nd", "Nl", "No", "Zs", "Zl", "Zp", "Cc", "Cf", null, "Co", "Cs", @@ -820,7 +830,7 @@ class Token implements java.io.Serializable { //REVISIT: do we really need to support block names as in Unicode 3.1 // or we can just create all the names in IsBLOCKNAME format (XML Schema REC)? // - StringBuffer buffer = new StringBuffer(50); + StringBuilder buffer = new StringBuilder(50); for (int i = 0; i < Token.blockNames.length; i ++) { Token r1 = Token.createRange(); int location; @@ -972,22 +982,17 @@ class Token implements java.io.Serializable { return range; } - static Hashtable nonxs = null; + static final Set<String> nonxs = Collections.synchronizedSet(new HashSet<>()); /** * This method is called by only getRange(). * So this method need not MT-safe. */ static protected void registerNonXS(String name) { - if (Token.nonxs == null) - Token.nonxs = new Hashtable(); - Token.nonxs.put(name, name); + Token.nonxs.add(name); } + static protected boolean isRegisterNonXS(String name) { - if (Token.nonxs == null) - return false; - //DEBUG - //System.err.println("isRegisterNonXS: "+name); - return Token.nonxs.containsKey(name); + return Token.nonxs.contains(name); } private static void setAlias(String newName, String name, boolean positive) { @@ -1423,17 +1428,26 @@ class Token implements java.io.Serializable { private static final long serialVersionUID = -2568843945989489861L; - Vector children; + List<Token> children; + + /** + * @serialField children Vector children + */ + private static final ObjectStreamField[] serialPersistentFields = + new ObjectStreamField[] { + new ObjectStreamField("children", Vector.class), + }; UnionToken(int type) { super(type); } + @Override void addChild(Token tok) { if (tok == null) return; - if (this.children == null) this.children = new Vector(); + if (this.children == null) this.children = new ArrayList<>(); if (this.type == UNION) { - this.children.addElement(tok); + this.children.add(tok); return; } // This is CONCAT, and new child is CONCAT. @@ -1444,31 +1458,31 @@ class Token implements java.io.Serializable { } int size = this.children.size(); if (size == 0) { - this.children.addElement(tok); + this.children.add(tok); return; } - Token previous = (Token)this.children.elementAt(size-1); + Token previous = this.children.get(size - 1); if (!((previous.type == CHAR || previous.type == STRING) && (tok.type == CHAR || tok.type == STRING))) { - this.children.addElement(tok); + this.children.add(tok); return; } //System.err.println("Merge '"+previous+"' and '"+tok+"'."); - StringBuffer buffer; + StringBuilder buffer; int nextMaxLength = (tok.type == CHAR ? 2 : tok.getString().length()); if (previous.type == CHAR) { // Replace previous token by STRING - buffer = new StringBuffer(2 + nextMaxLength); + buffer = new StringBuilder(2 + nextMaxLength); int ch = previous.getChar(); if (ch >= 0x10000) buffer.append(REUtil.decomposeToSurrogates(ch)); else buffer.append((char)ch); previous = Token.createString(null); - this.children.setElementAt(previous, size-1); + this.children.set(size - 1, previous); } else { // STRING - buffer = new StringBuffer(previous.getString().length() + nextMaxLength); + buffer = new StringBuilder(previous.getString().length() + nextMaxLength); buffer.append(previous.getString()); } @@ -1485,13 +1499,16 @@ class Token implements java.io.Serializable { ((StringToken)previous).string = new String(buffer); } + @Override int size() { return this.children == null ? 0 : this.children.size(); } + @Override Token getChild(int index) { - return (Token)this.children.elementAt(index); + return this.children.get(index); } + @Override public String toString(int options) { String ret; if (this.type == CONCAT) { @@ -1505,9 +1522,9 @@ class Token implements java.io.Serializable { } else ret = ch.toString(options)+ch2.toString(options); } else { - StringBuffer sb = new StringBuffer(); + StringBuilder sb = new StringBuilder(); for (int i = 0; i < this.children.size(); i ++) { - sb.append(((Token)this.children.elementAt(i)).toString(options)); + sb.append(((Token)this.children.get(i)).toString(options)); } ret = new String(sb); } @@ -1519,15 +1536,39 @@ class Token implements java.io.Serializable { && this.getChild(0).type == EMPTY) { ret = this.getChild(1).toString(options)+"??"; } else { - StringBuffer sb = new StringBuffer(); - sb.append(((Token)this.children.elementAt(0)).toString(options)); + StringBuilder sb = new StringBuilder(); + sb.append((this.children.get(0)).toString(options)); for (int i = 1; i < this.children.size(); i ++) { sb.append((char)'|'); - sb.append(((Token)this.children.elementAt(i)).toString(options)); + sb.append((this.children.get(i)).toString(options)); } ret = new String(sb); } return ret; } + + /** + * @serialData Serialized fields. Convert the List to Vector for backward compatibility. + */ + private void writeObject(ObjectOutputStream out) throws IOException { + // Convert List to Vector + Vector<Token> vChildren = (children == null)? null : new Vector<>(children); + + // Write serialized fields + ObjectOutputStream.PutField pf = out.putFields(); + pf.put("children", vChildren); + out.writeFields(); + } + + @SuppressWarnings("unchecked") + private void readObject(ObjectInputStream in) + throws IOException, ClassNotFoundException { + // We have to read serialized fields first. + ObjectInputStream.GetField gf = in.readFields(); + Vector<Token> vChildren = (Vector<Token>)gf.get("children", null); + + //convert Vector back to List + if (vChildren != null) children = new ArrayList<>(vChildren); + } } } diff --git a/src/com/sun/org/apache/xerces/internal/impl/xs/SubstitutionGroupHandler.java b/src/com/sun/org/apache/xerces/internal/impl/xs/SubstitutionGroupHandler.java index 1fbe4c7..bd95b17 100644 --- a/src/com/sun/org/apache/xerces/internal/impl/xs/SubstitutionGroupHandler.java +++ b/src/com/sun/org/apache/xerces/internal/impl/xs/SubstitutionGroupHandler.java @@ -1,6 +1,5 @@ /* - * reserved comment block - * DO NOT REMOVE OR ALTER! + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. */ /* * Copyright 2001-2005 The Apache Software Foundation. @@ -20,12 +19,13 @@ package com.sun.org.apache.xerces.internal.impl.xs; +import com.sun.org.apache.xerces.internal.xni.QName; import com.sun.org.apache.xerces.internal.xs.XSConstants; import com.sun.org.apache.xerces.internal.xs.XSObjectList; import com.sun.org.apache.xerces.internal.xs.XSSimpleTypeDefinition; import com.sun.org.apache.xerces.internal.xs.XSTypeDefinition; -import com.sun.org.apache.xerces.internal.xni.QName; -import java.util.Hashtable; +import java.util.HashMap; +import java.util.Map; import java.util.Vector; /** @@ -172,14 +172,14 @@ public class SubstitutionGroupHandler { } // to store substitution group information - // the key to the hashtable is an element decl, and the value is + // the key to the map is an element decl, and the value is // - a Vector, which contains all elements that has this element as their // substitution group affilication // - an array of OneSubGroup, which contains its substitution group before block. - Hashtable fSubGroupsB = new Hashtable(); + Map<XSElementDecl, Object> fSubGroupsB = new HashMap<>(); private static final OneSubGroup[] EMPTY_VECTOR = new OneSubGroup[0]; // The real substitution groups (after "block") - Hashtable fSubGroups = new Hashtable(); + Map<XSElementDecl, XSElementDecl[]> fSubGroups = new HashMap<>(); /** * clear the internal registry of substitutionGroup information @@ -221,9 +221,9 @@ public class SubstitutionGroupHandler { */ public XSElementDecl[] getSubstitutionGroup(XSElementDecl element) { // If we already have sub group for this element, just return it. - Object subGroup = fSubGroups.get(element); + XSElementDecl[] subGroup = fSubGroups.get(element); if (subGroup != null) - return (XSElementDecl[])subGroup; + return subGroup; if ((element.fBlock & XSConstants.DERIVATION_SUBSTITUTION) != 0) { fSubGroups.put(element, EMPTY_GROUP); diff --git a/src/com/sun/org/apache/xerces/internal/impl/xs/XMLSchemaLoader.java b/src/com/sun/org/apache/xerces/internal/impl/xs/XMLSchemaLoader.java index 8694de8..3e3ec63 100644 --- a/src/com/sun/org/apache/xerces/internal/impl/xs/XMLSchemaLoader.java +++ b/src/com/sun/org/apache/xerces/internal/impl/xs/XMLSchemaLoader.java @@ -1,15 +1,15 @@ /* - * reserved comment block - * DO NOT REMOVE OR ALTER! + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. */ /* - * Copyright 2000-2005 The Apache Software Foundation. + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -20,26 +20,12 @@ package com.sun.org.apache.xerces.internal.impl.xs; -import java.io.BufferedInputStream; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.io.InputStream; -import java.io.Reader; -import java.io.StringReader; -import java.util.Hashtable; -import java.util.Locale; -import java.util.StringTokenizer; -import java.util.Vector; - import com.sun.org.apache.xerces.internal.dom.DOMErrorImpl; import com.sun.org.apache.xerces.internal.dom.DOMMessageFormatter; import com.sun.org.apache.xerces.internal.dom.DOMStringListImpl; import com.sun.org.apache.xerces.internal.impl.Constants; import com.sun.org.apache.xerces.internal.impl.XMLEntityManager; import com.sun.org.apache.xerces.internal.impl.XMLErrorReporter; -import com.sun.org.apache.xerces.internal.impl.dv.DVFactoryException; import com.sun.org.apache.xerces.internal.impl.dv.InvalidDatatypeValueException; import com.sun.org.apache.xerces.internal.impl.dv.SchemaDVFactory; import com.sun.org.apache.xerces.internal.impl.dv.xs.SchemaDVFactoryImpl; @@ -72,14 +58,25 @@ import com.sun.org.apache.xerces.internal.xs.LSInputList; import com.sun.org.apache.xerces.internal.xs.StringList; import com.sun.org.apache.xerces.internal.xs.XSLoader; import com.sun.org.apache.xerces.internal.xs.XSModel; +import java.io.BufferedInputStream; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.InputStream; +import java.io.Reader; +import java.io.StringReader; import java.util.HashMap; +import java.util.Locale; import java.util.Map; +import java.util.StringTokenizer; +import java.util.Vector; import javax.xml.XMLConstants; import org.w3c.dom.DOMConfiguration; import org.w3c.dom.DOMError; import org.w3c.dom.DOMErrorHandler; -import org.w3c.dom.DOMStringList; import org.w3c.dom.DOMException; +import org.w3c.dom.DOMStringList; import org.w3c.dom.ls.LSInput; import org.w3c.dom.ls.LSResourceResolver; import org.xml.sax.InputSource; @@ -596,9 +593,8 @@ XSLoader, DOMConfiguration { * @throws IOException * @throws XNIException */ - SchemaGrammar loadSchema(XSDDescription desc, - XMLInputSource source, - Map locationPairs) throws IOException, XNIException { + SchemaGrammar loadSchema(XSDDescription desc, XMLInputSource source, + Map<String, LocationArray> locationPairs) throws IOException, XNIException { // this should only be done once per invocation of this object; // unless application alters JAXPSource in the mean time. @@ -620,9 +616,9 @@ XSLoader, DOMConfiguration { } // loadSchema(XSDDescription, XMLInputSource): SchemaGrammar /** This method tries to resolve location of the given schema. - * The loader stores the namespace/location pairs in a hashtable (use "" as the + * The loader stores the namespace/location pairs in a map (use "" as the * namespace of absent namespace). When resolving an entity, loader first tries - * to find in the hashtable whether there is a value for that namespace, + * to find in the map whether there is a value for that namespace, * if so, pass that location value to the user-defined entity resolver. * * @param desc @@ -631,7 +627,8 @@ XSLoader, DOMConfiguration { * @return * @throws IOException */ - public static XMLInputSource resolveDocument(XSDDescription desc, Map locationPairs, + public static XMLInputSource resolveDocument(XSDDescription desc, + Map<String, LocationArray> locationPairs, XMLEntityResolver entityResolver) throws IOException { String loc = null; // we consider the schema location properties for import @@ -641,7 +638,7 @@ XSLoader, DOMConfiguration { String namespace = desc.getTargetNamespace(); String ns = namespace == null ? XMLSymbols.EMPTY_STRING : namespace; // get the location hint for that namespace - LocationArray tempLA = (LocationArray)locationPairs.get(ns); + LocationArray tempLA = locationPairs.get(ns); if(tempLA != null) loc = tempLA.getFirstLocation(); } @@ -662,7 +659,7 @@ XSLoader, DOMConfiguration { // add external schema locations to the location pairs public static void processExternalHints(String sl, String nsl, - Map locations, + Map<String, XMLSchemaLoader.LocationArray> locations, XMLErrorReporter er) { if (sl != null) { try { @@ -715,7 +712,8 @@ XSLoader, DOMConfiguration { // @param schemaStr The schemaLocation string to tokenize // @param locations HashMap mapping namespaces to LocationArray objects holding lists of locaitons // @return true if no problems; false if string could not be tokenized - public static boolean tokenizeSchemaLocationStr(String schemaStr, Map locations) { + public static boolean tokenizeSchemaLocationStr(String schemaStr, + Map<String, XMLSchemaLoader.LocationArray> locations) { if (schemaStr!= null) { StringTokenizer t = new StringTokenizer(schemaStr, " \n\t\r"); String namespace, location; @@ -725,7 +723,7 @@ XSLoader, DOMConfiguration { return false; // error! } location = t.nextToken(); - LocationArray la = ((LocationArray)locations.get(namespace)); + LocationArray la = locations.get(namespace); if(la == null) { la = new LocationArray(); locations.put(namespace, la); @@ -746,7 +744,8 @@ XSLoader, DOMConfiguration { * Note: all JAXP schema files will be checked for full-schema validity if the feature was set up * */ - private void processJAXPSchemaSource(Map locationPairs) throws IOException { + private void processJAXPSchemaSource( + Map<String, LocationArray> locationPairs) throws IOException { fJAXPProcessed = true; if (fJAXPSource == null) { return; @@ -925,7 +924,7 @@ XSLoader, DOMConfiguration { return new XMLInputSource(publicId, systemId, null); } - static class LocationArray{ + public static class LocationArray{ int length ; String [] locations = new String[2]; diff --git a/src/com/sun/org/apache/xerces/internal/impl/xs/XMLSchemaValidator.java b/src/com/sun/org/apache/xerces/internal/impl/xs/XMLSchemaValidator.java index f7fc09a..c138b7f 100644 --- a/src/com/sun/org/apache/xerces/internal/impl/xs/XMLSchemaValidator.java +++ b/src/com/sun/org/apache/xerces/internal/impl/xs/XMLSchemaValidator.java @@ -1,15 +1,15 @@ /* - * reserved comment block - * DO NOT REMOVE OR ALTER! + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. */ /* - * Copyright 1999-2005 The Apache Software Foundation. + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -20,16 +20,6 @@ package com.sun.org.apache.xerces.internal.impl.xs; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Hashtable; -import java.util.Iterator; -import java.util.Map; -import java.util.Stack; -import java.util.Vector; -import java.util.ArrayList; -import javax.xml.XMLConstants; import com.sun.org.apache.xerces.internal.impl.Constants; import com.sun.org.apache.xerces.internal.impl.RevalidationHandler; import com.sun.org.apache.xerces.internal.impl.XMLEntityManager; @@ -51,13 +41,14 @@ import com.sun.org.apache.xerces.internal.impl.xs.identity.XPathMatcher; import com.sun.org.apache.xerces.internal.impl.xs.models.CMBuilder; import com.sun.org.apache.xerces.internal.impl.xs.models.CMNodeFactory; import com.sun.org.apache.xerces.internal.impl.xs.models.XSCMValidator; +import com.sun.org.apache.xerces.internal.parsers.XMLParser; import com.sun.org.apache.xerces.internal.util.AugmentationsImpl; import com.sun.org.apache.xerces.internal.util.IntStack; import com.sun.org.apache.xerces.internal.util.SymbolTable; +import com.sun.org.apache.xerces.internal.util.URI.MalformedURIException; import com.sun.org.apache.xerces.internal.util.XMLAttributesImpl; import com.sun.org.apache.xerces.internal.util.XMLChar; import com.sun.org.apache.xerces.internal.util.XMLSymbols; -import com.sun.org.apache.xerces.internal.util.URI.MalformedURIException; import com.sun.org.apache.xerces.internal.xni.Augmentations; import com.sun.org.apache.xerces.internal.xni.NamespaceContext; import com.sun.org.apache.xerces.internal.xni.QName; @@ -83,7 +74,13 @@ import com.sun.org.apache.xerces.internal.xs.StringList; import com.sun.org.apache.xerces.internal.xs.XSConstants; import com.sun.org.apache.xerces.internal.xs.XSObjectList; import com.sun.org.apache.xerces.internal.xs.XSTypeDefinition; -import com.sun.org.apache.xerces.internal.parsers.XMLParser; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Stack; +import java.util.Vector; /** * The XML Schema validator. The validator implements a document @@ -308,9 +305,6 @@ public class XMLSchemaValidator protected static final int ID_CONSTRAINT_NUM = 1; // - private static final Hashtable EMPTY_TABLE = new Hashtable(); - - // // Data // @@ -495,7 +489,7 @@ public class XMLSchemaValidator /** Schema Grammar Description passed, to give a chance to application to supply the Grammar */ protected final XSDDescription fXSDDescription = new XSDDescription(); - protected final Hashtable fLocationPairs = new Hashtable(); + protected final Map<String, XMLSchemaLoader.LocationArray> fLocationPairs = new HashMap<>(); // handlers @@ -2358,8 +2352,7 @@ public class XMLSchemaValidator } } if (nsLocation != null) { - XMLSchemaLoader.LocationArray la = - ((XMLSchemaLoader.LocationArray) fLocationPairs.get(XMLSymbols.EMPTY_STRING)); + XMLSchemaLoader.LocationArray la = fLocationPairs.get(XMLSymbols.EMPTY_STRING); if (la == null) { la = new XMLSchemaLoader.LocationArray(); fLocationPairs.put(XMLSymbols.EMPTY_STRING, la); @@ -2414,11 +2407,11 @@ public class XMLSchemaValidator fXSDDescription.setBaseSystemId(fLocator.getExpandedSystemId()); } - Hashtable locationPairs = fLocationPairs; - Object locationArray = + Map<String, XMLSchemaLoader.LocationArray> locationPairs = fLocationPairs; + XMLSchemaLoader.LocationArray locationArray = locationPairs.get(namespace == null ? XMLSymbols.EMPTY_STRING : namespace); if (locationArray != null) { - String[] temp = ((XMLSchemaLoader.LocationArray) locationArray).getLocationArray(); + String[] temp = locationArray.getLocationArray(); if (temp.length != 0) { setLocationHints(fXSDDescription, temp, grammar); } @@ -2428,7 +2421,7 @@ public class XMLSchemaValidator boolean toParseSchema = true; if (grammar != null) { // use location hints instead - locationPairs = EMPTY_TABLE; + locationPairs = Collections.emptyMap(); } // try to parse the grammar using location hints from that namespace.. @@ -3688,7 +3681,7 @@ public class XMLSchemaValidator protected void checkDuplicateValues() { // no-op - } // duplicateValue(Hashtable) + } // duplicateValue(Map) /** Returns a string of the specified values. */ protected String toString(Object[] values) { @@ -3861,7 +3854,7 @@ public class XMLSchemaValidator String cName = fIdentityConstraint.getIdentityConstraintName(); reportSchemaError(code, new Object[] { value, eName, cName }); } - } // duplicateValue(Hashtable) + } // duplicateValue(Map) } // class UniqueValueStore @@ -3898,7 +3891,7 @@ public class XMLSchemaValidator String cName = fIdentityConstraint.getIdentityConstraintName(); reportSchemaError(code, new Object[] { value, eName, cName }); } - } // duplicateValue(Hashtable) + } // duplicateValue(Map) } // class KeyValueStore @@ -3990,14 +3983,15 @@ public class XMLSchemaValidator /** * Values stores associated to specific identity constraints. - * This hashtable maps IdentityConstraints and + * This map maps IdentityConstraints and * the 0-based element on which their selectors first matched to * a corresponding ValueStore. This should take care * of all cases, including where ID constraints with * descendant-or-self axes occur on recursively-defined * elements. */ - protected final Hashtable fIdentityConstraint2ValueStoreMap = new Hashtable(); + protected final Map<LocalIDKey, ValueStoreBase> + fIdentityConstraint2ValueStoreMap = new HashMap<>(); // sketch of algorithm: // - when a constraint is first encountered, its @@ -4010,7 +4004,7 @@ public class XMLSchemaValidator // The fGlobalIDMapStack has the following structure: // - validation always occurs against the fGlobalIDConstraintMap // (which comprises all the "eligible" id constraints); - // When an endElement is found, this Hashtable is merged with the one + // When an endElement is found, this Map is merged with the one // below in the stack. // When a start tag is encountered, we create a new // fGlobalIDConstraintMap. @@ -4018,8 +4012,10 @@ public class XMLSchemaValidator // the preceding siblings' eligible id constraints; // the fGlobalIDConstraintMap contains descendants+self. // keyrefs can only match descendants+self. - protected final Stack fGlobalMapStack = new Stack(); - protected final Hashtable fGlobalIDConstraintMap = new Hashtable(); + protected final Stack<Map<IdentityConstraint, ValueStoreBase>> + fGlobalMapStack = new Stack<>(); + protected final Map<IdentityConstraint, ValueStoreBase> + fGlobalIDConstraintMap = new HashMap<>(); // // Constructors @@ -4046,7 +4042,8 @@ public class XMLSchemaValidator public void startElement() { // only clone the hashtable when there are elements if (fGlobalIDConstraintMap.size() > 0) - fGlobalMapStack.push(fGlobalIDConstraintMap.clone()); + fGlobalMapStack.push((Map<IdentityConstraint, ValueStoreBase>) + ((HashMap)fGlobalIDConstraintMap).clone()); else fGlobalMapStack.push(null); fGlobalIDConstraintMap.clear(); @@ -4059,19 +4056,17 @@ public class XMLSchemaValidator if (fGlobalMapStack.isEmpty()) { return; // must be an invalid doc! } - Hashtable oldMap = (Hashtable) fGlobalMapStack.pop(); + Map<IdentityConstraint, ValueStoreBase> oldMap = fGlobalMapStack.pop(); // return if there is no element if (oldMap == null) { return; } - Iterator entries = oldMap.entrySet().iterator(); - while (entries.hasNext()) { - Map.Entry entry = (Map.Entry) entries.next(); - IdentityConstraint id = (IdentityConstraint) entry.getKey(); - ValueStoreBase oldVal = (ValueStoreBase) entry.getValue(); + for (Map.Entry<IdentityConstraint, ValueStoreBase> entry : oldMap.entrySet()) { + IdentityConstraint id = entry.getKey(); + ValueStoreBase oldVal = entry.getValue(); if (oldVal != null) { - ValueStoreBase currVal = (ValueStoreBase) fGlobalIDConstraintMap.get(id); + ValueStoreBase currVal = fGlobalIDConstraintMap.get(id); if (currVal == null) { fGlobalIDConstraintMap.put(id, oldVal); } @@ -4145,26 +4140,25 @@ public class XMLSchemaValidator public ValueStoreBase getValueStoreFor(IdentityConstraint id, int initialDepth) { fLocalId.fDepth = initialDepth; fLocalId.fId = id; - return (ValueStoreBase) fIdentityConstraint2ValueStoreMap.get(fLocalId); + return fIdentityConstraint2ValueStoreMap.get(fLocalId); } // getValueStoreFor(IdentityConstraint, int):ValueStoreBase /** Returns the global value store associated to the specified IdentityConstraint. */ public ValueStoreBase getGlobalValueStoreFor(IdentityConstraint id) { - return (ValueStoreBase) fGlobalIDConstraintMap.get(id); + return fGlobalIDConstraintMap.get(id); } // getValueStoreFor(IdentityConstraint):ValueStoreBase // This method takes the contents of the (local) ValueStore // associated with id and moves them into the global - // hashtable, if id is a <unique> or a <key>. + // map, if id is a <unique> or a <key>. // If it's a <keyRef>, then we leave it for later. public void transplant(IdentityConstraint id, int initialDepth) { fLocalId.fDepth = initialDepth; fLocalId.fId = id; - ValueStoreBase newVals = - (ValueStoreBase) fIdentityConstraint2ValueStoreMap.get(fLocalId); + ValueStoreBase newVals = fIdentityConstraint2ValueStoreMap.get(fLocalId); if (id.getCategory() == IdentityConstraint.IC_KEYREF) return; - ValueStoreBase currVals = (ValueStoreBase) fGlobalIDConstraintMap.get(id); + ValueStoreBase currVals = fGlobalIDConstraintMap.get(id); if (currVals != null) { currVals.append(newVals); fGlobalIDConstraintMap.put(id, currVals); @@ -4205,7 +4199,7 @@ public class XMLSchemaValidator } // class ValueStoreCache // the purpose of this class is to enable IdentityConstraint,int - // pairs to be used easily as keys in Hashtables. + // pairs to be used easily as keys in Maps. protected class LocalIDKey { public IdentityConstraint fId; diff --git a/src/com/sun/org/apache/xerces/internal/impl/xs/XSGrammarBucket.java b/src/com/sun/org/apache/xerces/internal/impl/xs/XSGrammarBucket.java index 6d88c5f..525afee 100644 --- a/src/com/sun/org/apache/xerces/internal/impl/xs/XSGrammarBucket.java +++ b/src/com/sun/org/apache/xerces/internal/impl/xs/XSGrammarBucket.java @@ -1,13 +1,13 @@ /* - * reserved comment block - * DO NOT REMOVE OR ALTER! + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. */ /* - * Copyright 2001, 2002,2004 The Apache Software Foundation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * @@ -20,7 +20,6 @@ package com.sun.org.apache.xerces.internal.impl.xs; -import java.util.Enumeration; import java.util.HashMap; import java.util.Map; import java.util.Vector; @@ -38,7 +37,7 @@ public class XSGrammarBucket { // Data /** - * Hashtable that maps between Namespace and a Grammar + * Map that maps between Namespace and a Grammar */ Map<String, SchemaGrammar> fGrammarRegistry = new HashMap(); SchemaGrammar fNoNSGrammar = null; diff --git a/src/com/sun/org/apache/xerces/internal/impl/xs/models/CMNodeFactory.java b/src/com/sun/org/apache/xerces/internal/impl/xs/models/CMNodeFactory.java index 6aa06b8..d094a5b 100644 --- a/src/com/sun/org/apache/xerces/internal/impl/xs/models/CMNodeFactory.java +++ b/src/com/sun/org/apache/xerces/internal/impl/xs/models/CMNodeFactory.java @@ -115,7 +115,7 @@ public class CMNodeFactory { System.out.println("nodeCount = " + nodeCount ) ; System.out.println("nodeLimit = " + maxNodeLimit ) ; } - fErrorReporter.reportError(XSMessageFormatter.SCHEMA_DOMAIN, "maxOccurLimit", new Object[]{ new Integer(maxNodeLimit) }, XMLErrorReporter.SEVERITY_FATAL_ERROR); + fErrorReporter.reportError(XSMessageFormatter.SCHEMA_DOMAIN, "MaxOccurLimit", new Object[]{ new Integer(maxNodeLimit) }, XMLErrorReporter.SEVERITY_FATAL_ERROR); // similarly to entity manager behaviour, take into accont // behaviour if continue-after-fatal-error is set. nodeCount = 0; diff --git a/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSAttributeChecker.java b/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSAttributeChecker.java index f9eea6a..92a3a83 100644 --- a/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSAttributeChecker.java +++ b/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSAttributeChecker.java @@ -1,13 +1,13 @@ /* - * reserved comment block - * DO NOT REMOVE OR ALTER! + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. */ /* - * Copyright 2001-2004 The Apache Software Foundation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * @@ -20,12 +20,6 @@ package com.sun.org.apache.xerces.internal.impl.xs.traversers; -import java.util.Hashtable; -import java.util.Iterator; -import java.util.Map; -import java.util.StringTokenizer; -import java.util.Vector; - import com.sun.org.apache.xerces.internal.impl.dv.InvalidDatatypeValueException; import com.sun.org.apache.xerces.internal.impl.dv.XSSimpleType; import com.sun.org.apache.xerces.internal.impl.xs.SchemaGrammar; @@ -44,6 +38,10 @@ import com.sun.org.apache.xerces.internal.utils.XMLSecurityManager; import com.sun.org.apache.xerces.internal.xni.QName; import com.sun.org.apache.xerces.internal.xs.XSConstants; import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; +import java.util.StringTokenizer; +import java.util.Vector; import org.w3c.dom.Attr; import org.w3c.dom.Element; @@ -64,7 +62,7 @@ import org.w3c.dom.Element; * - Whether to return non-schema attributes/values * - Do we need to update NamespaceScope and ErrorReporter when reset()? * - Should have the datatype validators return compiled value - * - use symbol table instead of many hashtables + * - use symbol table instead of many maps * * @xerces.internal * @@ -1026,9 +1024,7 @@ public class XSAttributeChecker { return null; } - //Hashtable attrValues = new Hashtable(); Object[] attrValues = getAvailableArray(); - //Hashtable otherValues = new Hashtable(); long fromDefault = 0; // clear the "seen" flag. @@ -1197,7 +1193,7 @@ public class XSAttributeChecker { // maxOccurNodeLimit. int maxOccurNodeLimit = fSchemaHandler.fSecureProcessing.getLimit(XMLSecurityManager.Limit.MAX_OCCUR_NODE_LIMIT); if (max > maxOccurNodeLimit && !fSchemaHandler.fSecureProcessing.isNoLimit(maxOccurNodeLimit)) { - reportSchemaFatalError("maxOccurLimit", new Object[] {new Integer(maxOccurNodeLimit)}, element); + reportSchemaFatalError("MaxOccurLimit", new Object[] {new Integer(maxOccurNodeLimit)}, element); // reset max values in case processing continues on error attrValues[ATTIDX_MAXOCCURS] = fXIntPool.getXInt(maxOccurNodeLimit); diff --git a/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDHandler.java b/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDHandler.java index d6a6e94..825e792 100644 --- a/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDHandler.java +++ b/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDHandler.java @@ -1,13 +1,13 @@ /* - * reserved comment block - * DO NOT REMOVE OR ALTER! + * Copyright (c) 2007, 2015, Oracle and/or its affiliates. All rights reserved. */ /* - * Copyright 1999-2005 The Apache Software Foundation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * @@ -20,21 +20,6 @@ package com.sun.org.apache.xerces.internal.impl.xs.traversers; -import java.io.IOException; -import java.io.StringReader; -import java.util.ArrayList; -import java.util.Enumeration; -import java.util.Hashtable; -import java.util.HashMap; -import java.util.Locale; -import java.util.Map; -import java.util.Stack; -import java.util.Vector; - -import javax.xml.stream.XMLEventReader; -import javax.xml.stream.XMLStreamException; -import javax.xml.stream.XMLStreamReader; - import com.sun.org.apache.xerces.internal.impl.Constants; import com.sun.org.apache.xerces.internal.impl.XMLEntityManager; import com.sun.org.apache.xerces.internal.impl.XMLErrorReporter; @@ -74,11 +59,11 @@ import com.sun.org.apache.xerces.internal.util.StAXInputSource; import com.sun.org.apache.xerces.internal.util.StAXLocationWrapper; import com.sun.org.apache.xerces.internal.util.SymbolHash; import com.sun.org.apache.xerces.internal.util.SymbolTable; -import com.sun.org.apache.xerces.internal.util.XMLSymbols; import com.sun.org.apache.xerces.internal.util.URI.MalformedURIException; +import com.sun.org.apache.xerces.internal.util.XMLSymbols; import com.sun.org.apache.xerces.internal.utils.SecuritySupport; -import com.sun.org.apache.xerces.internal.utils.XMLSecurityPropertyManager; import com.sun.org.apache.xerces.internal.utils.XMLSecurityManager; +import com.sun.org.apache.xerces.internal.utils.XMLSecurityPropertyManager; import com.sun.org.apache.xerces.internal.xni.QName; import com.sun.org.apache.xerces.internal.xni.XNIException; import com.sun.org.apache.xerces.internal.xni.grammars.Grammar; @@ -107,7 +92,19 @@ import com.sun.org.apache.xerces.internal.xs.XSSimpleTypeDefinition; import com.sun.org.apache.xerces.internal.xs.XSTerm; import com.sun.org.apache.xerces.internal.xs.XSTypeDefinition; import com.sun.org.apache.xerces.internal.xs.datatypes.ObjectList; +import java.io.IOException; +import java.io.StringReader; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.Locale; +import java.util.Map; +import java.util.Stack; +import java.util.Vector; import javax.xml.XMLConstants; +import javax.xml.stream.XMLEventReader; +import javax.xml.stream.XMLStreamException; +import javax.xml.stream.XMLStreamReader; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.Node; @@ -277,9 +274,9 @@ public class XSDHandler { private Map<String, Element> fUnparsedIdentityConstraintRegistry = new HashMap(); private Map<String, Element> fUnparsedNotationRegistry = new HashMap(); private Map<String, Element> fUnparsedTypeRegistry = new HashMap(); - // Compensation for the above hashtables to locate XSDocumentInfo, + // Compensation for the above maps to locate XSDocumentInfo, // Since we may take Schema Element directly, so can not get the - // corresponding XSDocumentInfo object just using above hashtables. + // corresponding XSDocumentInfo object just using above maps. private Map<String, XSDocumentInfo> fUnparsedAttributeRegistrySub = new HashMap(); private Map<String, XSDocumentInfo> fUnparsedAttributeGroupRegistrySub = new HashMap(); private Map<String, XSDocumentInfo> fUnparsedElementRegistrySub = new HashMap(); @@ -301,26 +298,25 @@ public class XSDHandler { null, // TYPEDECL_TYPE }; - // this hashtable is keyed on by XSDocumentInfo objects. Its values + // this map is keyed on by XSDocumentInfo objects. Its values // are Vectors containing the XSDocumentInfo objects <include>d, // <import>ed or <redefine>d by the key XSDocumentInfo. private Map<XSDocumentInfo, Vector> fDependencyMap = new HashMap(); - // this hashtable is keyed on by a target namespace. Its values + // this map is keyed on by a target namespace. Its values // are Vectors containing namespaces imported by schema documents // with the key target namespace. // if an imprted schema has absent namespace, the value "null" is stored. private Map<String, Vector> fImportMap = new HashMap(); // all namespaces that imports other namespaces // if the importing schema has absent namespace, empty string is stored. - // (because the key of a hashtable can't be null.) + // (because the key of a map can't be null.) private Vector fAllTNSs = new Vector(); // stores instance document mappings between namespaces and schema hints - private Map fLocationPairs = null; - private static final Map EMPTY_TABLE = new HashMap(); + private Map<String, XMLSchemaLoader.LocationArray> fLocationPairs = null; // Records which nodes are hidden when the input is a DOMInputSource. - Hashtable fHiddenNodes = null; + Map<Node, String> fHiddenNodes = null; // convenience methods private String null2EmptyString(String ns) { @@ -348,14 +344,14 @@ public class XSDHandler { // schema document that is included in multiple other schemas. private Map fTraversed = new HashMap(); - // this hashtable contains a mapping from Schema Element to its systemId + // this map contains a mapping from Schema Element to its systemId // this is useful to resolve a uri relative to the referring document private Map fDoc2SystemId = new HashMap(); // the primary XSDocumentInfo we were called to parse private XSDocumentInfo fRoot = null; - // This hashtable's job is to act as a link between the Schema Element and its + // This map's job is to act as a link between the Schema Element and its // XSDocumentInfo object. private Map fDoc2XSDocumentMap = new HashMap(); @@ -461,17 +457,17 @@ public class XSDHandler { private String [][] fKeyrefNamespaceContext = new String[INIT_KEYREF_STACK][1]; // global decls: map from decl name to decl object - SymbolHash fGlobalAttrDecls = new SymbolHash(); - SymbolHash fGlobalAttrGrpDecls = new SymbolHash(); - SymbolHash fGlobalElemDecls = new SymbolHash(); - SymbolHash fGlobalGroupDecls = new SymbolHash(); - SymbolHash fGlobalNotationDecls = new SymbolHash(); - SymbolHash fGlobalIDConstraintDecls = new SymbolHash(); - SymbolHash fGlobalTypeDecls = new SymbolHash(); + SymbolHash fGlobalAttrDecls = new SymbolHash(12); + SymbolHash fGlobalAttrGrpDecls = new SymbolHash(5); + SymbolHash fGlobalElemDecls = new SymbolHash(25); + SymbolHash fGlobalGroupDecls = new SymbolHash(5); + SymbolHash fGlobalNotationDecls = new SymbolHash(1); + SymbolHash fGlobalIDConstraintDecls = new SymbolHash(3); + SymbolHash fGlobalTypeDecls = new SymbolHash(25); // Constructors public XSDHandler(){ - fHiddenNodes = new Hashtable(); + fHiddenNodes = new HashMap<>(); fSchemaParser = new SchemaDOMParser(new SchemaParsingConfig()); } @@ -500,7 +496,7 @@ public class XSDHandler { * @throws IOException */ public SchemaGrammar parseSchema(XMLInputSource is, XSDDescription desc, - Map locationPairs) + Map<String, XMLSchemaLoader.LocationArray> locationPairs) throws IOException { fLocationPairs = locationPairs; fSchemaParser.resetNodePool(); @@ -1002,7 +998,7 @@ public class XSDHandler { // If "findGrammar" returns a grammar, then this is not the // the first time we see a location for a given namespace. - // Don't consult the location pair hashtable in this case, + // Don't consult the location pair map in this case, // otherwise the location will be ignored because it'll get // resolved to the same location as the first hint. newSchemaRoot = resolveSchema(fSchemaGrammarDescription, false, child, isg == null); @@ -2048,7 +2044,7 @@ public class XSDHandler { Element referElement, boolean usePairs) { XMLInputSource schemaSource = null; try { - Map pairs = usePairs ? fLocationPairs : EMPTY_TABLE; + Map<String, XMLSchemaLoader.LocationArray> pairs = usePairs ? fLocationPairs : Collections.emptyMap(); schemaSource = XMLSchemaLoader.resolveDocument(desc, pairs, fEntityResolver); } catch (IOException ex) { @@ -2101,7 +2097,7 @@ public class XSDHandler { XMLInputSource schemaSource = null; try { - Map pairs = usePairs ? fLocationPairs : EMPTY_TABLE; + Map<String, XMLSchemaLoader.LocationArray> pairs = usePairs ? fLocationPairs : Collections.emptyMap(); schemaSource = XMLSchemaLoader.resolveDocument(desc, pairs, fEntityResolver); } catch (IOException ex) { @@ -3791,7 +3787,7 @@ public class XSDHandler { fUnparsedRegistriesExt[declType].put(qName, currSchema); } - } // checkForDuplicateNames(String, Hashtable, Element, XSDocumentInfo):void + } // checkForDuplicateNames(String, Map, Element, XSDocumentInfo):void void checkForDuplicateNames(String qName, int declType, Element currComp) { int namespaceEnd = qName.indexOf(','); @@ -3962,7 +3958,7 @@ public class XSDHandler { // this method takes a name of the form a:b, determines the URI mapped // to by a in the current SchemaNamespaceSupport object, and returns this // information in the form (nsURI,b) suitable for lookups in the global - // decl Hashtables. + // decl maps. // REVISIT: should have it return QName, instead of String. this would // save lots of string concatenation time. we can use // QName#equals() to compare two QNames, and use QName directly diff --git a/src/com/sun/org/apache/xerces/internal/jaxp/DocumentBuilderFactoryImpl.java b/src/com/sun/org/apache/xerces/internal/jaxp/DocumentBuilderFactoryImpl.java index aea63c2..fd9298f 100644 --- a/src/com/sun/org/apache/xerces/internal/jaxp/DocumentBuilderFactoryImpl.java +++ b/src/com/sun/org/apache/xerces/internal/jaxp/DocumentBuilderFactoryImpl.java @@ -1,13 +1,13 @@ /* - * reserved comment block - * DO NOT REMOVE OR ALTER! + * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. */ /* - * Copyright 2000-2002,2004,2005 The Apache Software Foundation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * @@ -20,16 +20,15 @@ package com.sun.org.apache.xerces.internal.jaxp; -import java.util.Hashtable; - +import com.sun.org.apache.xerces.internal.parsers.DOMParser; +import com.sun.org.apache.xerces.internal.util.SAXMessageFormatter; +import java.util.HashMap; +import java.util.Map; import javax.xml.XMLConstants; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.ParserConfigurationException; import javax.xml.validation.Schema; - -import com.sun.org.apache.xerces.internal.parsers.DOMParser; -import com.sun.org.apache.xerces.internal.util.SAXMessageFormatter; import org.xml.sax.SAXException; import org.xml.sax.SAXNotRecognizedException; import org.xml.sax.SAXNotSupportedException; @@ -41,8 +40,8 @@ import org.xml.sax.SAXNotSupportedException; */ public class DocumentBuilderFactoryImpl extends DocumentBuilderFactory { /** These are DocumentBuilderFactory attributes not DOM attributes */ - private Hashtable attributes; - private Hashtable features; + private Map<String, Object> attributes; + private Map<String, Boolean> features; private Schema grammar; private boolean isXIncludeAware; @@ -101,9 +100,9 @@ public class DocumentBuilderFactoryImpl extends DocumentBuilderFactory { // This is ugly. We have to collect the attributes and then // later create a DocumentBuilderImpl to verify the attributes. - // Create Hashtable if none existed before + // Create the Map if none existed before if (attributes == null) { - attributes = new Hashtable(); + attributes = new HashMap<>(); } attributes.put(name, value); @@ -124,7 +123,7 @@ public class DocumentBuilderFactoryImpl extends DocumentBuilderFactory { public Object getAttribute(String name) throws IllegalArgumentException { - // See if it's in the attributes Hashtable + // See if it's in the attributes Map if (attributes != null) { Object val = attributes.get(name); if (val != null) { @@ -135,7 +134,7 @@ public class DocumentBuilderFactoryImpl extends DocumentBuilderFactory { DOMParser domParser = null; try { // We create a dummy DocumentBuilderImpl in case the attribute - // name is not one that is in the attributes hashtable. + // name is not one that is in the attributes map. domParser = new DocumentBuilderImpl(this, attributes, features).getDOMParser(); return domParser.getProperty(name); @@ -173,11 +172,11 @@ public class DocumentBuilderFactoryImpl extends DocumentBuilderFactory { if (name.equals(XMLConstants.FEATURE_SECURE_PROCESSING)) { return fSecureProcess; } - // See if it's in the features Hashtable + // See if it's in the features map if (features != null) { - Object val = features.get(name); + Boolean val = features.get(name); if (val != null) { - return ((Boolean) val).booleanValue(); + return val; } } try { @@ -192,7 +191,7 @@ public class DocumentBuilderFactoryImpl extends DocumentBuilderFactory { public void setFeature(String name, boolean value) throws ParserConfigurationException { if (features == null) { - features = new Hashtable(); + features = new HashMap<>(); } // If this is the secure processing feature, save it then return. if (name.equals(XMLConstants.FEATURE_SECURE_PROCESSING)) { diff --git a/src/com/sun/org/apache/xerces/internal/jaxp/DocumentBuilderImpl.java b/src/com/sun/org/apache/xerces/internal/jaxp/DocumentBuilderImpl.java index 51f22d7..b523866 100644 --- a/src/com/sun/org/apache/xerces/internal/jaxp/DocumentBuilderImpl.java +++ b/src/com/sun/org/apache/xerces/internal/jaxp/DocumentBuilderImpl.java @@ -1,13 +1,13 @@ /* - * reserved comment block - * DO NOT REMOVE OR ALTER! + * Copyright (c) 2007, 2015, Oracle and/or its affiliates. All rights reserved. */ /* - * Copyright 2000-2005 The Apache Software Foundation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * @@ -20,15 +20,6 @@ package com.sun.org.apache.xerces.internal.jaxp; -import java.io.IOException; -import java.util.Hashtable; -import java.util.Iterator; -import java.util.Map; - -import javax.xml.parsers.DocumentBuilder; -import javax.xml.validation.Schema; -import javax.xml.XMLConstants; - import com.sun.org.apache.xerces.internal.dom.DOMImplementationImpl; import com.sun.org.apache.xerces.internal.dom.DOMMessageFormatter; import com.sun.org.apache.xerces.internal.impl.Constants; @@ -46,6 +37,11 @@ import com.sun.org.apache.xerces.internal.xni.parser.XMLComponentManager; import com.sun.org.apache.xerces.internal.xni.parser.XMLConfigurationException; import com.sun.org.apache.xerces.internal.xni.parser.XMLDocumentSource; import com.sun.org.apache.xerces.internal.xni.parser.XMLParserConfiguration; +import java.io.IOException; +import java.util.Map; +import javax.xml.XMLConstants; +import javax.xml.parsers.DocumentBuilder; +import javax.xml.validation.Schema; import org.w3c.dom.DOMImplementation; import org.w3c.dom.Document; import org.xml.sax.EntityResolver; @@ -127,12 +123,14 @@ public class DocumentBuilderImpl extends DocumentBuilder private XMLSecurityManager fSecurityManager; private XMLSecurityPropertyManager fSecurityPropertyMgr; - DocumentBuilderImpl(DocumentBuilderFactoryImpl dbf, Hashtable dbfAttrs, Hashtable features) + DocumentBuilderImpl(DocumentBuilderFactoryImpl dbf, Map<String, Object> dbfAttrs, + Map<String, Boolean> features) throws SAXNotRecognizedException, SAXNotSupportedException { this(dbf, dbfAttrs, features, false); } - DocumentBuilderImpl(DocumentBuilderFactoryImpl dbf, Hashtable dbfAttrs, Hashtable features, boolean secureProcessing) + DocumentBuilderImpl(DocumentBuilderFactoryImpl dbf, Map<String, Object> dbfAttrs, + Map<String, Boolean> features, boolean secureProcessing) throws SAXNotRecognizedException, SAXNotSupportedException { domParser = new DOMParser(); @@ -183,10 +181,9 @@ public class DocumentBuilderImpl extends DocumentBuilder * System Properties or jaxp.properties are set */ if (features != null) { - Object temp = features.get(XMLConstants.FEATURE_SECURE_PROCESSING); + Boolean temp = features.get(XMLConstants.FEATURE_SECURE_PROCESSING); if (temp != null) { - boolean value = ((Boolean) temp).booleanValue(); - if (value && Constants.IS_JDK8_OR_ABOVE) { + if (temp && Constants.IS_JDK8_OR_ABOVE) { fSecurityPropertyMgr.setValue(Property.ACCESS_EXTERNAL_DTD, State.FSP, Constants.EXTERNAL_ACCESS_DEFAULT_FSP); fSecurityPropertyMgr.setValue(Property.ACCESS_EXTERNAL_SCHEMA, @@ -241,15 +238,11 @@ public class DocumentBuilderImpl extends DocumentBuilder fInitEntityResolver = domParser.getEntityResolver(); } - private void setFeatures(Hashtable features) + private void setFeatures( Map<String, Boolean> features) throws SAXNotSupportedException, SAXNotRecognizedException { if (features != null) { - Iterator entries = features.entrySet().iterator(); - while (entries.hasNext()) { - Map.Entry entry = (Map.Entry) entries.next(); - String feature = (String) entry.getKey(); - boolean value = ((Boolean) entry.getValue()).booleanValue(); - domParser.setFeature(feature, value); + for (Map.Entry<String, Boolean> entry : features.entrySet()) { + domParser.setFeature(entry.getKey(), entry.getValue()); } } } @@ -261,7 +254,7 @@ public class DocumentBuilderImpl extends DocumentBuilder * attribute names and JAXP specific attribute names, * eg. DocumentBuilderFactory.setValidating() */ - private void setDocumentBuilderFactoryAttributes(Hashtable dbfAttrs) + private void setDocumentBuilderFactoryAttributes( Map<String, Object> dbfAttrs) throws SAXNotSupportedException, SAXNotRecognizedException { if (dbfAttrs == null) { @@ -269,14 +262,12 @@ public class DocumentBuilderImpl extends DocumentBuilder return; } - Iterator entries = dbfAttrs.entrySet().iterator(); - while (entries.hasNext()) { - Map.Entry entry = (Map.Entry) entries.next(); - String name = (String) entry.getKey(); + for (Map.Entry<String, Object> entry : dbfAttrs.entrySet()) { + String name = entry.getKey(); Object val = entry.getValue(); if (val instanceof Boolean) { // Assume feature - domParser.setFeature(name, ((Boolean)val).booleanValue()); + domParser.setFeature(name, (Boolean)val); } else { // Assume property if (JAXP_SCHEMA_LANGUAGE.equals(name)) { diff --git a/src/com/sun/org/apache/xerces/internal/jaxp/SAXParserFactoryImpl.java b/src/com/sun/org/apache/xerces/internal/jaxp/SAXParserFactoryImpl.java index ae9d995..5559310 100644 --- a/src/com/sun/org/apache/xerces/internal/jaxp/SAXParserFactoryImpl.java +++ b/src/com/sun/org/apache/xerces/internal/jaxp/SAXParserFactoryImpl.java @@ -1,13 +1,13 @@ /* - * reserved comment block - * DO NOT REMOVE OR ALTER! + * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. */ /* - * Copyright 2000-2002,2004,2005 The Apache Software Foundation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * @@ -20,21 +20,19 @@ package com.sun.org.apache.xerces.internal.jaxp; -import java.util.Hashtable; - +import com.sun.org.apache.xerces.internal.impl.Constants; +import com.sun.org.apache.xerces.internal.util.SAXMessageFormatter; +import java.util.HashMap; +import java.util.Map; import javax.xml.XMLConstants; import javax.xml.parsers.ParserConfigurationException; import javax.xml.parsers.SAXParser; import javax.xml.parsers.SAXParserFactory; import javax.xml.validation.Schema; - import org.xml.sax.SAXException; import org.xml.sax.SAXNotRecognizedException; import org.xml.sax.SAXNotSupportedException; -import com.sun.org.apache.xerces.internal.impl.Constants; -import com.sun.org.apache.xerces.internal.util.SAXMessageFormatter; - /** * This is the implementation specific class for the * <code>javax.xml.parsers.SAXParserFactory</code>. This is the platform @@ -59,7 +57,7 @@ public class SAXParserFactoryImpl extends SAXParserFactory { private static final String XINCLUDE_FEATURE = Constants.XERCES_FEATURE_PREFIX + Constants.XINCLUDE_FEATURE; - private Hashtable features; + private Map<String, Boolean> features; private Schema grammar; private boolean isXIncludeAware; @@ -188,7 +186,7 @@ public class SAXParserFactoryImpl extends SAXParserFactory { private void putInFeatures(String name, boolean value){ if (features == null) { - features = new Hashtable(); + features = new HashMap<>(); } features.put(name, value ? Boolean.TRUE : Boolean.FALSE); } @@ -198,8 +196,8 @@ public class SAXParserFactoryImpl extends SAXParserFactory { return false; } else { - Object value = features.get(name); - return (value == null) ? false : Boolean.valueOf(value.toString()).booleanValue(); + Boolean value = features.get(name); + return (value == null) ? false : value; } } diff --git a/src/com/sun/org/apache/xerces/internal/jaxp/SAXParserImpl.java b/src/com/sun/org/apache/xerces/internal/jaxp/SAXParserImpl.java index 6cc3e9a..19f82d5 100644 --- a/src/com/sun/org/apache/xerces/internal/jaxp/SAXParserImpl.java +++ b/src/com/sun/org/apache/xerces/internal/jaxp/SAXParserImpl.java @@ -1,13 +1,13 @@ /* - * reserved comment block - * DO NOT REMOVE OR ALTER! + * Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved. */ /* - * Copyright 2000-2005 The Apache Software Foundation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * @@ -39,7 +39,6 @@ import com.sun.org.apache.xerces.internal.xs.ElementPSVI; import com.sun.org.apache.xerces.internal.xs.PSVIProvider; import java.io.IOException; import java.util.HashMap; -import java.util.Hashtable; import java.util.Iterator; import java.util.Locale; import java.util.Map; @@ -116,18 +115,18 @@ public class SAXParserImpl extends javax.xml.parsers.SAXParser /** * Create a SAX parser with the associated features - * @param features Hashtable of SAX features, may be null + * @param features Map of SAX features, may be null */ - SAXParserImpl(SAXParserFactoryImpl spf, Hashtable features) + SAXParserImpl(SAXParserFactoryImpl spf, Map<String, Boolean> features) throws SAXException { this(spf, features, false); } /** * Create a SAX parser with the associated features - * @param features Hashtable of SAX features, may be null + * @param features Map of SAX features, may be null */ - SAXParserImpl(SAXParserFactoryImpl spf, Hashtable features, boolean secureProcessing) + SAXParserImpl(SAXParserFactoryImpl spf, Map<String, Boolean> features, boolean secureProcessing) throws SAXException { fSecurityManager = new XMLSecurityManager(secureProcessing); @@ -165,10 +164,9 @@ public class SAXParserImpl extends javax.xml.parsers.SAXParser */ if (features != null) { - Object temp = features.get(XMLConstants.FEATURE_SECURE_PROCESSING); + Boolean temp = features.get(XMLConstants.FEATURE_SECURE_PROCESSING); if (temp != null) { - boolean value = ((Boolean) temp).booleanValue(); - if (value && Constants.IS_JDK8_OR_ABOVE) { + if (temp && Constants.IS_JDK8_OR_ABOVE) { fSecurityPropertyMgr.setValue(XMLSecurityPropertyManager.Property.ACCESS_EXTERNAL_DTD, XMLSecurityPropertyManager.State.FSP, Constants.EXTERNAL_ACCESS_DEFAULT_FSP); fSecurityPropertyMgr.setValue(XMLSecurityPropertyManager.Property.ACCESS_EXTERNAL_SCHEMA, @@ -242,15 +240,11 @@ public class SAXParserImpl extends javax.xml.parsers.SAXParser * XXX Does not handle possible conflicts between SAX feature names and * JAXP specific feature names, eg. SAXParserFactory.isValidating() */ - private void setFeatures(Hashtable features) + private void setFeatures(Map<String, Boolean> features) throws SAXNotSupportedException, SAXNotRecognizedException { if (features != null) { - Iterator entries = features.entrySet().iterator(); - while (entries.hasNext()) { - Map.Entry entry = (Map.Entry) entries.next(); - String feature = (String) entry.getKey(); - boolean value = ((Boolean) entry.getValue()).booleanValue(); - xmlReader.setFeature0(feature, value); + for (Map.Entry<String, Boolean> entry : features.entrySet()) { + xmlReader.setFeature0(entry.getKey(), entry.getValue()); } } } diff --git a/src/com/sun/org/apache/xerces/internal/parsers/XMLGrammarPreparser.java b/src/com/sun/org/apache/xerces/internal/parsers/XMLGrammarPreparser.java index 6690922..9fd66e5 100644 --- a/src/com/sun/org/apache/xerces/internal/parsers/XMLGrammarPreparser.java +++ b/src/com/sun/org/apache/xerces/internal/parsers/XMLGrammarPreparser.java @@ -1,13 +1,13 @@ /* - * reserved comment block - * DO NOT REMOVE OR ALTER! + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. */ /* - * Copyright 2001, 2002,2004 The Apache Software Foundation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * @@ -20,15 +20,11 @@ package com.sun.org.apache.xerces.internal.parsers; -import java.io.IOException; -import java.util.Enumeration; -import java.util.Hashtable; -import java.util.Locale; - import com.sun.org.apache.xerces.internal.impl.Constants; import com.sun.org.apache.xerces.internal.impl.XMLEntityManager; import com.sun.org.apache.xerces.internal.impl.XMLErrorReporter; import com.sun.org.apache.xerces.internal.util.SymbolTable; +import com.sun.org.apache.xerces.internal.utils.ObjectFactory; import com.sun.org.apache.xerces.internal.xni.XNIException; import com.sun.org.apache.xerces.internal.xni.grammars.Grammar; import com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarDescription; @@ -37,7 +33,11 @@ import com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarPool; import com.sun.org.apache.xerces.internal.xni.parser.XMLEntityResolver; import com.sun.org.apache.xerces.internal.xni.parser.XMLErrorHandler; import com.sun.org.apache.xerces.internal.xni.parser.XMLInputSource; -import com.sun.org.apache.xerces.internal.utils.ObjectFactory; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.Locale; +import java.util.Map; /** * <p> This class provides an easy way for a user to preparse grammars @@ -82,13 +82,15 @@ public class XMLGrammarPreparser { Constants.XERCES_PROPERTY_PREFIX + Constants.XMLGRAMMAR_POOL_PROPERTY; // the "built-in" grammar loaders - private static final Hashtable KNOWN_LOADERS = new Hashtable(); + private static final Map<String, String> KNOWN_LOADERS; static { - KNOWN_LOADERS.put(XMLGrammarDescription.XML_SCHEMA, + Map<String, String> loaders = new HashMap<>(); + loaders.put(XMLGrammarDescription.XML_SCHEMA, "com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaLoader"); - KNOWN_LOADERS.put(XMLGrammarDescription.XML_DTD, + loaders.put(XMLGrammarDescription.XML_DTD, "com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDLoader"); + KNOWN_LOADERS = Collections.unmodifiableMap(loaders); } /** Recognized properties. */ @@ -108,8 +110,8 @@ public class XMLGrammarPreparser { protected Locale fLocale; - // Hashtable holding our loaders - private Hashtable fLoaders; + // Map holding our loaders + private Map<String, XMLGrammarLoader> fLoaders; // // Constructors @@ -128,7 +130,7 @@ public class XMLGrammarPreparser { public XMLGrammarPreparser (SymbolTable symbolTable) { fSymbolTable = symbolTable; - fLoaders = new Hashtable(); + fLoaders = new HashMap<>(); fErrorReporter = new XMLErrorReporter(); setLocale(Locale.getDefault()); fEntityResolver = new XMLEntityManager(); @@ -189,7 +191,7 @@ public class XMLGrammarPreparser { public Grammar preparseGrammar(String type, XMLInputSource is) throws XNIException, IOException { if(fLoaders.containsKey(type)) { - XMLGrammarLoader gl = (XMLGrammarLoader)fLoaders.get(type); + XMLGrammarLoader gl = fLoaders.get(type); // make sure gl's been set up with all the "basic" properties: gl.setProperty(SYMBOL_TABLE, fSymbolTable); gl.setProperty(ENTITY_RESOLVER, fEntityResolver); @@ -271,7 +273,7 @@ public class XMLGrammarPreparser { // it's possible the application may want access to a certain loader to do // some custom work. public XMLGrammarLoader getLoader(String type) { - return (XMLGrammarLoader)fLoaders.get(type); + return fLoaders.get(type); } // getLoader(String): XMLGrammarLoader // set a feature. This method tries to set it on all @@ -280,10 +282,9 @@ public class XMLGrammarPreparser { // by a grammar loader of a particular type, it will have // to retrieve that loader and use the loader's setFeature method. public void setFeature(String featureId, boolean value) { - Enumeration loaders = fLoaders.elements(); - while(loaders.hasMoreElements()){ - XMLGrammarLoader gl = (XMLGrammarLoader)loaders.nextElement(); + for (Map.Entry<String, XMLGrammarLoader> entry : fLoaders.entrySet()) { try { + XMLGrammarLoader gl = entry.getValue(); gl.setFeature(featureId, value); } catch(Exception e) { // eat it up... @@ -304,10 +305,9 @@ public class XMLGrammarPreparser { // <p> <strong>An application should use the explicit method // in this class to set "standard" properties like error handler etc.</strong> public void setProperty(String propId, Object value) { - Enumeration loaders = fLoaders.elements(); - while(loaders.hasMoreElements()){ - XMLGrammarLoader gl = (XMLGrammarLoader)loaders.nextElement(); + for (Map.Entry<String, XMLGrammarLoader> entry : fLoaders.entrySet()) { try { + XMLGrammarLoader gl = entry.getValue(); gl.setProperty(propId, value); } catch(Exception e) { // eat it up... @@ -322,7 +322,7 @@ public class XMLGrammarPreparser { // @param featureId the feature string to query. // @return the value of the feature. public boolean getFeature(String type, String featureId) { - XMLGrammarLoader gl = (XMLGrammarLoader)fLoaders.get(type); + XMLGrammarLoader gl = fLoaders.get(type); return gl.getFeature(featureId); } // getFeature (String, String): boolean @@ -335,7 +335,7 @@ public class XMLGrammarPreparser { // @param propertyId the property string to query. // @return the value of the property. public Object getProperty(String type, String propertyId) { - XMLGrammarLoader gl = (XMLGrammarLoader)fLoaders.get(type); + XMLGrammarLoader gl = fLoaders.get(type); return gl.getProperty(propertyId); } // getProperty(String, String): Object } // class XMLGrammarPreparser diff --git a/src/com/sun/org/apache/xerces/internal/util/AugmentationsImpl.java b/src/com/sun/org/apache/xerces/internal/util/AugmentationsImpl.java index cb42c94..425a415 100644 --- a/src/com/sun/org/apache/xerces/internal/util/AugmentationsImpl.java +++ b/src/com/sun/org/apache/xerces/internal/util/AugmentationsImpl.java @@ -1,13 +1,13 @@ /* - * reserved comment block - * DO NOT REMOVE OR ALTER! + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. */ /* - * Copyright 2000-2002,2004 The Apache Software Foundation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * @@ -20,14 +20,15 @@ package com.sun.org.apache.xerces.internal.util; -import java.util.Hashtable; -import java.util.Enumeration; - import com.sun.org.apache.xerces.internal.xni.Augmentations; +import java.util.Collections; +import java.util.Enumeration; +import java.util.HashMap; +import java.util.Map; /** * This class provides an implementation for Augmentations interface. - * Augmentations interface defines a hashtable of additional data that could + * Augmentations interface defines a map of additional data that could * be passed along the document pipeline. The information can contain extra * arguments or infoset augmentations, for example PSVI. This additional * information is identified by a String key. @@ -194,18 +195,18 @@ public class AugmentationsImpl implements Augmentations{ } public String toString() { - StringBuffer buff = new StringBuffer(); - buff.append("SmallContainer - fNumEntries == " + fNumEntries); + StringBuilder buff = new StringBuilder(); + buff.append("SmallContainer - fNumEntries == ").append(fNumEntries); for (int i = 0; i < SIZE_LIMIT*2; i=i+2) { - buff.append("\nfAugmentations["); - buff.append(i); - buff.append("] == "); - buff.append(fAugmentations[i]); - buff.append("; fAugmentations["); - buff.append(i+1); - buff.append("] == "); - buff.append(fAugmentations[i+1]); + buff.append("\nfAugmentations[") + .append(i) + .append("] == ") + .append(fAugmentations[i]) + .append("; fAugmentations[") + .append(i+1) + .append("] == ") + .append(fAugmentations[i+1]); } return buff.toString(); @@ -240,7 +241,7 @@ public class AugmentationsImpl implements Augmentations{ } class LargeContainer extends AugmentationsItemsContainer { - final Hashtable fAugmentations = new Hashtable(); + final Map<Object, Object> fAugmentations = new HashMap<>(); public Object getItem(Object key) { return fAugmentations.get(key); @@ -255,7 +256,7 @@ public class AugmentationsImpl implements Augmentations{ } public Enumeration keys() { - return fAugmentations.keys(); + return Collections.enumeration(fAugmentations.keySet()); } public void clear() { @@ -271,18 +272,14 @@ public class AugmentationsImpl implements Augmentations{ } public String toString() { - StringBuffer buff = new StringBuffer(); + StringBuilder buff = new StringBuilder(); buff.append("LargeContainer"); - Enumeration keys = fAugmentations.keys(); - - while (keys.hasMoreElements()) { - Object key = keys.nextElement(); + for(Object key : fAugmentations.keySet()) { buff.append("\nkey == "); buff.append(key); buff.append("; value == "); buff.append(fAugmentations.get(key)); } - return buff.toString(); } } diff --git a/src/com/sun/org/apache/xerces/internal/util/DOMErrorHandlerWrapper.java b/src/com/sun/org/apache/xerces/internal/util/DOMErrorHandlerWrapper.java index d9b9d0b..83c59c3 100644 --- a/src/com/sun/org/apache/xerces/internal/util/DOMErrorHandlerWrapper.java +++ b/src/com/sun/org/apache/xerces/internal/util/DOMErrorHandlerWrapper.java @@ -1,13 +1,13 @@ /* - * reserved comment block - * DO NOT REMOVE OR ALTER! + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. */ /* - * Copyright 2001, 2002, 2004 The Apache Software Foundation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * @@ -20,20 +20,20 @@ package com.sun.org.apache.xerces.internal.util; +import com.sun.org.apache.xerces.internal.dom.DOMErrorImpl; +import com.sun.org.apache.xerces.internal.dom.DOMLocatorImpl; +import com.sun.org.apache.xerces.internal.impl.msg.XMLMessageFormatter; import com.sun.org.apache.xerces.internal.xni.XNIException; import com.sun.org.apache.xerces.internal.xni.parser.XMLErrorHandler; import com.sun.org.apache.xerces.internal.xni.parser.XMLParseException; - -import org.w3c.dom.Node; +import java.io.PrintWriter; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; import org.w3c.dom.DOMError; -import org.w3c.dom.DOMLocator; import org.w3c.dom.DOMErrorHandler; -import com.sun.org.apache.xerces.internal.dom.DOMErrorImpl; -import com.sun.org.apache.xerces.internal.dom.DOMLocatorImpl; -import com.sun.org.apache.xerces.internal.impl.msg.XMLMessageFormatter; - -import java.io.PrintWriter; -import java.util.Hashtable; +import org.w3c.dom.DOMLocator; +import org.w3c.dom.Node; /** * This class handles DOM errors . @@ -287,131 +287,133 @@ public class DOMErrorHandlerWrapper private static class DOMErrorTypeMap { /** Map for converting internal error codes to DOM error types. **/ - private static Hashtable fgDOMErrorTypeTable; + private static final Map<XMLErrorCode, String> fgDOMErrorTypeTable; static { // initialize error type table: internal error codes (represented by domain and key) need to be mapped to a DOM error type. // 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. - fgDOMErrorTypeTable = new Hashtable(); - fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "InvalidCharInCDSect"), "wf-invalid-character"); - fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "InvalidCharInContent"), "wf-invalid-character"); - fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "TwoColonsInQName"), "wf-invalid-character-in-node-name"); - fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "ColonNotLegalWithNS"), "wf-invalid-character-in-node-name"); - fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "InvalidCharInProlog"), "wf-invalid-character"); // e.g. in Processing Instruction + Map<XMLErrorCode, String> aDOMErrorTypeTable = new HashMap<>(); + aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "InvalidCharInCDSect"), "wf-invalid-character"); + aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "InvalidCharInContent"), "wf-invalid-character"); + aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "TwoColonsInQName"), "wf-invalid-character-in-node-name"); + aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "ColonNotLegalWithNS"), "wf-invalid-character-in-node-name"); + aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "InvalidCharInProlog"), "wf-invalid-character"); // e.g. in Processing Instruction // InvalidCharInXMLDecl omitted because XML declaration is not a DOM Node - fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "CDEndInContent"), "wf-invalid-character"); - fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "CDSectUnterminated"), "wf-invalid-character"); - fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "DoctypeNotAllowed"), "doctype-not-allowed"); - fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "ETagRequired"), "wf-invalid-character-in-node-name"); - fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "ElementUnterminated"), "wf-invalid-character-in-node-name"); - fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "EqRequiredInAttribute"), "wf-invalid-character"); - fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "OpenQuoteExpected"), "wf-invalid-character"); - fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "CloseQuoteExpected"), "wf-invalid-character"); - fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "ETagUnterminated"), "wf-invalid-character-in-node-name"); - fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "MarkupNotRecognizedInContent"), "wf-invalid-character"); - fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "DoctypeIllegalInContent"), "doctype-not-allowed"); - fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "InvalidCharInAttValue"), "wf-invalid-character"); - fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "InvalidCharInPI"), "wf-invalid-character"); - fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "InvalidCharInInternalSubset"), "wf-invalid-character"); - fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "QuoteRequiredInAttValue"), "wf-invalid-character"); - fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "LessthanInAttValue"), "wf-invalid-character"); - fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "AttributeValueUnterminated"), "wf-invalid-character"); - fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "PITargetRequired"), "wf-invalid-character"); - fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "SpaceRequiredInPI"), "wf-invalid-character"); - fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "PIUnterminated"), "wf-invalid-character"); - fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "ReservedPITarget"), "wf-invalid-character"); - fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "PI_NOT_IN_ONE_ENTITY"), "wf-invalid-character"); - fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "PINotInOneEntity"), "wf-invalid-character"); - fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "EncodingDeclInvalid"), "unsupported-encoding"); - fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "EncodingByteOrderUnsupported"), "unsupported-encoding"); - fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "InvalidCharInEntityValue"), "wf-invalid-character-in-node-name"); - fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "InvalidCharInExternalSubset"), "wf-invalid-character"); - fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "InvalidCharInIgnoreSect"), "wf-invalid-character"); - fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "InvalidCharInPublicID"), "wf-invalid-character"); - fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "InvalidCharInSystemID"), "wf-invalid-character"); - fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "SpaceRequiredAfterSYSTEM"), "wf-invalid-character"); - fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "QuoteRequiredInSystemID"), "wf-invalid-character"); - fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "SystemIDUnterminated"), "wf-invalid-character"); - fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "SpaceRequiredAfterPUBLIC"), "wf-invalid-character"); - fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "QuoteRequiredInPublicID"), "wf-invalid-character"); - fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "PublicIDUnterminated"), "wf-invalid-character"); - fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "PubidCharIllegal"), "wf-invalid-character"); - fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "SpaceRequiredBetweenPublicAndSystem"), "wf-invalid-character"); - 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) - fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "MSG_ROOT_ELEMENT_TYPE_REQUIRED"), "wf-invalid-character-in-node-name"); - fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "DoctypedeclUnterminated"), "wf-invalid-character-in-node-name"); - fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "PEReferenceWithinMarkup"), "wf-invalid-character"); - fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "MSG_MARKUP_NOT_RECOGNIZED_IN_DTD"), "wf-invalid-character"); - fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "MSG_SPACE_REQUIRED_BEFORE_ELEMENT_TYPE_IN_ELEMENTDECL"), "wf-invalid-character"); - fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "MSG_ELEMENT_TYPE_REQUIRED_IN_ELEMENTDECL"), "wf-invalid-character"); - fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "MSG_SPACE_REQUIRED_BEFORE_CONTENTSPEC_IN_ELEMENTDECL"), "wf-invalid-character"); - fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "MSG_CONTENTSPEC_REQUIRED_IN_ELEMENTDECL"), "wf-invalid-character"); - fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "ElementDeclUnterminated"), "wf-invalid-character"); - fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "MSG_OPEN_PAREN_OR_ELEMENT_TYPE_REQUIRED_IN_CHILDREN"), "wf-invalid-character"); - fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "MSG_CLOSE_PAREN_REQUIRED_IN_CHILDREN"), "wf-invalid-character"); - fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "MSG_ELEMENT_TYPE_REQUIRED_IN_MIXED_CONTENT"), "wf-invalid-character"); - fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "MSG_CLOSE_PAREN_REQUIRED_IN_MIXED"), "wf-invalid-character"); - fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "MixedContentUnterminated"), "wf-invalid-character"); - fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "MSG_SPACE_REQUIRED_BEFORE_ELEMENT_TYPE_IN_ATTLISTDECL"), "wf-invalid-character"); - fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "MSG_ELEMENT_TYPE_REQUIRED_IN_ATTLISTDECL"), "wf-invalid-character"); - fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "MSG_SPACE_REQUIRED_BEFORE_ATTRIBUTE_NAME_IN_ATTDEF"), "wf-invalid-character"); - fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "AttNameRequiredInAttDef"), "wf-invalid-character"); - fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "MSG_SPACE_REQUIRED_BEFORE_ATTTYPE_IN_ATTDEF"), "wf-invalid-character"); - fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "AttTypeRequiredInAttDef"), "wf-invalid-character"); - fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "MSG_SPACE_REQUIRED_BEFORE_DEFAULTDECL_IN_ATTDEF"), "wf-invalid-character"); - fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "MSG_DUPLICATE_ATTRIBUTE_DEFINITION"), "wf-invalid-character"); - fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "MSG_SPACE_REQUIRED_AFTER_NOTATION_IN_NOTATIONTYPE"), "wf-invalid-character"); - fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "MSG_OPEN_PAREN_REQUIRED_IN_NOTATIONTYPE"), "wf-invalid-character"); - fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "MSG_NAME_REQUIRED_IN_NOTATIONTYPE"), "wf-invalid-character"); - fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "NotationTypeUnterminated"), "wf-invalid-character"); - fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "MSG_NMTOKEN_REQUIRED_IN_ENUMERATION"), "wf-invalid-character"); - fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "EnumerationUnterminated"), "wf-invalid-character"); - fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "MSG_DISTINCT_TOKENS_IN_ENUMERATION"), "wf-invalid-character"); - fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "MSG_DISTINCT_NOTATION_IN_ENUMERATION"), "wf-invalid-character"); - fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "MSG_SPACE_REQUIRED_AFTER_FIXED_IN_DEFAULTDECL"), "wf-invalid-character"); - fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "IncludeSectUnterminated"), "wf-invalid-character"); - fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "IgnoreSectUnterminated"), "wf-invalid-character"); - fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "NameRequiredInPEReference"), "wf-invalid-character"); - fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "SemicolonRequiredInPEReference"), "wf-invalid-character"); - 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) - 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 %) - 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 %) - 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) - 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 - fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "MSG_SPACE_REQUIRED_BEFORE_NOTATION_NAME_IN_UNPARSED_ENTITYDECL"), "wf-invalid-character"); - fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "MSG_SPACE_REQUIRED_BEFORE_NDATA_IN_UNPARSED_ENTITYDECL"), "wf-invalid-character"); - fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "MSG_NOTATION_NAME_REQUIRED_FOR_UNPARSED_ENTITYDECL"), "wf-invalid-character"); - fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "EntityDeclUnterminated"), "wf-invalid-character-in-node-name"); - fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "MSG_DUPLICATE_ENTITY_DEFINITION"), "wf-invalid-character-in-node-name"); - fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "ExternalIDRequired"), "wf-invalid-character"); - fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "MSG_SPACE_REQUIRED_BEFORE_PUBIDLITERAL_IN_EXTERNALID"), "wf-invalid-character"); - fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "MSG_SPACE_REQUIRED_AFTER_PUBIDLITERAL_IN_EXTERNALID"), "wf-invalid-character"); - fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "MSG_SPACE_REQUIRED_BEFORE_SYSTEMLITERAL_IN_EXTERNALID"), "wf-invalid-character"); - fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "MSG_URI_FRAGMENT_IN_SYSTEMID"), "wf-invalid-character"); - 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 - 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 - 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 - fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "ExternalIDorPublicIDRequired"), "wf-invalid-character"); - fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "NotationDeclUnterminated"), "wf-invalid-character-in-node-name"); - fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "ReferenceToExternalEntity"), "wf-invalid-character"); - fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "ReferenceToUnparsedEntity"), "wf-invalid-character"); + aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "CDEndInContent"), "wf-invalid-character"); + aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "CDSectUnterminated"), "wf-invalid-character"); + aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "DoctypeNotAllowed"), "doctype-not-allowed"); + aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "ETagRequired"), "wf-invalid-character-in-node-name"); + aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "ElementUnterminated"), "wf-invalid-character-in-node-name"); + aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "EqRequiredInAttribute"), "wf-invalid-character"); + aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "OpenQuoteExpected"), "wf-invalid-character"); + aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "CloseQuoteExpected"), "wf-invalid-character"); + aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "ETagUnterminated"), "wf-invalid-character-in-node-name"); + aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "MarkupNotRecognizedInContent"), "wf-invalid-character"); + aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "DoctypeIllegalInContent"), "doctype-not-allowed"); + aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "InvalidCharInAttValue"), "wf-invalid-character"); + aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "InvalidCharInPI"), "wf-invalid-character"); + aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "InvalidCharInInternalSubset"), "wf-invalid-character"); + aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "QuoteRequiredInAttValue"), "wf-invalid-character"); + aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "LessthanInAttValue"), "wf-invalid-character"); + aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "AttributeValueUnterminated"), "wf-invalid-character"); + aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "PITargetRequired"), "wf-invalid-character"); + aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "SpaceRequiredInPI"), "wf-invalid-character"); + aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "PIUnterminated"), "wf-invalid-character"); + aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "ReservedPITarget"), "wf-invalid-character"); + aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "PI_NOT_IN_ONE_ENTITY"), "wf-invalid-character"); + aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "PINotInOneEntity"), "wf-invalid-character"); + aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "EncodingDeclInvalid"), "unsupported-encoding"); + aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "EncodingByteOrderUnsupported"), "unsupported-encoding"); + aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "InvalidCharInEntityValue"), "wf-invalid-character-in-node-name"); + aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "InvalidCharInExternalSubset"), "wf-invalid-character"); + aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "InvalidCharInIgnoreSect"), "wf-invalid-character"); + aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "InvalidCharInPublicID"), "wf-invalid-character"); + aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "InvalidCharInSystemID"), "wf-invalid-character"); + aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "SpaceRequiredAfterSYSTEM"), "wf-invalid-character"); + aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "QuoteRequiredInSystemID"), "wf-invalid-character"); + aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "SystemIDUnterminated"), "wf-invalid-character"); + aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "SpaceRequiredAfterPUBLIC"), "wf-invalid-character"); + aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "QuoteRequiredInPublicID"), "wf-invalid-character"); + aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "PublicIDUnterminated"), "wf-invalid-character"); + aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "PubidCharIllegal"), "wf-invalid-character"); + aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "SpaceRequiredBetweenPublicAndSystem"), "wf-invalid-character"); + aDOMErrorTypeTable.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) + aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "MSG_ROOT_ELEMENT_TYPE_REQUIRED"), "wf-invalid-character-in-node-name"); + aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "DoctypedeclUnterminated"), "wf-invalid-character-in-node-name"); + aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "PEReferenceWithinMarkup"), "wf-invalid-character"); + aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "MSG_MARKUP_NOT_RECOGNIZED_IN_DTD"), "wf-invalid-character"); + aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "MSG_SPACE_REQUIRED_BEFORE_ELEMENT_TYPE_IN_ELEMENTDECL"), "wf-invalid-character"); + aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "MSG_ELEMENT_TYPE_REQUIRED_IN_ELEMENTDECL"), "wf-invalid-character"); + aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "MSG_SPACE_REQUIRED_BEFORE_CONTENTSPEC_IN_ELEMENTDECL"), "wf-invalid-character"); + aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "MSG_CONTENTSPEC_REQUIRED_IN_ELEMENTDECL"), "wf-invalid-character"); + aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "ElementDeclUnterminated"), "wf-invalid-character"); + aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "MSG_OPEN_PAREN_OR_ELEMENT_TYPE_REQUIRED_IN_CHILDREN"), "wf-invalid-character"); + aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "MSG_CLOSE_PAREN_REQUIRED_IN_CHILDREN"), "wf-invalid-character"); + aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "MSG_ELEMENT_TYPE_REQUIRED_IN_MIXED_CONTENT"), "wf-invalid-character"); + aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "MSG_CLOSE_PAREN_REQUIRED_IN_MIXED"), "wf-invalid-character"); + aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "MixedContentUnterminated"), "wf-invalid-character"); + aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "MSG_SPACE_REQUIRED_BEFORE_ELEMENT_TYPE_IN_ATTLISTDECL"), "wf-invalid-character"); + aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "MSG_ELEMENT_TYPE_REQUIRED_IN_ATTLISTDECL"), "wf-invalid-character"); + aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "MSG_SPACE_REQUIRED_BEFORE_ATTRIBUTE_NAME_IN_ATTDEF"), "wf-invalid-character"); + aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "AttNameRequiredInAttDef"), "wf-invalid-character"); + aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "MSG_SPACE_REQUIRED_BEFORE_ATTTYPE_IN_ATTDEF"), "wf-invalid-character"); + aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "AttTypeRequiredInAttDef"), "wf-invalid-character"); + aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "MSG_SPACE_REQUIRED_BEFORE_DEFAULTDECL_IN_ATTDEF"), "wf-invalid-character"); + aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "MSG_DUPLICATE_ATTRIBUTE_DEFINITION"), "wf-invalid-character"); + aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "MSG_SPACE_REQUIRED_AFTER_NOTATION_IN_NOTATIONTYPE"), "wf-invalid-character"); + aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "MSG_OPEN_PAREN_REQUIRED_IN_NOTATIONTYPE"), "wf-invalid-character"); + aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "MSG_NAME_REQUIRED_IN_NOTATIONTYPE"), "wf-invalid-character"); + aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "NotationTypeUnterminated"), "wf-invalid-character"); + aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "MSG_NMTOKEN_REQUIRED_IN_ENUMERATION"), "wf-invalid-character"); + aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "EnumerationUnterminated"), "wf-invalid-character"); + aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "MSG_DISTINCT_TOKENS_IN_ENUMERATION"), "wf-invalid-character"); + aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "MSG_DISTINCT_NOTATION_IN_ENUMERATION"), "wf-invalid-character"); + aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "MSG_SPACE_REQUIRED_AFTER_FIXED_IN_DEFAULTDECL"), "wf-invalid-character"); + aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "IncludeSectUnterminated"), "wf-invalid-character"); + aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "IgnoreSectUnterminated"), "wf-invalid-character"); + aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "NameRequiredInPEReference"), "wf-invalid-character"); + aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "SemicolonRequiredInPEReference"), "wf-invalid-character"); + aDOMErrorTypeTable.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) + aDOMErrorTypeTable.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 %) + aDOMErrorTypeTable.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 %) + aDOMErrorTypeTable.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) + aDOMErrorTypeTable.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 + aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "MSG_SPACE_REQUIRED_BEFORE_NOTATION_NAME_IN_UNPARSED_ENTITYDECL"), "wf-invalid-character"); + aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "MSG_SPACE_REQUIRED_BEFORE_NDATA_IN_UNPARSED_ENTITYDECL"), "wf-invalid-character"); + aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "MSG_NOTATION_NAME_REQUIRED_FOR_UNPARSED_ENTITYDECL"), "wf-invalid-character"); + aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "EntityDeclUnterminated"), "wf-invalid-character-in-node-name"); + aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "MSG_DUPLICATE_ENTITY_DEFINITION"), "wf-invalid-character-in-node-name"); + aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "ExternalIDRequired"), "wf-invalid-character"); + aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "MSG_SPACE_REQUIRED_BEFORE_PUBIDLITERAL_IN_EXTERNALID"), "wf-invalid-character"); + aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "MSG_SPACE_REQUIRED_AFTER_PUBIDLITERAL_IN_EXTERNALID"), "wf-invalid-character"); + aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "MSG_SPACE_REQUIRED_BEFORE_SYSTEMLITERAL_IN_EXTERNALID"), "wf-invalid-character"); + aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "MSG_URI_FRAGMENT_IN_SYSTEMID"), "wf-invalid-character"); + aDOMErrorTypeTable.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 + aDOMErrorTypeTable.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 + aDOMErrorTypeTable.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 + aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "ExternalIDorPublicIDRequired"), "wf-invalid-character"); + aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "NotationDeclUnterminated"), "wf-invalid-character-in-node-name"); + aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "ReferenceToExternalEntity"), "wf-invalid-character"); + aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "ReferenceToUnparsedEntity"), "wf-invalid-character"); // REVISIT: do EntityNotDeclared, RecursiveReference, RecursiveGeneralReference, RecursivePEReference belong here? - fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "EncodingNotSupported"), "unsupported-encoding"); - fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "EncodingRequired"), "unsupported-encoding"); - fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "IllegalQName"), "wf-invalid-character-in-node-name"); - fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "ElementXMLNSPrefix"), "wf-invalid-character-in-node-name"); - fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "ElementPrefixUnbound"), "wf-invalid-character-in-node-name"); - fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "AttributePrefixUnbound"), "wf-invalid-character-in-node-name"); - fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "EmptyPrefixedAttName"), "wf-invalid-character-in-node-name"); - fgDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "PrefixDeclared"), "wf-invalid-character-in-node-name"); + aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "EncodingNotSupported"), "unsupported-encoding"); + aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "EncodingRequired"), "unsupported-encoding"); + aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "IllegalQName"), "wf-invalid-character-in-node-name"); + aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "ElementXMLNSPrefix"), "wf-invalid-character-in-node-name"); + aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "ElementPrefixUnbound"), "wf-invalid-character-in-node-name"); + aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "AttributePrefixUnbound"), "wf-invalid-character-in-node-name"); + aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "EmptyPrefixedAttName"), "wf-invalid-character-in-node-name"); + aDOMErrorTypeTable.put(new XMLErrorCode(XMLMessageFormatter.XML_DOMAIN, "PrefixDeclared"), "wf-invalid-character-in-node-name"); + + fgDOMErrorTypeTable = Collections.unmodifiableMap(aDOMErrorTypeTable); } public static String getDOMErrorType (XMLErrorCode error) { - return (String) fgDOMErrorTypeTable.get(error); + return fgDOMErrorTypeTable.get(error); } private DOMErrorTypeMap () {} diff --git a/src/com/sun/org/apache/xerces/internal/util/DOMUtil.java b/src/com/sun/org/apache/xerces/internal/util/DOMUtil.java index da13e8f..5e0bc24 100644 --- a/src/com/sun/org/apache/xerces/internal/util/DOMUtil.java +++ b/src/com/sun/org/apache/xerces/internal/util/DOMUtil.java @@ -1,13 +1,13 @@ /* - * reserved comment block - * DO NOT REMOVE OR ALTER! + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. */ /* - * Copyright 1999-2002,2004,2005 The Apache Software Foundation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * @@ -20,11 +20,10 @@ package com.sun.org.apache.xerces.internal.util; -import java.util.Hashtable; - import com.sun.org.apache.xerces.internal.dom.AttrImpl; import com.sun.org.apache.xerces.internal.dom.DocumentImpl; import com.sun.org.apache.xerces.internal.impl.xs.opti.ElementImpl; +import java.util.Map; import org.w3c.dom.Attr; import org.w3c.dom.DOMException; import org.w3c.dom.Document; @@ -184,7 +183,7 @@ public class DOMUtil { } // getFirstChildElement(Node):Element /** Finds and returns the first visible child element node. */ - public static Element getFirstVisibleChildElement(Node parent, Hashtable hiddenNodes) { + public static Element getFirstVisibleChildElement(Node parent, Map<Node, String> hiddenNodes) { // search for node Node child = parent.getFirstChild(); @@ -241,7 +240,7 @@ public class DOMUtil { /** Finds and returns the last visible child element node. * Overload previous method for non-Xerces node impl */ - public static Element getLastVisibleChildElement(Node parent, Hashtable hiddenNodes) { + public static Element getLastVisibleChildElement(Node parent, Map<Node, String> hiddenNodes) { // search for node Node child = parent.getLastChild(); @@ -293,7 +292,7 @@ public class DOMUtil { } // getNextSiblingdElement(Node):Element // get next visible (un-hidden) node, overload previous method for non Xerces node impl - public static Element getNextVisibleSiblingElement(Node node, Hashtable hiddenNodes) { + public static Element getNextVisibleSiblingElement(Node node, Map<Node, String> hiddenNodes) { // search for node Node sibling = node.getNextSibling(); @@ -319,7 +318,7 @@ public class DOMUtil { } // setHidden(node):void // set this Node as being hidden, overloaded method - public static void setHidden(Node node, Hashtable hiddenNodes) { + public static void setHidden(Node node, Map<Node, String> hiddenNodes) { if (node instanceof com.sun.org.apache.xerces.internal.impl.xs.opti.NodeImpl) { ((com.sun.org.apache.xerces.internal.impl.xs.opti.NodeImpl)node).setReadOnly(true, false); } @@ -337,7 +336,7 @@ public class DOMUtil { } // setVisible(node):void // set this Node as being visible, overloaded method - public static void setVisible(Node node, Hashtable hiddenNodes) { + public static void setVisible(Node node, Map<Node, String> hiddenNodes) { if (node instanceof com.sun.org.apache.xerces.internal.impl.xs.opti.NodeImpl) { ((com.sun.org.apache.xerces.internal.impl.xs.opti.NodeImpl)node).setReadOnly(false, false); } @@ -356,7 +355,7 @@ public class DOMUtil { } // isHidden(Node):boolean // is this node hidden? overloaded method - public static boolean isHidden(Node node, Hashtable hiddenNodes) { + public static boolean isHidden(Node node, Map<Node, String> hiddenNodes) { if (node instanceof com.sun.org.apache.xerces.internal.impl.xs.opti.NodeImpl) { return ((com.sun.org.apache.xerces.internal.impl.xs.opti.NodeImpl)node).getReadOnly(); } diff --git a/src/com/sun/org/apache/xerces/internal/util/EncodingMap.java b/src/com/sun/org/apache/xerces/internal/util/EncodingMap.java index c4fe27e..ef34410 100644 --- a/src/com/sun/org/apache/xerces/internal/util/EncodingMap.java +++ b/src/com/sun/org/apache/xerces/internal/util/EncodingMap.java @@ -1,15 +1,15 @@ /* - * reserved comment block - * DO NOT REMOVE OR ALTER! + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. */ /* - * Copyright 1999-2002,2004 The Apache Software Foundation. + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -20,7 +20,9 @@ package com.sun.org.apache.xerces.internal.util; -import java.util.Hashtable; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; /** * EncodingMap is a convenience class which handles conversions between @@ -477,469 +479,473 @@ public class EncodingMap { // /** fIANA2JavaMap */ - protected final static Hashtable fIANA2JavaMap = new Hashtable(); + protected final static Map<String, String> fIANA2JavaMap; /** fJava2IANAMap */ - protected final static Hashtable fJava2IANAMap = new Hashtable(); + protected final static Map<String, String> fJava2IANAMap; // // Static initialization // static { + Map<String, String> aIANA2JavaMap = new HashMap<>(); + Map<String, String> aJava2IANAMap = new HashMap<>(); // add IANA to Java encoding mappings. - fIANA2JavaMap.put("BIG5", "Big5"); - fIANA2JavaMap.put("CSBIG5", "Big5"); - fIANA2JavaMap.put("CP037", "CP037"); - fIANA2JavaMap.put("IBM037", "CP037"); - fIANA2JavaMap.put("CSIBM037", "CP037"); - fIANA2JavaMap.put("EBCDIC-CP-US", "CP037"); - fIANA2JavaMap.put("EBCDIC-CP-CA", "CP037"); - fIANA2JavaMap.put("EBCDIC-CP-NL", "CP037"); - fIANA2JavaMap.put("EBCDIC-CP-WT", "CP037"); - fIANA2JavaMap.put("IBM273", "CP273"); - fIANA2JavaMap.put("CP273", "CP273"); - fIANA2JavaMap.put("CSIBM273", "CP273"); - fIANA2JavaMap.put("IBM277", "CP277"); - fIANA2JavaMap.put("CP277", "CP277"); - fIANA2JavaMap.put("CSIBM277", "CP277"); - fIANA2JavaMap.put("EBCDIC-CP-DK", "CP277"); - fIANA2JavaMap.put("EBCDIC-CP-NO", "CP277"); - fIANA2JavaMap.put("IBM278", "CP278"); - fIANA2JavaMap.put("CP278", "CP278"); - fIANA2JavaMap.put("CSIBM278", "CP278"); - fIANA2JavaMap.put("EBCDIC-CP-FI", "CP278"); - fIANA2JavaMap.put("EBCDIC-CP-SE", "CP278"); - fIANA2JavaMap.put("IBM280", "CP280"); - fIANA2JavaMap.put("CP280", "CP280"); - fIANA2JavaMap.put("CSIBM280", "CP280"); - fIANA2JavaMap.put("EBCDIC-CP-IT", "CP280"); - fIANA2JavaMap.put("IBM284", "CP284"); - fIANA2JavaMap.put("CP284", "CP284"); - fIANA2JavaMap.put("CSIBM284", "CP284"); - fIANA2JavaMap.put("EBCDIC-CP-ES", "CP284"); - fIANA2JavaMap.put("EBCDIC-CP-GB", "CP285"); - fIANA2JavaMap.put("IBM285", "CP285"); - fIANA2JavaMap.put("CP285", "CP285"); - fIANA2JavaMap.put("CSIBM285", "CP285"); - fIANA2JavaMap.put("EBCDIC-JP-KANA", "CP290"); - fIANA2JavaMap.put("IBM290", "CP290"); - fIANA2JavaMap.put("CP290", "CP290"); - fIANA2JavaMap.put("CSIBM290", "CP290"); - fIANA2JavaMap.put("EBCDIC-CP-FR", "CP297"); - fIANA2JavaMap.put("IBM297", "CP297"); - fIANA2JavaMap.put("CP297", "CP297"); - fIANA2JavaMap.put("CSIBM297", "CP297"); - fIANA2JavaMap.put("EBCDIC-CP-AR1", "CP420"); - fIANA2JavaMap.put("IBM420", "CP420"); - fIANA2JavaMap.put("CP420", "CP420"); - fIANA2JavaMap.put("CSIBM420", "CP420"); - fIANA2JavaMap.put("EBCDIC-CP-HE", "CP424"); - fIANA2JavaMap.put("IBM424", "CP424"); - fIANA2JavaMap.put("CP424", "CP424"); - fIANA2JavaMap.put("CSIBM424", "CP424"); - fIANA2JavaMap.put("IBM437", "CP437"); - fIANA2JavaMap.put("437", "CP437"); - fIANA2JavaMap.put("CP437", "CP437"); - fIANA2JavaMap.put("CSPC8CODEPAGE437", "CP437"); - fIANA2JavaMap.put("EBCDIC-CP-CH", "CP500"); - fIANA2JavaMap.put("IBM500", "CP500"); - fIANA2JavaMap.put("CP500", "CP500"); - fIANA2JavaMap.put("CSIBM500", "CP500"); - fIANA2JavaMap.put("EBCDIC-CP-CH", "CP500"); - fIANA2JavaMap.put("EBCDIC-CP-BE", "CP500"); - fIANA2JavaMap.put("IBM775", "CP775"); - fIANA2JavaMap.put("CP775", "CP775"); - fIANA2JavaMap.put("CSPC775BALTIC", "CP775"); - fIANA2JavaMap.put("IBM850", "CP850"); - fIANA2JavaMap.put("850", "CP850"); - fIANA2JavaMap.put("CP850", "CP850"); - fIANA2JavaMap.put("CSPC850MULTILINGUAL", "CP850"); - fIANA2JavaMap.put("IBM852", "CP852"); - fIANA2JavaMap.put("852", "CP852"); - fIANA2JavaMap.put("CP852", "CP852"); - fIANA2JavaMap.put("CSPCP852", "CP852"); - fIANA2JavaMap.put("IBM855", "CP855"); - fIANA2JavaMap.put("855", "CP855"); - fIANA2JavaMap.put("CP855", "CP855"); - fIANA2JavaMap.put("CSIBM855", "CP855"); - fIANA2JavaMap.put("IBM857", "CP857"); - fIANA2JavaMap.put("857", "CP857"); - fIANA2JavaMap.put("CP857", "CP857"); - fIANA2JavaMap.put("CSIBM857", "CP857"); - fIANA2JavaMap.put("IBM00858", "CP858"); - fIANA2JavaMap.put("CP00858", "CP858"); - fIANA2JavaMap.put("CCSID00858", "CP858"); - fIANA2JavaMap.put("IBM860", "CP860"); - fIANA2JavaMap.put("860", "CP860"); - fIANA2JavaMap.put("CP860", "CP860"); - fIANA2JavaMap.put("CSIBM860", "CP860"); - fIANA2JavaMap.put("IBM861", "CP861"); - fIANA2JavaMap.put("861", "CP861"); - fIANA2JavaMap.put("CP861", "CP861"); - fIANA2JavaMap.put("CP-IS", "CP861"); - fIANA2JavaMap.put("CSIBM861", "CP861"); - fIANA2JavaMap.put("IBM862", "CP862"); - fIANA2JavaMap.put("862", "CP862"); - fIANA2JavaMap.put("CP862", "CP862"); - fIANA2JavaMap.put("CSPC862LATINHEBREW", "CP862"); - fIANA2JavaMap.put("IBM863", "CP863"); - fIANA2JavaMap.put("863", "CP863"); - fIANA2JavaMap.put("CP863", "CP863"); - fIANA2JavaMap.put("CSIBM863", "CP863"); - fIANA2JavaMap.put("IBM864", "CP864"); - fIANA2JavaMap.put("CP864", "CP864"); - fIANA2JavaMap.put("CSIBM864", "CP864"); - fIANA2JavaMap.put("IBM865", "CP865"); - fIANA2JavaMap.put("865", "CP865"); - fIANA2JavaMap.put("CP865", "CP865"); - fIANA2JavaMap.put("CSIBM865", "CP865"); - fIANA2JavaMap.put("IBM866", "CP866"); - fIANA2JavaMap.put("866", "CP866"); - fIANA2JavaMap.put("CP866", "CP866"); - fIANA2JavaMap.put("CSIBM866", "CP866"); - fIANA2JavaMap.put("IBM868", "CP868"); - fIANA2JavaMap.put("CP868", "CP868"); - fIANA2JavaMap.put("CSIBM868", "CP868"); - fIANA2JavaMap.put("CP-AR", "CP868"); - fIANA2JavaMap.put("IBM869", "CP869"); - fIANA2JavaMap.put("CP869", "CP869"); - fIANA2JavaMap.put("CSIBM869", "CP869"); - fIANA2JavaMap.put("CP-GR", "CP869"); - fIANA2JavaMap.put("IBM870", "CP870"); - fIANA2JavaMap.put("CP870", "CP870"); - fIANA2JavaMap.put("CSIBM870", "CP870"); - fIANA2JavaMap.put("EBCDIC-CP-ROECE", "CP870"); - fIANA2JavaMap.put("EBCDIC-CP-YU", "CP870"); - fIANA2JavaMap.put("IBM871", "CP871"); - fIANA2JavaMap.put("CP871", "CP871"); - fIANA2JavaMap.put("CSIBM871", "CP871"); - fIANA2JavaMap.put("EBCDIC-CP-IS", "CP871"); - fIANA2JavaMap.put("IBM918", "CP918"); - fIANA2JavaMap.put("CP918", "CP918"); - fIANA2JavaMap.put("CSIBM918", "CP918"); - fIANA2JavaMap.put("EBCDIC-CP-AR2", "CP918"); - fIANA2JavaMap.put("IBM00924", "CP924"); - fIANA2JavaMap.put("CP00924", "CP924"); - fIANA2JavaMap.put("CCSID00924", "CP924"); + aIANA2JavaMap.put("BIG5", "Big5"); + aIANA2JavaMap.put("CSBIG5", "Big5"); + aIANA2JavaMap.put("CP037", "CP037"); + aIANA2JavaMap.put("IBM037", "CP037"); + aIANA2JavaMap.put("CSIBM037", "CP037"); + aIANA2JavaMap.put("EBCDIC-CP-US", "CP037"); + aIANA2JavaMap.put("EBCDIC-CP-CA", "CP037"); + aIANA2JavaMap.put("EBCDIC-CP-NL", "CP037"); + aIANA2JavaMap.put("EBCDIC-CP-WT", "CP037"); + aIANA2JavaMap.put("IBM273", "CP273"); + aIANA2JavaMap.put("CP273", "CP273"); + aIANA2JavaMap.put("CSIBM273", "CP273"); + aIANA2JavaMap.put("IBM277", "CP277"); + aIANA2JavaMap.put("CP277", "CP277"); + aIANA2JavaMap.put("CSIBM277", "CP277"); + aIANA2JavaMap.put("EBCDIC-CP-DK", "CP277"); + aIANA2JavaMap.put("EBCDIC-CP-NO", "CP277"); + aIANA2JavaMap.put("IBM278", "CP278"); + aIANA2JavaMap.put("CP278", "CP278"); + aIANA2JavaMap.put("CSIBM278", "CP278"); + aIANA2JavaMap.put("EBCDIC-CP-FI", "CP278"); + aIANA2JavaMap.put("EBCDIC-CP-SE", "CP278"); + aIANA2JavaMap.put("IBM280", "CP280"); + aIANA2JavaMap.put("CP280", "CP280"); + aIANA2JavaMap.put("CSIBM280", "CP280"); + aIANA2JavaMap.put("EBCDIC-CP-IT", "CP280"); + aIANA2JavaMap.put("IBM284", "CP284"); + aIANA2JavaMap.put("CP284", "CP284"); + aIANA2JavaMap.put("CSIBM284", "CP284"); + aIANA2JavaMap.put("EBCDIC-CP-ES", "CP284"); + aIANA2JavaMap.put("EBCDIC-CP-GB", "CP285"); + aIANA2JavaMap.put("IBM285", "CP285"); + aIANA2JavaMap.put("CP285", "CP285"); + aIANA2JavaMap.put("CSIBM285", "CP285"); + aIANA2JavaMap.put("EBCDIC-JP-KANA", "CP290"); + aIANA2JavaMap.put("IBM290", "CP290"); + aIANA2JavaMap.put("CP290", "CP290"); + aIANA2JavaMap.put("CSIBM290", "CP290"); + aIANA2JavaMap.put("EBCDIC-CP-FR", "CP297"); + aIANA2JavaMap.put("IBM297", "CP297"); + aIANA2JavaMap.put("CP297", "CP297"); + aIANA2JavaMap.put("CSIBM297", "CP297"); + aIANA2JavaMap.put("EBCDIC-CP-AR1", "CP420"); + aIANA2JavaMap.put("IBM420", "CP420"); + aIANA2JavaMap.put("CP420", "CP420"); + aIANA2JavaMap.put("CSIBM420", "CP420"); + aIANA2JavaMap.put("EBCDIC-CP-HE", "CP424"); + aIANA2JavaMap.put("IBM424", "CP424"); + aIANA2JavaMap.put("CP424", "CP424"); + aIANA2JavaMap.put("CSIBM424", "CP424"); + aIANA2JavaMap.put("IBM437", "CP437"); + aIANA2JavaMap.put("437", "CP437"); + aIANA2JavaMap.put("CP437", "CP437"); + aIANA2JavaMap.put("CSPC8CODEPAGE437", "CP437"); + aIANA2JavaMap.put("EBCDIC-CP-CH", "CP500"); + aIANA2JavaMap.put("IBM500", "CP500"); + aIANA2JavaMap.put("CP500", "CP500"); + aIANA2JavaMap.put("CSIBM500", "CP500"); + aIANA2JavaMap.put("EBCDIC-CP-CH", "CP500"); + aIANA2JavaMap.put("EBCDIC-CP-BE", "CP500"); + aIANA2JavaMap.put("IBM775", "CP775"); + aIANA2JavaMap.put("CP775", "CP775"); + aIANA2JavaMap.put("CSPC775BALTIC", "CP775"); + aIANA2JavaMap.put("IBM850", "CP850"); + aIANA2JavaMap.put("850", "CP850"); + aIANA2JavaMap.put("CP850", "CP850"); + aIANA2JavaMap.put("CSPC850MULTILINGUAL", "CP850"); + aIANA2JavaMap.put("IBM852", "CP852"); + aIANA2JavaMap.put("852", "CP852"); + aIANA2JavaMap.put("CP852", "CP852"); + aIANA2JavaMap.put("CSPCP852", "CP852"); + aIANA2JavaMap.put("IBM855", "CP855"); + aIANA2JavaMap.put("855", "CP855"); + aIANA2JavaMap.put("CP855", "CP855"); + aIANA2JavaMap.put("CSIBM855", "CP855"); + aIANA2JavaMap.put("IBM857", "CP857"); + aIANA2JavaMap.put("857", "CP857"); + aIANA2JavaMap.put("CP857", "CP857"); + aIANA2JavaMap.put("CSIBM857", "CP857"); + aIANA2JavaMap.put("IBM00858", "CP858"); + aIANA2JavaMap.put("CP00858", "CP858"); + aIANA2JavaMap.put("CCSID00858", "CP858"); + aIANA2JavaMap.put("IBM860", "CP860"); + aIANA2JavaMap.put("860", "CP860"); + aIANA2JavaMap.put("CP860", "CP860"); + aIANA2JavaMap.put("CSIBM860", "CP860"); + aIANA2JavaMap.put("IBM861", "CP861"); + aIANA2JavaMap.put("861", "CP861"); + aIANA2JavaMap.put("CP861", "CP861"); + aIANA2JavaMap.put("CP-IS", "CP861"); + aIANA2JavaMap.put("CSIBM861", "CP861"); + aIANA2JavaMap.put("IBM862", "CP862"); + aIANA2JavaMap.put("862", "CP862"); + aIANA2JavaMap.put("CP862", "CP862"); + aIANA2JavaMap.put("CSPC862LATINHEBREW", "CP862"); + aIANA2JavaMap.put("IBM863", "CP863"); + aIANA2JavaMap.put("863", "CP863"); + aIANA2JavaMap.put("CP863", "CP863"); + aIANA2JavaMap.put("CSIBM863", "CP863"); + aIANA2JavaMap.put("IBM864", "CP864"); + aIANA2JavaMap.put("CP864", "CP864"); + aIANA2JavaMap.put("CSIBM864", "CP864"); + aIANA2JavaMap.put("IBM865", "CP865"); + aIANA2JavaMap.put("865", "CP865"); + aIANA2JavaMap.put("CP865", "CP865"); + aIANA2JavaMap.put("CSIBM865", "CP865"); + aIANA2JavaMap.put("IBM866", "CP866"); + aIANA2JavaMap.put("866", "CP866"); + aIANA2JavaMap.put("CP866", "CP866"); + aIANA2JavaMap.put("CSIBM866", "CP866"); + aIANA2JavaMap.put("IBM868", "CP868"); + aIANA2JavaMap.put("CP868", "CP868"); + aIANA2JavaMap.put("CSIBM868", "CP868"); + aIANA2JavaMap.put("CP-AR", "CP868"); + aIANA2JavaMap.put("IBM869", "CP869"); + aIANA2JavaMap.put("CP869", "CP869"); + aIANA2JavaMap.put("CSIBM869", "CP869"); + aIANA2JavaMap.put("CP-GR", "CP869"); + aIANA2JavaMap.put("IBM870", "CP870"); + aIANA2JavaMap.put("CP870", "CP870"); + aIANA2JavaMap.put("CSIBM870", "CP870"); + aIANA2JavaMap.put("EBCDIC-CP-ROECE", "CP870"); + aIANA2JavaMap.put("EBCDIC-CP-YU", "CP870"); + aIANA2JavaMap.put("IBM871", "CP871"); + aIANA2JavaMap.put("CP871", "CP871"); + aIANA2JavaMap.put("CSIBM871", "CP871"); + aIANA2JavaMap.put("EBCDIC-CP-IS", "CP871"); + aIANA2JavaMap.put("IBM918", "CP918"); + aIANA2JavaMap.put("CP918", "CP918"); + aIANA2JavaMap.put("CSIBM918", "CP918"); + aIANA2JavaMap.put("EBCDIC-CP-AR2", "CP918"); + aIANA2JavaMap.put("IBM00924", "CP924"); + aIANA2JavaMap.put("CP00924", "CP924"); + aIANA2JavaMap.put("CCSID00924", "CP924"); // is this an error??? - fIANA2JavaMap.put("EBCDIC-LATIN9--EURO", "CP924"); - fIANA2JavaMap.put("IBM1026", "CP1026"); - fIANA2JavaMap.put("CP1026", "CP1026"); - fIANA2JavaMap.put("CSIBM1026", "CP1026"); - fIANA2JavaMap.put("IBM01140", "Cp1140"); - fIANA2JavaMap.put("CP01140", "Cp1140"); - fIANA2JavaMap.put("CCSID01140", "Cp1140"); - fIANA2JavaMap.put("IBM01141", "Cp1141"); - fIANA2JavaMap.put("CP01141", "Cp1141"); - fIANA2JavaMap.put("CCSID01141", "Cp1141"); - fIANA2JavaMap.put("IBM01142", "Cp1142"); - fIANA2JavaMap.put("CP01142", "Cp1142"); - fIANA2JavaMap.put("CCSID01142", "Cp1142"); - fIANA2JavaMap.put("IBM01143", "Cp1143"); - fIANA2JavaMap.put("CP01143", "Cp1143"); - fIANA2JavaMap.put("CCSID01143", "Cp1143"); - fIANA2JavaMap.put("IBM01144", "Cp1144"); - fIANA2JavaMap.put("CP01144", "Cp1144"); - fIANA2JavaMap.put("CCSID01144", "Cp1144"); - fIANA2JavaMap.put("IBM01145", "Cp1145"); - fIANA2JavaMap.put("CP01145", "Cp1145"); - fIANA2JavaMap.put("CCSID01145", "Cp1145"); - fIANA2JavaMap.put("IBM01146", "Cp1146"); - fIANA2JavaMap.put("CP01146", "Cp1146"); - fIANA2JavaMap.put("CCSID01146", "Cp1146"); - fIANA2JavaMap.put("IBM01147", "Cp1147"); - fIANA2JavaMap.put("CP01147", "Cp1147"); - fIANA2JavaMap.put("CCSID01147", "Cp1147"); - fIANA2JavaMap.put("IBM01148", "Cp1148"); - fIANA2JavaMap.put("CP01148", "Cp1148"); - fIANA2JavaMap.put("CCSID01148", "Cp1148"); - fIANA2JavaMap.put("IBM01149", "Cp1149"); - fIANA2JavaMap.put("CP01149", "Cp1149"); - fIANA2JavaMap.put("CCSID01149", "Cp1149"); - fIANA2JavaMap.put("EUC-JP", "EUCJIS"); - fIANA2JavaMap.put("CSEUCPKDFMTJAPANESE", "EUCJIS"); - fIANA2JavaMap.put("EXTENDED_UNIX_CODE_PACKED_FORMAT_FOR_JAPANESE", "EUCJIS"); - fIANA2JavaMap.put("EUC-KR", "KSC5601"); - fIANA2JavaMap.put("CSEUCKR", "KSC5601"); - fIANA2JavaMap.put("KS_C_5601-1987", "KS_C_5601-1987"); - fIANA2JavaMap.put("ISO-IR-149", "KS_C_5601-1987"); - fIANA2JavaMap.put("KS_C_5601-1989", "KS_C_5601-1987"); - fIANA2JavaMap.put("KSC_5601", "KS_C_5601-1987"); - fIANA2JavaMap.put("KOREAN", "KS_C_5601-1987"); - fIANA2JavaMap.put("CSKSC56011987", "KS_C_5601-1987"); - fIANA2JavaMap.put("GB2312", "GB2312"); - fIANA2JavaMap.put("CSGB2312", "GB2312"); - fIANA2JavaMap.put("ISO-2022-JP", "JIS"); - fIANA2JavaMap.put("CSISO2022JP", "JIS"); - fIANA2JavaMap.put("ISO-2022-KR", "ISO2022KR"); - fIANA2JavaMap.put("CSISO2022KR", "ISO2022KR"); - fIANA2JavaMap.put("ISO-2022-CN", "ISO2022CN"); - - fIANA2JavaMap.put("X0201", "JIS0201"); - fIANA2JavaMap.put("CSISO13JISC6220JP", "JIS0201"); - fIANA2JavaMap.put("X0208", "JIS0208"); - fIANA2JavaMap.put("ISO-IR-87", "JIS0208"); - fIANA2JavaMap.put("X0208dbiJIS_X0208-1983", "JIS0208"); - fIANA2JavaMap.put("CSISO87JISX0208", "JIS0208"); - fIANA2JavaMap.put("X0212", "JIS0212"); - fIANA2JavaMap.put("ISO-IR-159", "JIS0212"); - fIANA2JavaMap.put("CSISO159JISX02121990", "JIS0212"); - fIANA2JavaMap.put("GB18030", "GB18030"); - fIANA2JavaMap.put("GBK", "GBK"); - fIANA2JavaMap.put("CP936", "GBK"); - fIANA2JavaMap.put("MS936", "GBK"); - fIANA2JavaMap.put("WINDOWS-936", "GBK"); - fIANA2JavaMap.put("SHIFT_JIS", "SJIS"); - fIANA2JavaMap.put("CSSHIFTJIS", "SJIS"); - fIANA2JavaMap.put("MS_KANJI", "SJIS"); - fIANA2JavaMap.put("WINDOWS-31J", "MS932"); - fIANA2JavaMap.put("CSWINDOWS31J", "MS932"); + aIANA2JavaMap.put("EBCDIC-LATIN9--EURO", "CP924"); + aIANA2JavaMap.put("IBM1026", "CP1026"); + aIANA2JavaMap.put("CP1026", "CP1026"); + aIANA2JavaMap.put("CSIBM1026", "CP1026"); + aIANA2JavaMap.put("IBM01140", "Cp1140"); + aIANA2JavaMap.put("CP01140", "Cp1140"); + aIANA2JavaMap.put("CCSID01140", "Cp1140"); + aIANA2JavaMap.put("IBM01141", "Cp1141"); + aIANA2JavaMap.put("CP01141", "Cp1141"); + aIANA2JavaMap.put("CCSID01141", "Cp1141"); + aIANA2JavaMap.put("IBM01142", "Cp1142"); + aIANA2JavaMap.put("CP01142", "Cp1142"); + aIANA2JavaMap.put("CCSID01142", "Cp1142"); + aIANA2JavaMap.put("IBM01143", "Cp1143"); + aIANA2JavaMap.put("CP01143", "Cp1143"); + aIANA2JavaMap.put("CCSID01143", "Cp1143"); + aIANA2JavaMap.put("IBM01144", "Cp1144"); + aIANA2JavaMap.put("CP01144", "Cp1144"); + aIANA2JavaMap.put("CCSID01144", "Cp1144"); + aIANA2JavaMap.put("IBM01145", "Cp1145"); + aIANA2JavaMap.put("CP01145", "Cp1145"); + aIANA2JavaMap.put("CCSID01145", "Cp1145"); + aIANA2JavaMap.put("IBM01146", "Cp1146"); + aIANA2JavaMap.put("CP01146", "Cp1146"); + aIANA2JavaMap.put("CCSID01146", "Cp1146"); + aIANA2JavaMap.put("IBM01147", "Cp1147"); + aIANA2JavaMap.put("CP01147", "Cp1147"); + aIANA2JavaMap.put("CCSID01147", "Cp1147"); + aIANA2JavaMap.put("IBM01148", "Cp1148"); + aIANA2JavaMap.put("CP01148", "Cp1148"); + aIANA2JavaMap.put("CCSID01148", "Cp1148"); + aIANA2JavaMap.put("IBM01149", "Cp1149"); + aIANA2JavaMap.put("CP01149", "Cp1149"); + aIANA2JavaMap.put("CCSID01149", "Cp1149"); + aIANA2JavaMap.put("EUC-JP", "EUCJIS"); + aIANA2JavaMap.put("CSEUCPKDFMTJAPANESE", "EUCJIS"); + aIANA2JavaMap.put("EXTENDED_UNIX_CODE_PACKED_FORMAT_FOR_JAPANESE", "EUCJIS"); + aIANA2JavaMap.put("EUC-KR", "KSC5601"); + aIANA2JavaMap.put("CSEUCKR", "KSC5601"); + aIANA2JavaMap.put("KS_C_5601-1987", "KS_C_5601-1987"); + aIANA2JavaMap.put("ISO-IR-149", "KS_C_5601-1987"); + aIANA2JavaMap.put("KS_C_5601-1989", "KS_C_5601-1987"); + aIANA2JavaMap.put("KSC_5601", "KS_C_5601-1987"); + aIANA2JavaMap.put("KOREAN", "KS_C_5601-1987"); + aIANA2JavaMap.put("CSKSC56011987", "KS_C_5601-1987"); + aIANA2JavaMap.put("GB2312", "GB2312"); + aIANA2JavaMap.put("CSGB2312", "GB2312"); + aIANA2JavaMap.put("ISO-2022-JP", "JIS"); + aIANA2JavaMap.put("CSISO2022JP", "JIS"); + aIANA2JavaMap.put("ISO-2022-KR", "ISO2022KR"); + aIANA2JavaMap.put("CSISO2022KR", "ISO2022KR"); + aIANA2JavaMap.put("ISO-2022-CN", "ISO2022CN"); + + aIANA2JavaMap.put("X0201", "JIS0201"); + aIANA2JavaMap.put("CSISO13JISC6220JP", "JIS0201"); + aIANA2JavaMap.put("X0208", "JIS0208"); + aIANA2JavaMap.put("ISO-IR-87", "JIS0208"); + aIANA2JavaMap.put("X0208dbiJIS_X0208-1983", "JIS0208"); + aIANA2JavaMap.put("CSISO87JISX0208", "JIS0208"); + aIANA2JavaMap.put("X0212", "JIS0212"); + aIANA2JavaMap.put("ISO-IR-159", "JIS0212"); + aIANA2JavaMap.put("CSISO159JISX02121990", "JIS0212"); + aIANA2JavaMap.put("GB18030", "GB18030"); + aIANA2JavaMap.put("GBK", "GBK"); + aIANA2JavaMap.put("CP936", "GBK"); + aIANA2JavaMap.put("MS936", "GBK"); + aIANA2JavaMap.put("WINDOWS-936", "GBK"); + aIANA2JavaMap.put("SHIFT_JIS", "SJIS"); + aIANA2JavaMap.put("CSSHIFTJIS", "SJIS"); + aIANA2JavaMap.put("MS_KANJI", "SJIS"); + aIANA2JavaMap.put("WINDOWS-31J", "MS932"); + aIANA2JavaMap.put("CSWINDOWS31J", "MS932"); // Add support for Cp1252 and its friends - fIANA2JavaMap.put("WINDOWS-1250", "Cp1250"); - fIANA2JavaMap.put("WINDOWS-1251", "Cp1251"); - fIANA2JavaMap.put("WINDOWS-1252", "Cp1252"); - fIANA2JavaMap.put("WINDOWS-1253", "Cp1253"); - fIANA2JavaMap.put("WINDOWS-1254", "Cp1254"); - fIANA2JavaMap.put("WINDOWS-1255", "Cp1255"); - fIANA2JavaMap.put("WINDOWS-1256", "Cp1256"); - fIANA2JavaMap.put("WINDOWS-1257", "Cp1257"); - fIANA2JavaMap.put("WINDOWS-1258", "Cp1258"); - fIANA2JavaMap.put("TIS-620", "TIS620"); - - fIANA2JavaMap.put("ISO-8859-1", "ISO8859_1"); - fIANA2JavaMap.put("ISO-IR-100", "ISO8859_1"); - fIANA2JavaMap.put("ISO_8859-1", "ISO8859_1"); - fIANA2JavaMap.put("LATIN1", "ISO8859_1"); - fIANA2JavaMap.put("CSISOLATIN1", "ISO8859_1"); - fIANA2JavaMap.put("L1", "ISO8859_1"); - fIANA2JavaMap.put("IBM819", "ISO8859_1"); - fIANA2JavaMap.put("CP819", "ISO8859_1"); - - fIANA2JavaMap.put("ISO-8859-2", "ISO8859_2"); - fIANA2JavaMap.put("ISO-IR-101", "ISO8859_2"); - fIANA2JavaMap.put("ISO_8859-2", "ISO8859_2"); - fIANA2JavaMap.put("LATIN2", "ISO8859_2"); - fIANA2JavaMap.put("CSISOLATIN2", "ISO8859_2"); - fIANA2JavaMap.put("L2", "ISO8859_2"); - - fIANA2JavaMap.put("ISO-8859-3", "ISO8859_3"); - fIANA2JavaMap.put("ISO-IR-109", "ISO8859_3"); - fIANA2JavaMap.put("ISO_8859-3", "ISO8859_3"); - fIANA2JavaMap.put("LATIN3", "ISO8859_3"); - fIANA2JavaMap.put("CSISOLATIN3", "ISO8859_3"); - fIANA2JavaMap.put("L3", "ISO8859_3"); - - fIANA2JavaMap.put("ISO-8859-4", "ISO8859_4"); - fIANA2JavaMap.put("ISO-IR-110", "ISO8859_4"); - fIANA2JavaMap.put("ISO_8859-4", "ISO8859_4"); - fIANA2JavaMap.put("LATIN4", "ISO8859_4"); - fIANA2JavaMap.put("CSISOLATIN4", "ISO8859_4"); - fIANA2JavaMap.put("L4", "ISO8859_4"); - - fIANA2JavaMap.put("ISO-8859-5", "ISO8859_5"); - fIANA2JavaMap.put("ISO-IR-144", "ISO8859_5"); - fIANA2JavaMap.put("ISO_8859-5", "ISO8859_5"); - fIANA2JavaMap.put("CYRILLIC", "ISO8859_5"); - fIANA2JavaMap.put("CSISOLATINCYRILLIC", "ISO8859_5"); - - fIANA2JavaMap.put("ISO-8859-6", "ISO8859_6"); - fIANA2JavaMap.put("ISO-IR-127", "ISO8859_6"); - fIANA2JavaMap.put("ISO_8859-6", "ISO8859_6"); - fIANA2JavaMap.put("ECMA-114", "ISO8859_6"); - fIANA2JavaMap.put("ASMO-708", "ISO8859_6"); - fIANA2JavaMap.put("ARABIC", "ISO8859_6"); - fIANA2JavaMap.put("CSISOLATINARABIC", "ISO8859_6"); - - fIANA2JavaMap.put("ISO-8859-7", "ISO8859_7"); - fIANA2JavaMap.put("ISO-IR-126", "ISO8859_7"); - fIANA2JavaMap.put("ISO_8859-7", "ISO8859_7"); - fIANA2JavaMap.put("ELOT_928", "ISO8859_7"); - fIANA2JavaMap.put("ECMA-118", "ISO8859_7"); - fIANA2JavaMap.put("GREEK", "ISO8859_7"); - fIANA2JavaMap.put("CSISOLATINGREEK", "ISO8859_7"); - fIANA2JavaMap.put("GREEK8", "ISO8859_7"); - - fIANA2JavaMap.put("ISO-8859-8", "ISO8859_8"); - fIANA2JavaMap.put("ISO-8859-8-I", "ISO8859_8"); // added since this encoding only differs w.r.t. presentation - fIANA2JavaMap.put("ISO-IR-138", "ISO8859_8"); - fIANA2JavaMap.put("ISO_8859-8", "ISO8859_8"); - fIANA2JavaMap.put("HEBREW", "ISO8859_8"); - fIANA2JavaMap.put("CSISOLATINHEBREW", "ISO8859_8"); - - fIANA2JavaMap.put("ISO-8859-9", "ISO8859_9"); - fIANA2JavaMap.put("ISO-IR-148", "ISO8859_9"); - fIANA2JavaMap.put("ISO_8859-9", "ISO8859_9"); - fIANA2JavaMap.put("LATIN5", "ISO8859_9"); - fIANA2JavaMap.put("CSISOLATIN5", "ISO8859_9"); - fIANA2JavaMap.put("L5", "ISO8859_9"); - - fIANA2JavaMap.put("ISO-8859-13", "ISO8859_13"); - - fIANA2JavaMap.put("ISO-8859-15", "ISO8859_15_FDIS"); - fIANA2JavaMap.put("ISO_8859-15", "ISO8859_15_FDIS"); - fIANA2JavaMap.put("LATIN-9", "ISO8859_15_FDIS"); - - fIANA2JavaMap.put("KOI8-R", "KOI8_R"); - fIANA2JavaMap.put("CSKOI8R", "KOI8_R"); - fIANA2JavaMap.put("US-ASCII", "ASCII"); - fIANA2JavaMap.put("ISO-IR-6", "ASCII"); - fIANA2JavaMap.put("ANSI_X3.4-1968", "ASCII"); - fIANA2JavaMap.put("ANSI_X3.4-1986", "ASCII"); - fIANA2JavaMap.put("ISO_646.IRV:1991", "ASCII"); - fIANA2JavaMap.put("ASCII", "ASCII"); - fIANA2JavaMap.put("CSASCII", "ASCII"); - fIANA2JavaMap.put("ISO646-US", "ASCII"); - fIANA2JavaMap.put("US", "ASCII"); - fIANA2JavaMap.put("IBM367", "ASCII"); - fIANA2JavaMap.put("CP367", "ASCII"); - fIANA2JavaMap.put("UTF-8", "UTF8"); - fIANA2JavaMap.put("UTF-16", "UTF-16"); - fIANA2JavaMap.put("UTF-16BE", "UnicodeBig"); - fIANA2JavaMap.put("UTF-16LE", "UnicodeLittle"); + aIANA2JavaMap.put("WINDOWS-1250", "Cp1250"); + aIANA2JavaMap.put("WINDOWS-1251", "Cp1251"); + aIANA2JavaMap.put("WINDOWS-1252", "Cp1252"); + aIANA2JavaMap.put("WINDOWS-1253", "Cp1253"); + aIANA2JavaMap.put("WINDOWS-1254", "Cp1254"); + aIANA2JavaMap.put("WINDOWS-1255", "Cp1255"); + aIANA2JavaMap.put("WINDOWS-1256", "Cp1256"); + aIANA2JavaMap.put("WINDOWS-1257", "Cp1257"); + aIANA2JavaMap.put("WINDOWS-1258", "Cp1258"); + aIANA2JavaMap.put("TIS-620", "TIS620"); + + aIANA2JavaMap.put("ISO-8859-1", "ISO8859_1"); + aIANA2JavaMap.put("ISO-IR-100", "ISO8859_1"); + aIANA2JavaMap.put("ISO_8859-1", "ISO8859_1"); + aIANA2JavaMap.put("LATIN1", "ISO8859_1"); + aIANA2JavaMap.put("CSISOLATIN1", "ISO8859_1"); + aIANA2JavaMap.put("L1", "ISO8859_1"); + aIANA2JavaMap.put("IBM819", "ISO8859_1"); + aIANA2JavaMap.put("CP819", "ISO8859_1"); + + aIANA2JavaMap.put("ISO-8859-2", "ISO8859_2"); + aIANA2JavaMap.put("ISO-IR-101", "ISO8859_2"); + aIANA2JavaMap.put("ISO_8859-2", "ISO8859_2"); + aIANA2JavaMap.put("LATIN2", "ISO8859_2"); + aIANA2JavaMap.put("CSISOLATIN2", "ISO8859_2"); + aIANA2JavaMap.put("L2", "ISO8859_2"); + + aIANA2JavaMap.put("ISO-8859-3", "ISO8859_3"); + aIANA2JavaMap.put("ISO-IR-109", "ISO8859_3"); + aIANA2JavaMap.put("ISO_8859-3", "ISO8859_3"); + aIANA2JavaMap.put("LATIN3", "ISO8859_3"); + aIANA2JavaMap.put("CSISOLATIN3", "ISO8859_3"); + aIANA2JavaMap.put("L3", "ISO8859_3"); + + aIANA2JavaMap.put("ISO-8859-4", "ISO8859_4"); + aIANA2JavaMap.put("ISO-IR-110", "ISO8859_4"); + aIANA2JavaMap.put("ISO_8859-4", "ISO8859_4"); + aIANA2JavaMap.put("LATIN4", "ISO8859_4"); + aIANA2JavaMap.put("CSISOLATIN4", "ISO8859_4"); + aIANA2JavaMap.put("L4", "ISO8859_4"); + + aIANA2JavaMap.put("ISO-8859-5", "ISO8859_5"); + aIANA2JavaMap.put("ISO-IR-144", "ISO8859_5"); + aIANA2JavaMap.put("ISO_8859-5", "ISO8859_5"); + aIANA2JavaMap.put("CYRILLIC", "ISO8859_5"); + aIANA2JavaMap.put("CSISOLATINCYRILLIC", "ISO8859_5"); + + aIANA2JavaMap.put("ISO-8859-6", "ISO8859_6"); + aIANA2JavaMap.put("ISO-IR-127", "ISO8859_6"); + aIANA2JavaMap.put("ISO_8859-6", "ISO8859_6"); + aIANA2JavaMap.put("ECMA-114", "ISO8859_6"); + aIANA2JavaMap.put("ASMO-708", "ISO8859_6"); + aIANA2JavaMap.put("ARABIC", "ISO8859_6"); + aIANA2JavaMap.put("CSISOLATINARABIC", "ISO8859_6"); + + aIANA2JavaMap.put("ISO-8859-7", "ISO8859_7"); + aIANA2JavaMap.put("ISO-IR-126", "ISO8859_7"); + aIANA2JavaMap.put("ISO_8859-7", "ISO8859_7"); + aIANA2JavaMap.put("ELOT_928", "ISO8859_7"); + aIANA2JavaMap.put("ECMA-118", "ISO8859_7"); + aIANA2JavaMap.put("GREEK", "ISO8859_7"); + aIANA2JavaMap.put("CSISOLATINGREEK", "ISO8859_7"); + aIANA2JavaMap.put("GREEK8", "ISO8859_7"); + + aIANA2JavaMap.put("ISO-8859-8", "ISO8859_8"); + aIANA2JavaMap.put("ISO-8859-8-I", "ISO8859_8"); // added since this encoding only differs w.r.t. presentation + aIANA2JavaMap.put("ISO-IR-138", "ISO8859_8"); + aIANA2JavaMap.put("ISO_8859-8", "ISO8859_8"); + aIANA2JavaMap.put("HEBREW", "ISO8859_8"); + aIANA2JavaMap.put("CSISOLATINHEBREW", "ISO8859_8"); + + aIANA2JavaMap.put("ISO-8859-9", "ISO8859_9"); + aIANA2JavaMap.put("ISO-IR-148", "ISO8859_9"); + aIANA2JavaMap.put("ISO_8859-9", "ISO8859_9"); + aIANA2JavaMap.put("LATIN5", "ISO8859_9"); + aIANA2JavaMap.put("CSISOLATIN5", "ISO8859_9"); + aIANA2JavaMap.put("L5", "ISO8859_9"); + + aIANA2JavaMap.put("ISO-8859-13", "ISO8859_13"); + + aIANA2JavaMap.put("ISO-8859-15", "ISO8859_15_FDIS"); + aIANA2JavaMap.put("ISO_8859-15", "ISO8859_15_FDIS"); + aIANA2JavaMap.put("LATIN-9", "ISO8859_15_FDIS"); + + aIANA2JavaMap.put("KOI8-R", "KOI8_R"); + aIANA2JavaMap.put("CSKOI8R", "KOI8_R"); + aIANA2JavaMap.put("US-ASCII", "ASCII"); + aIANA2JavaMap.put("ISO-IR-6", "ASCII"); + aIANA2JavaMap.put("ANSI_X3.4-1968", "ASCII"); + aIANA2JavaMap.put("ANSI_X3.4-1986", "ASCII"); + aIANA2JavaMap.put("ISO_646.IRV:1991", "ASCII"); + aIANA2JavaMap.put("ASCII", "ASCII"); + aIANA2JavaMap.put("CSASCII", "ASCII"); + aIANA2JavaMap.put("ISO646-US", "ASCII"); + aIANA2JavaMap.put("US", "ASCII"); + aIANA2JavaMap.put("IBM367", "ASCII"); + aIANA2JavaMap.put("CP367", "ASCII"); + aIANA2JavaMap.put("UTF-8", "UTF8"); + aIANA2JavaMap.put("UTF-16", "UTF-16"); + aIANA2JavaMap.put("UTF-16BE", "UnicodeBig"); + aIANA2JavaMap.put("UTF-16LE", "UnicodeLittle"); // support for 1047, as proposed to be added to the // IANA registry in // http://lists.w3.org/Archives/Public/ietf-charset/2002JulSep/0049.html - fIANA2JavaMap.put("IBM-1047", "Cp1047"); - fIANA2JavaMap.put("IBM1047", "Cp1047"); - fIANA2JavaMap.put("CP1047", "Cp1047"); + aIANA2JavaMap.put("IBM-1047", "Cp1047"); + aIANA2JavaMap.put("IBM1047", "Cp1047"); + aIANA2JavaMap.put("CP1047", "Cp1047"); // Adding new aliases as proposed in // http://lists.w3.org/Archives/Public/ietf-charset/2002JulSep/0058.html - fIANA2JavaMap.put("IBM-37", "CP037"); - fIANA2JavaMap.put("IBM-273", "CP273"); - fIANA2JavaMap.put("IBM-277", "CP277"); - fIANA2JavaMap.put("IBM-278", "CP278"); - fIANA2JavaMap.put("IBM-280", "CP280"); - fIANA2JavaMap.put("IBM-284", "CP284"); - fIANA2JavaMap.put("IBM-285", "CP285"); - fIANA2JavaMap.put("IBM-290", "CP290"); - fIANA2JavaMap.put("IBM-297", "CP297"); - fIANA2JavaMap.put("IBM-420", "CP420"); - fIANA2JavaMap.put("IBM-424", "CP424"); - fIANA2JavaMap.put("IBM-437", "CP437"); - fIANA2JavaMap.put("IBM-500", "CP500"); - fIANA2JavaMap.put("IBM-775", "CP775"); - fIANA2JavaMap.put("IBM-850", "CP850"); - fIANA2JavaMap.put("IBM-852", "CP852"); - fIANA2JavaMap.put("IBM-855", "CP855"); - fIANA2JavaMap.put("IBM-857", "CP857"); - fIANA2JavaMap.put("IBM-858", "CP858"); - fIANA2JavaMap.put("IBM-860", "CP860"); - fIANA2JavaMap.put("IBM-861", "CP861"); - fIANA2JavaMap.put("IBM-862", "CP862"); - fIANA2JavaMap.put("IBM-863", "CP863"); - fIANA2JavaMap.put("IBM-864", "CP864"); - fIANA2JavaMap.put("IBM-865", "CP865"); - fIANA2JavaMap.put("IBM-866", "CP866"); - fIANA2JavaMap.put("IBM-868", "CP868"); - fIANA2JavaMap.put("IBM-869", "CP869"); - fIANA2JavaMap.put("IBM-870", "CP870"); - fIANA2JavaMap.put("IBM-871", "CP871"); - fIANA2JavaMap.put("IBM-918", "CP918"); - fIANA2JavaMap.put("IBM-924", "CP924"); - fIANA2JavaMap.put("IBM-1026", "CP1026"); - fIANA2JavaMap.put("IBM-1140", "Cp1140"); - fIANA2JavaMap.put("IBM-1141", "Cp1141"); - fIANA2JavaMap.put("IBM-1142", "Cp1142"); - fIANA2JavaMap.put("IBM-1143", "Cp1143"); - fIANA2JavaMap.put("IBM-1144", "Cp1144"); - fIANA2JavaMap.put("IBM-1145", "Cp1145"); - fIANA2JavaMap.put("IBM-1146", "Cp1146"); - fIANA2JavaMap.put("IBM-1147", "Cp1147"); - fIANA2JavaMap.put("IBM-1148", "Cp1148"); - fIANA2JavaMap.put("IBM-1149", "Cp1149"); - fIANA2JavaMap.put("IBM-819", "ISO8859_1"); - fIANA2JavaMap.put("IBM-367", "ASCII"); - + aIANA2JavaMap.put("IBM-37", "CP037"); + aIANA2JavaMap.put("IBM-273", "CP273"); + aIANA2JavaMap.put("IBM-277", "CP277"); + aIANA2JavaMap.put("IBM-278", "CP278"); + aIANA2JavaMap.put("IBM-280", "CP280"); + aIANA2JavaMap.put("IBM-284", "CP284"); + aIANA2JavaMap.put("IBM-285", "CP285"); + aIANA2JavaMap.put("IBM-290", "CP290"); + aIANA2JavaMap.put("IBM-297", "CP297"); + aIANA2JavaMap.put("IBM-420", "CP420"); + aIANA2JavaMap.put("IBM-424", "CP424"); + aIANA2JavaMap.put("IBM-437", "CP437"); + aIANA2JavaMap.put("IBM-500", "CP500"); + aIANA2JavaMap.put("IBM-775", "CP775"); + aIANA2JavaMap.put("IBM-850", "CP850"); + aIANA2JavaMap.put("IBM-852", "CP852"); + aIANA2JavaMap.put("IBM-855", "CP855"); + aIANA2JavaMap.put("IBM-857", "CP857"); + aIANA2JavaMap.put("IBM-858", "CP858"); + aIANA2JavaMap.put("IBM-860", "CP860"); + aIANA2JavaMap.put("IBM-861", "CP861"); + aIANA2JavaMap.put("IBM-862", "CP862"); + aIANA2JavaMap.put("IBM-863", "CP863"); + aIANA2JavaMap.put("IBM-864", "CP864"); + aIANA2JavaMap.put("IBM-865", "CP865"); + aIANA2JavaMap.put("IBM-866", "CP866"); + aIANA2JavaMap.put("IBM-868", "CP868"); + aIANA2JavaMap.put("IBM-869", "CP869"); + aIANA2JavaMap.put("IBM-870", "CP870"); + aIANA2JavaMap.put("IBM-871", "CP871"); + aIANA2JavaMap.put("IBM-918", "CP918"); + aIANA2JavaMap.put("IBM-924", "CP924"); + aIANA2JavaMap.put("IBM-1026", "CP1026"); + aIANA2JavaMap.put("IBM-1140", "Cp1140"); + aIANA2JavaMap.put("IBM-1141", "Cp1141"); + aIANA2JavaMap.put("IBM-1142", "Cp1142"); + aIANA2JavaMap.put("IBM-1143", "Cp1143"); + aIANA2JavaMap.put("IBM-1144", "Cp1144"); + aIANA2JavaMap.put("IBM-1145", "Cp1145"); + aIANA2JavaMap.put("IBM-1146", "Cp1146"); + aIANA2JavaMap.put("IBM-1147", "Cp1147"); + aIANA2JavaMap.put("IBM-1148", "Cp1148"); + aIANA2JavaMap.put("IBM-1149", "Cp1149"); + aIANA2JavaMap.put("IBM-819", "ISO8859_1"); + aIANA2JavaMap.put("IBM-367", "ASCII"); + + fIANA2JavaMap = Collections.unmodifiableMap(aIANA2JavaMap); // REVISIT: // j:CNS11643 -> EUC-TW? // ISO-2022-CN? ISO-2022-CN-EXT? // add Java to IANA encoding mappings - //fJava2IANAMap.put("8859_1", "US-ASCII"); // ? - fJava2IANAMap.put("ISO8859_1", "ISO-8859-1"); - fJava2IANAMap.put("ISO8859_2", "ISO-8859-2"); - fJava2IANAMap.put("ISO8859_3", "ISO-8859-3"); - fJava2IANAMap.put("ISO8859_4", "ISO-8859-4"); - fJava2IANAMap.put("ISO8859_5", "ISO-8859-5"); - fJava2IANAMap.put("ISO8859_6", "ISO-8859-6"); - fJava2IANAMap.put("ISO8859_7", "ISO-8859-7"); - fJava2IANAMap.put("ISO8859_8", "ISO-8859-8"); - fJava2IANAMap.put("ISO8859_9", "ISO-8859-9"); - fJava2IANAMap.put("ISO8859_13", "ISO-8859-13"); - fJava2IANAMap.put("ISO8859_15", "ISO-8859-15"); - fJava2IANAMap.put("ISO8859_15_FDIS", "ISO-8859-15"); - fJava2IANAMap.put("Big5", "BIG5"); - fJava2IANAMap.put("CP037", "EBCDIC-CP-US"); - fJava2IANAMap.put("CP273", "IBM273"); - fJava2IANAMap.put("CP277", "EBCDIC-CP-DK"); - fJava2IANAMap.put("CP278", "EBCDIC-CP-FI"); - fJava2IANAMap.put("CP280", "EBCDIC-CP-IT"); - fJava2IANAMap.put("CP284", "EBCDIC-CP-ES"); - fJava2IANAMap.put("CP285", "EBCDIC-CP-GB"); - fJava2IANAMap.put("CP290", "EBCDIC-JP-KANA"); - fJava2IANAMap.put("CP297", "EBCDIC-CP-FR"); - fJava2IANAMap.put("CP420", "EBCDIC-CP-AR1"); - fJava2IANAMap.put("CP424", "EBCDIC-CP-HE"); - fJava2IANAMap.put("CP437", "IBM437"); - fJava2IANAMap.put("CP500", "EBCDIC-CP-CH"); - fJava2IANAMap.put("CP775", "IBM775"); - fJava2IANAMap.put("CP850", "IBM850"); - fJava2IANAMap.put("CP852", "IBM852"); - fJava2IANAMap.put("CP855", "IBM855"); - fJava2IANAMap.put("CP857", "IBM857"); - fJava2IANAMap.put("CP858", "IBM00858"); - fJava2IANAMap.put("CP860", "IBM860"); - fJava2IANAMap.put("CP861", "IBM861"); - fJava2IANAMap.put("CP862", "IBM862"); - fJava2IANAMap.put("CP863", "IBM863"); - fJava2IANAMap.put("CP864", "IBM864"); - fJava2IANAMap.put("CP865", "IBM865"); - fJava2IANAMap.put("CP866", "IBM866"); - fJava2IANAMap.put("CP868", "IBM868"); - fJava2IANAMap.put("CP869", "IBM869"); - fJava2IANAMap.put("CP870", "EBCDIC-CP-ROECE"); - fJava2IANAMap.put("CP871", "EBCDIC-CP-IS"); - fJava2IANAMap.put("CP918", "EBCDIC-CP-AR2"); - fJava2IANAMap.put("CP924", "IBM00924"); - fJava2IANAMap.put("CP1026", "IBM1026"); - fJava2IANAMap.put("Cp01140", "IBM01140"); - fJava2IANAMap.put("Cp01141", "IBM01141"); - fJava2IANAMap.put("Cp01142", "IBM01142"); - fJava2IANAMap.put("Cp01143", "IBM01143"); - fJava2IANAMap.put("Cp01144", "IBM01144"); - fJava2IANAMap.put("Cp01145", "IBM01145"); - fJava2IANAMap.put("Cp01146", "IBM01146"); - fJava2IANAMap.put("Cp01147", "IBM01147"); - fJava2IANAMap.put("Cp01148", "IBM01148"); - fJava2IANAMap.put("Cp01149", "IBM01149"); - fJava2IANAMap.put("EUCJIS", "EUC-JP"); - fJava2IANAMap.put("KS_C_5601-1987", "KS_C_5601-1987"); - fJava2IANAMap.put("GB2312", "GB2312"); - fJava2IANAMap.put("ISO2022KR", "ISO-2022-KR"); - fJava2IANAMap.put("ISO2022CN", "ISO-2022-CN"); - fJava2IANAMap.put("JIS", "ISO-2022-JP"); - fJava2IANAMap.put("KOI8_R", "KOI8-R"); - fJava2IANAMap.put("KSC5601", "EUC-KR"); - fJava2IANAMap.put("GB18030", "GB18030"); - fJava2IANAMap.put("GBK", "GBK"); - fJava2IANAMap.put("SJIS", "SHIFT_JIS"); - fJava2IANAMap.put("MS932", "WINDOWS-31J"); - fJava2IANAMap.put("UTF8", "UTF-8"); - fJava2IANAMap.put("Unicode", "UTF-16"); - fJava2IANAMap.put("UnicodeBig", "UTF-16BE"); - fJava2IANAMap.put("UnicodeLittle", "UTF-16LE"); - fJava2IANAMap.put("JIS0201", "X0201"); - fJava2IANAMap.put("JIS0208", "X0208"); - fJava2IANAMap.put("JIS0212", "ISO-IR-159"); + //aJava2IANAMap.put("8859_1", "US-ASCII"); // ? + aJava2IANAMap.put("ISO8859_1", "ISO-8859-1"); + aJava2IANAMap.put("ISO8859_2", "ISO-8859-2"); + aJava2IANAMap.put("ISO8859_3", "ISO-8859-3"); + aJava2IANAMap.put("ISO8859_4", "ISO-8859-4"); + aJava2IANAMap.put("ISO8859_5", "ISO-8859-5"); + aJava2IANAMap.put("ISO8859_6", "ISO-8859-6"); + aJava2IANAMap.put("ISO8859_7", "ISO-8859-7"); + aJava2IANAMap.put("ISO8859_8", "ISO-8859-8"); + aJava2IANAMap.put("ISO8859_9", "ISO-8859-9"); + aJava2IANAMap.put("ISO8859_13", "ISO-8859-13"); + aJava2IANAMap.put("ISO8859_15", "ISO-8859-15"); + aJava2IANAMap.put("ISO8859_15_FDIS", "ISO-8859-15"); + aJava2IANAMap.put("Big5", "BIG5"); + aJava2IANAMap.put("CP037", "EBCDIC-CP-US"); + aJava2IANAMap.put("CP273", "IBM273"); + aJava2IANAMap.put("CP277", "EBCDIC-CP-DK"); + aJava2IANAMap.put("CP278", "EBCDIC-CP-FI"); + aJava2IANAMap.put("CP280", "EBCDIC-CP-IT"); + aJava2IANAMap.put("CP284", "EBCDIC-CP-ES"); + aJava2IANAMap.put("CP285", "EBCDIC-CP-GB"); + aJava2IANAMap.put("CP290", "EBCDIC-JP-KANA"); + aJava2IANAMap.put("CP297", "EBCDIC-CP-FR"); + aJava2IANAMap.put("CP420", "EBCDIC-CP-AR1"); + aJava2IANAMap.put("CP424", "EBCDIC-CP-HE"); + aJava2IANAMap.put("CP437", "IBM437"); + aJava2IANAMap.put("CP500", "EBCDIC-CP-CH"); + aJava2IANAMap.put("CP775", "IBM775"); + aJava2IANAMap.put("CP850", "IBM850"); + aJava2IANAMap.put("CP852", "IBM852"); + aJava2IANAMap.put("CP855", "IBM855"); + aJava2IANAMap.put("CP857", "IBM857"); + aJava2IANAMap.put("CP858", "IBM00858"); + aJava2IANAMap.put("CP860", "IBM860"); + aJava2IANAMap.put("CP861", "IBM861"); + aJava2IANAMap.put("CP862", "IBM862"); + aJava2IANAMap.put("CP863", "IBM863"); + aJava2IANAMap.put("CP864", "IBM864"); + aJava2IANAMap.put("CP865", "IBM865"); + aJava2IANAMap.put("CP866", "IBM866"); + aJava2IANAMap.put("CP868", "IBM868"); + aJava2IANAMap.put("CP869", "IBM869"); + aJava2IANAMap.put("CP870", "EBCDIC-CP-ROECE"); + aJava2IANAMap.put("CP871", "EBCDIC-CP-IS"); + aJava2IANAMap.put("CP918", "EBCDIC-CP-AR2"); + aJava2IANAMap.put("CP924", "IBM00924"); + aJava2IANAMap.put("CP1026", "IBM1026"); + aJava2IANAMap.put("CP1140", "IBM01140"); + aJava2IANAMap.put("CP1141", "IBM01141"); + aJava2IANAMap.put("CP1142", "IBM01142"); + aJava2IANAMap.put("CP1143", "IBM01143"); + aJava2IANAMap.put("CP1144", "IBM01144"); + aJava2IANAMap.put("CP1145", "IBM01145"); + aJava2IANAMap.put("CP1146", "IBM01146"); + aJava2IANAMap.put("CP1147", "IBM01147"); + aJava2IANAMap.put("CP1148", "IBM01148"); + aJava2IANAMap.put("CP1149", "IBM01149"); + aJava2IANAMap.put("EUCJIS", "EUC-JP"); + aJava2IANAMap.put("KS_C_5601-1987", "KS_C_5601-1987"); + aJava2IANAMap.put("GB2312", "GB2312"); + aJava2IANAMap.put("ISO2022KR", "ISO-2022-KR"); + aJava2IANAMap.put("ISO2022CN", "ISO-2022-CN"); + aJava2IANAMap.put("JIS", "ISO-2022-JP"); + aJava2IANAMap.put("KOI8_R", "KOI8-R"); + aJava2IANAMap.put("KSC5601", "EUC-KR"); + aJava2IANAMap.put("GB18030", "GB18030"); + aJava2IANAMap.put("GBK", "GBK"); + aJava2IANAMap.put("SJIS", "SHIFT_JIS"); + aJava2IANAMap.put("MS932", "WINDOWS-31J"); + aJava2IANAMap.put("UTF8", "UTF-8"); + aJava2IANAMap.put("Unicode", "UTF-16"); + aJava2IANAMap.put("UnicodeBig", "UTF-16BE"); + aJava2IANAMap.put("UnicodeLittle", "UTF-16LE"); + aJava2IANAMap.put("JIS0201", "X0201"); + aJava2IANAMap.put("JIS0208", "X0208"); + aJava2IANAMap.put("JIS0212", "ISO-IR-159"); // proposed addition (see above for details): - fJava2IANAMap.put("CP1047", "IBM1047"); + aJava2IANAMap.put("CP1047", "IBM1047"); + fJava2IANAMap = Collections.unmodifiableMap(aIANA2JavaMap); } // <clinit>() // @@ -954,77 +960,22 @@ public class EncodingMap { // /** - * Adds an IANA to Java encoding name mapping. - * - * @param ianaEncoding The IANA encoding name. - * @param javaEncoding The Java encoding name. - * - * @deprecated Use of this method is not recommended. Its - * effect is JVM wide and may cause unforeseen behaviour - * for other applications running in the system. - */ - public static void putIANA2JavaMapping(String ianaEncoding, - String javaEncoding) { - fIANA2JavaMap.put(ianaEncoding, javaEncoding); - } // putIANA2JavaMapping(String,String) - - /** * Returns the Java encoding name for the specified IANA encoding name. * * @param ianaEncoding The IANA encoding name. */ public static String getIANA2JavaMapping(String ianaEncoding) { - return (String)fIANA2JavaMap.get(ianaEncoding); + return fIANA2JavaMap.get(ianaEncoding); } // getIANA2JavaMapping(String):String /** - * Removes an IANA to Java encoding name mapping. - * - * @param ianaEncoding The IANA encoding name. - * - * @deprecated Use of this method is not recommended. Its - * effect is JVM wide and may cause unforeseen behaviour - * for other applications running in the system. - */ - public static String removeIANA2JavaMapping(String ianaEncoding) { - return (String)fIANA2JavaMap.remove(ianaEncoding); - } // removeIANA2JavaMapping(String):String - - /** - * Adds a Java to IANA encoding name mapping. - * - * @param javaEncoding The Java encoding name. - * @param ianaEncoding The IANA encoding name. - * - * @deprecated Use of this method is not recommended. Its - * effect is JVM wide and may cause unforeseen behaviour - * for other applications running in the system. - */ - public static void putJava2IANAMapping(String javaEncoding, - String ianaEncoding) { - fJava2IANAMap.put(javaEncoding, ianaEncoding); - } // putJava2IANAMapping(String,String) - - /** * Returns the IANA encoding name for the specified Java encoding name. * * @param javaEncoding The Java encoding name. */ public static String getJava2IANAMapping(String javaEncoding) { - return (String)fJava2IANAMap.get(javaEncoding); + return fJava2IANAMap.get(javaEncoding); } // getJava2IANAMapping(String):String - /** - * Removes a Java to IANA encoding name mapping. - * - * @param javaEncoding The Java encoding name. - * - * @deprecated Use of this method is not recommended. Its - * effect is JVM wide and may cause unforeseen behaviour - * for other applications running in the system. - */ - public static String removeJava2IANAMapping(String javaEncoding) { - return (String)fJava2IANAMap.remove(javaEncoding); - } // removeJava2IANAMapping } // class EncodingMap diff --git a/src/com/sun/org/apache/xerces/internal/util/PrimeNumberSequenceGenerator.java b/src/com/sun/org/apache/xerces/internal/util/PrimeNumberSequenceGenerator.java new file mode 100644 index 0000000..2dd9548 --- /dev/null +++ b/src/com/sun/org/apache/xerces/internal/util/PrimeNumberSequenceGenerator.java @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + */ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.sun.org.apache.xerces.internal.util; + +import java.util.Random; + + /** + * Fills an array with a random sequence of prime numbers. + */ +final class PrimeNumberSequenceGenerator { + + private static final int [] PRIMES = { + 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, + 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, + 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, + 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, + 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, + 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509, + 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, 607, 613, 617, + 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691, 701, 709, 719, 727}; + + static void generateSequence(int[] arrayToFill) { + Random r = new Random(); + for (int i = 0; i < arrayToFill.length; i++) { + arrayToFill[i] = PRIMES[r.nextInt(PRIMES.length)]; + } + } +} diff --git a/src/com/sun/org/apache/xerces/internal/util/SymbolHash.java b/src/com/sun/org/apache/xerces/internal/util/SymbolHash.java index dee8383..2f16b36 100644 --- a/src/com/sun/org/apache/xerces/internal/util/SymbolHash.java +++ b/src/com/sun/org/apache/xerces/internal/util/SymbolHash.java @@ -1,13 +1,13 @@ /* - * reserved comment block - * DO NOT REMOVE OR ALTER! + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. */ /* - * Copyright 2001, 2002,2004 The Apache Software Foundation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * @@ -37,25 +37,40 @@ public class SymbolHash { // /** Default table size. */ - protected int fTableSize = 101; + protected static final int TABLE_SIZE = 101; + + /** Maximum hash collisions per bucket. */ + protected static final int MAX_HASH_COLLISIONS = 40; + + protected static final int MULTIPLIERS_SIZE = 1 << 5; + protected static final int MULTIPLIERS_MASK = MULTIPLIERS_SIZE - 1; // // Data // + /** Actual table size **/ + protected int fTableSize; + /** Buckets. */ protected Entry[] fBuckets; /** Number of elements. */ protected int fNum = 0; + /** + * Array of randomly selected hash function multipliers or <code>null</code> + * if the default String.hashCode() function should be used. + */ + protected int[] fHashMultipliers; + // // Constructors // /** Constructs a key table with the default size. */ public SymbolHash() { - fBuckets = new Entry[fTableSize]; + this(TABLE_SIZE); } /** @@ -81,19 +96,37 @@ public class SymbolHash { * @param value */ public void put(Object key, Object value) { - int bucket = (key.hashCode() & 0x7FFFFFFF) % fTableSize; - Entry entry = search(key, bucket); - // replace old value - if (entry != null) { - entry.value = value; + // search for identical key + int collisionCount = 0; + final int hash = hash(key); + int bucket = hash % fTableSize; + for (Entry entry = fBuckets[bucket]; entry != null; entry = entry.next) { + if (key.equals(entry.key)) { + // replace old value + entry.value = value; + return; + } + ++collisionCount; } - // create new entry - else { - entry = new Entry(key, value, fBuckets[bucket]); - fBuckets[bucket] = entry; - fNum++; + + if (fNum >= fTableSize) { + // Rehash the table if the number of entries + // would exceed the number of buckets. + rehash(); + bucket = hash % fTableSize; + } + else if (collisionCount >= MAX_HASH_COLLISIONS && key instanceof String) { + // Select a new hash function and rehash the table if + // MAX_HASH_COLLISIONS is exceeded. + rebalance(); + bucket = hash(key) % fTableSize; } + + // create new entry + Entry entry = new Entry(key, value, fBuckets[bucket]); + fBuckets[bucket] = entry; + ++fNum; } /** @@ -103,7 +136,7 @@ public class SymbolHash { * @return the value associated with the given key. */ public Object get(Object key) { - int bucket = (key.hashCode() & 0x7FFFFFFF) % fTableSize; + int bucket = hash(key) % fTableSize; Entry entry = search(key, bucket); if (entry != null) { return entry.value; @@ -158,15 +191,17 @@ public class SymbolHash { public SymbolHash makeClone() { SymbolHash newTable = new SymbolHash(fTableSize); newTable.fNum = fNum; + newTable.fHashMultipliers = fHashMultipliers != null ? (int[]) fHashMultipliers.clone() : null; for (int i = 0; i < fTableSize; i++) { - if (fBuckets[i] != null) + if (fBuckets[i] != null) { newTable.fBuckets[i] = fBuckets[i].makeClone(); + } } return newTable; } /** - * Remove all key/value assocaition. This tries to save a bit of GC'ing + * Remove all key/value association. This tries to save a bit of GC'ing * by at least keeping the fBuckets array around. */ public void clear() { @@ -174,6 +209,7 @@ public class SymbolHash { fBuckets[i] = null; } fNum = 0; + fHashMultipliers = null; } // clear(): void protected Entry search(Object key, int bucket) { @@ -185,6 +221,74 @@ public class SymbolHash { return null; } + /** + * Returns a hashcode value for the specified key. + * + * @param key The key to hash. + */ + protected int hash(Object key) { + if (fHashMultipliers == null || !(key instanceof String)) { + return key.hashCode() & 0x7FFFFFFF; + } + return hash0((String) key); + } // hash(Object):int + + private int hash0(String symbol) { + int code = 0; + final int length = symbol.length(); + final int[] multipliers = fHashMultipliers; + for (int i = 0; i < length; ++i) { + code = code * multipliers[i & MULTIPLIERS_MASK] + symbol.charAt(i); + } + return code & 0x7FFFFFFF; + } // hash0(String):int + + /** + * Increases the capacity of and internally reorganizes this + * SymbolHash, in order to accommodate and access its entries more + * efficiently. This method is called automatically when the + * number of keys in the SymbolHash exceeds its number of buckets. + */ + protected void rehash() { + rehashCommon((fBuckets.length << 1) + 1); + } + + /** + * Randomly selects a new hash function and reorganizes this SymbolHash + * in order to more evenly distribute its entries across the table. This + * method is called automatically when the number keys in one of the + * SymbolHash's buckets exceeds MAX_HASH_COLLISIONS. + */ + protected void rebalance() { + if (fHashMultipliers == null) { + fHashMultipliers = new int[MULTIPLIERS_SIZE]; + } + PrimeNumberSequenceGenerator.generateSequence(fHashMultipliers); + rehashCommon(fBuckets.length); + } + + private void rehashCommon(final int newCapacity) { + + final int oldCapacity = fBuckets.length; + final Entry[] oldTable = fBuckets; + + final Entry[] newTable = new Entry[newCapacity]; + + fBuckets = newTable; + fTableSize = fBuckets.length; + + for (int i = oldCapacity; i-- > 0;) { + for (Entry old = oldTable[i]; old != null; ) { + Entry e = old; + old = old.next; + + int index = hash(e.key) % newCapacity; + e.next = newTable[index]; + newTable[index] = e; + } + } + } + // // Classes // diff --git a/src/com/sun/org/apache/xerces/internal/util/SymbolTable.java b/src/com/sun/org/apache/xerces/internal/util/SymbolTable.java index 3398318..9eeef66 100644 --- a/src/com/sun/org/apache/xerces/internal/util/SymbolTable.java +++ b/src/com/sun/org/apache/xerces/internal/util/SymbolTable.java @@ -1,13 +1,13 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. */ - /* - * Copyright 2005 The Apache Software Foundation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * @@ -55,28 +55,99 @@ public class SymbolTable { // /** Default table size. */ - protected static final int TABLE_SIZE = 173; + protected static final int TABLE_SIZE = 101; + + /** Maximum hash collisions per bucket for a table with load factor == 1. */ + protected static final int MAX_HASH_COLLISIONS = 40; + protected static final int MULTIPLIERS_SIZE = 1 << 5; + protected static final int MULTIPLIERS_MASK = MULTIPLIERS_SIZE - 1; + + // + // Data + // /** Buckets. */ protected Entry[] fBuckets = null; - // actual table size + /** actual table size */ protected int fTableSize; + /** The total number of entries in the hash table. */ + protected transient int fCount; + + /** The table is rehashed when its size exceeds this threshold. (The + * value of this field is (int)(capacity * loadFactor).) */ + protected int fThreshold; + + /** The load factor for the SymbolTable. */ + protected float fLoadFactor; + + /** + * A new hash function is selected and the table is rehashed when + * the number of keys in the bucket exceeds this threshold. + */ + protected final int fCollisionThreshold; + + /** + * Array of randomly selected hash function multipliers or <code>null</code> + * if the default String.hashCode() function should be used. + */ + protected int[] fHashMultipliers; + // // Constructors // - /** Constructs a symbol table with a default number of buckets. */ - public SymbolTable() { - this(TABLE_SIZE); - } + /** + * Constructs a new, empty SymbolTable with the specified initial + * capacity and the specified load factor. + * + * @param initialCapacity the initial capacity of the SymbolTable. + * @param loadFactor the load factor of the SymbolTable. + * @throws IllegalArgumentException if the initial capacity is less + * than zero, or if the load factor is nonpositive. + */ + public SymbolTable(int initialCapacity, float loadFactor) { + + if (initialCapacity < 0) { + throw new IllegalArgumentException("Illegal Capacity: " + initialCapacity); + } + + if (loadFactor <= 0 || Float.isNaN(loadFactor)) { + throw new IllegalArgumentException("Illegal Load: " + loadFactor); + } + + if (initialCapacity == 0) { + initialCapacity = 1; + } - /** Constructs a symbol table with a specified number of buckets. */ - public SymbolTable(int tableSize) { - fTableSize = tableSize; + fLoadFactor = loadFactor; + fTableSize = initialCapacity; fBuckets = new Entry[fTableSize]; + fThreshold = (int)(fTableSize * loadFactor); + fCollisionThreshold = (int)(MAX_HASH_COLLISIONS * loadFactor); + fCount = 0; + } + + /** + * Constructs a new, empty SymbolTable with the specified initial capacity + * and default load factor, which is <tt>0.75</tt>. + * + * @param initialCapacity the initial capacity of the hashtable. + * @throws IllegalArgumentException if the initial capacity is less + * than zero. + */ + public SymbolTable(int initialCapacity) { + this(initialCapacity, 0.75f); + } + + /** + * Constructs a new, empty SymbolTable with a default initial capacity (101) + * and load factor, which is <tt>0.75</tt>. + */ + public SymbolTable() { + this(TABLE_SIZE, 0.75f); } // @@ -94,36 +165,39 @@ public class SymbolTable { public String addSymbol(String symbol) { // search for identical symbol - final int hash = hash(symbol); - final int bucket = hash % fTableSize; - final int length = symbol.length(); - OUTER: for (Entry entry = fBuckets[bucket]; entry != null; entry = entry.next) { - if (length == entry.characters.length && hash == entry.hashCode) { - if(symbol.regionMatches(0,entry.symbol,0,length)){ - return entry.symbol; - } - else{ - continue OUTER; - } - /** - for (int i = 0; i < length; i++) { - if (symbol.charAt(i) != entry.characters[i]) { - continue OUTER; - } - } - symbolAsArray = entry.characters; + int collisionCount = 0; + int bucket = hash(symbol) % fTableSize; + for (Entry entry = fBuckets[bucket]; entry != null; entry = entry.next) { + if (entry.symbol.equals(symbol)) { return entry.symbol; - */ } + ++collisionCount; + } + return addSymbol0(symbol, bucket, collisionCount); + + } // addSymbol(String):String + + private String addSymbol0(String symbol, int bucket, int collisionCount) { + + if (fCount >= fThreshold) { + // Rehash the table if the threshold is exceeded + rehash(); + bucket = hash(symbol) % fTableSize; + } + else if (collisionCount >= fCollisionThreshold) { + // Select a new hash function and rehash the table if + // the collision threshold is exceeded. + rebalance(); + bucket = hash(symbol) % fTableSize; } // create new entry Entry entry = new Entry(symbol, fBuckets[bucket]); - entry.hashCode = hash; fBuckets[bucket] = entry; + ++fCount; return entry.symbol; - } // addSymbol(String):String + } // addSymbol0(String,int,int):String /** * Adds the specified symbol to the symbol table and returns a @@ -136,27 +210,47 @@ public class SymbolTable { * @param length The length of the new symbol in the buffer. */ public String addSymbol(char[] buffer, int offset, int length) { + // search for identical symbol - int hash = hash(buffer, offset, length); - int bucket = hash % fTableSize; + int collisionCount = 0; + int bucket = hash(buffer, offset, length) % fTableSize; OUTER: for (Entry entry = fBuckets[bucket]; entry != null; entry = entry.next) { - if (length == entry.characters.length && hash ==entry.hashCode) { + if (length == entry.characters.length) { for (int i = 0; i < length; i++) { if (buffer[offset + i] != entry.characters[i]) { + ++collisionCount; continue OUTER; } } return entry.symbol; } + ++collisionCount; + } + return addSymbol0(buffer, offset, length, bucket, collisionCount); + + } // addSymbol(char[],int,int):String + + private String addSymbol0(char[] buffer, int offset, int length, int bucket, int collisionCount) { + + if (fCount >= fThreshold) { + // Rehash the table if the threshold is exceeded + rehash(); + bucket = hash(buffer, offset, length) % fTableSize; + } + else if (collisionCount >= fCollisionThreshold) { + // Select a new hash function and rehash the table if + // the collision threshold is exceeded. + rebalance(); + bucket = hash(buffer, offset, length) % fTableSize; } // add new entry Entry entry = new Entry(buffer, offset, length, fBuckets[bucket]); fBuckets[bucket] = entry; - entry.hashCode = hash; + ++fCount; return entry.symbol; - } // addSymbol(char[],int,int):String + } // addSymbol0(char[],int,int,int,int):String /** * Returns a hashcode value for the specified symbol. The value @@ -167,15 +261,21 @@ public class SymbolTable { * @param symbol The symbol to hash. */ public int hash(String symbol) { + if (fHashMultipliers == null) { + return symbol.hashCode() & 0x7FFFFFFF; + } + return hash0(symbol); + } // hash(String):int + private int hash0(String symbol) { int code = 0; - int length = symbol.length(); - for (int i = 0; i < length; i++) { - code = code * 37 + symbol.charAt(i); + final int length = symbol.length(); + final int[] multipliers = fHashMultipliers; + for (int i = 0; i < length; ++i) { + code = code * multipliers[i & MULTIPLIERS_MASK] + symbol.charAt(i); } return code & 0x7FFFFFFF; - - } // hash(String):int + } // hash0(String):int /** * Returns a hashcode value for the specified symbol information. @@ -189,14 +289,73 @@ public class SymbolTable { * @param length The length of the symbol. */ public int hash(char[] buffer, int offset, int length) { + if (fHashMultipliers == null) { + int code = 0; + for (int i = 0; i < length; ++i) { + code = code * 31 + buffer[offset + i]; + } + return code & 0x7FFFFFFF; + } + return hash0(buffer, offset, length); + + } // hash(char[],int,int):int + private int hash0(char[] buffer, int offset, int length) { int code = 0; - for (int i = 0; i < length; i++) { - code = code * 37 + buffer[offset + i]; + final int[] multipliers = fHashMultipliers; + for (int i = 0; i < length; ++i) { + code = code * multipliers[i & MULTIPLIERS_MASK] + buffer[offset + i]; } return code & 0x7FFFFFFF; + } // hash0(char[],int,int):int - } // hash(char[],int,int):int + /** + * Increases the capacity of and internally reorganizes this + * SymbolTable, in order to accommodate and access its entries more + * efficiently. This method is called automatically when the + * number of keys in the SymbolTable exceeds this hashtable's capacity + * and load factor. + */ + protected void rehash() { + rehashCommon(fBuckets.length * 2 + 1); + } + + /** + * Randomly selects a new hash function and reorganizes this SymbolTable + * in order to more evenly distribute its entries across the table. This + * method is called automatically when the number keys in one of the + * SymbolTable's buckets exceeds the given collision threshold. + */ + protected void rebalance() { + if (fHashMultipliers == null) { + fHashMultipliers = new int[MULTIPLIERS_SIZE]; + } + PrimeNumberSequenceGenerator.generateSequence(fHashMultipliers); + rehashCommon(fBuckets.length); + } + + private void rehashCommon(final int newCapacity) { + + int oldCapacity = fBuckets.length; + Entry[] oldTable = fBuckets; + + Entry[] newTable = new Entry[newCapacity]; + + fThreshold = (int)(newCapacity * fLoadFactor); + fBuckets = newTable; + fTableSize = fBuckets.length; + + for (int i = oldCapacity ; i-- > 0 ;) { + for (Entry old = oldTable[i] ; old != null ; ) { + Entry e = old; + old = old.next; + + int index = hash(e.symbol) % newCapacity; + e.next = newTable[index]; + newTable[index] = e; + } + } + } /** * Returns true if the symbol table already contains the specified @@ -207,25 +366,16 @@ public class SymbolTable { public boolean containsSymbol(String symbol) { // search for identical symbol - int hash = hash(symbol); - int bucket = hash % fTableSize; + int bucket = hash(symbol) % fTableSize; int length = symbol.length(); OUTER: for (Entry entry = fBuckets[bucket]; entry != null; entry = entry.next) { - if (length == entry.characters.length && hash == entry.hashCode) { - if(symbol.regionMatches(0,entry.symbol,0,length)){ - return true; - } - else { - continue OUTER; - } - /** + if (length == entry.characters.length) { for (int i = 0; i < length; i++) { if (symbol.charAt(i) != entry.characters[i]) { continue OUTER; } } - return true; - */ + return true; } } @@ -244,10 +394,9 @@ public class SymbolTable { public boolean containsSymbol(char[] buffer, int offset, int length) { // search for identical symbol - int hash = hash(buffer, offset, length) ; - int bucket = hash % fTableSize; + int bucket = hash(buffer, offset, length) % fTableSize; OUTER: for (Entry entry = fBuckets[bucket]; entry != null; entry = entry.next) { - if (length == entry.characters.length && hash == entry.hashCode) { + if (length == entry.characters.length) { for (int i = 0; i < length; i++) { if (buffer[offset + i] != entry.characters[i]) { continue OUTER; @@ -261,7 +410,6 @@ public class SymbolTable { } // containsSymbol(char[],int,int):boolean - // // Classes // @@ -277,14 +425,13 @@ public class SymbolTable { // /** Symbol. */ - public String symbol; - int hashCode = 0; + public final String symbol; /** * Symbol characters. This information is duplicated here for * comparison performance. */ - public char[] characters; + public final char[] characters; /** The next entry. */ public Entry next; diff --git a/src/com/sun/org/apache/xerces/internal/util/TypeInfoImpl.java b/src/com/sun/org/apache/xerces/internal/util/TypeInfoImpl.java deleted file mode 100644 index 69482a5..0000000 --- a/src/com/sun/org/apache/xerces/internal/util/TypeInfoImpl.java +++ /dev/null @@ -1,134 +0,0 @@ -/* - * reserved comment block - * DO NOT REMOVE OR ALTER! - */ -/* - * The Apache Software License, Version 1.1 - * - * - * Copyright (c) 2000-2002 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Xerces" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation and was - * originally based on software copyright (c) 1999, International - * Business Machines, Inc., http://www.apache.org. For more - * information on the Apache Software Foundation, please see - * <http://www.apache.org/>. - */ -package com.sun.org.apache.xerces.internal.util; - -import java.util.Hashtable; - -import com.sun.org.apache.xerces.internal.xs.XSTypeDefinition; -import org.w3c.dom.TypeInfo; - -/** - * Straight-forward implementation of {@link TypeInfo}. - * - * <p> - * This class is immutable. - * - * @author - * Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com) - */ -public class TypeInfoImpl implements TypeInfo { - - private final String typeNamespace; - private final String typeName; - private final static String dtdNamespaceURI = "http://www.w3.org/TR/REC-xml"; - public TypeInfoImpl(){ - typeNamespace = null; - typeName = null; - } - public TypeInfoImpl(String typeNamespace, String typeName) { - this.typeNamespace = typeNamespace; - this.typeName = typeName; - } - - public TypeInfoImpl(XSTypeDefinition t) { - this( t.getNamespace(), t.getName() ); - } - - public String getTypeName() { - return typeName; - } - - public String getTypeNamespace() { - return typeNamespace; - } - - /** - * Always returns false. - */ - public boolean isDerivedFrom(String typeNamespaceArg, String typeNameArg, int derivationMethod) { - return false; - } - - /** - * Map from DTD type name ({@link String}) to {@link TypeInfo}. - */ - private static final Hashtable dtdCache = new Hashtable(); - - /** - * Obtains a {@link TypeInfo} object from the DTD type name. - * <p> - * Since DTD has a very limited type names, we can actually - * cache the {@link TypeInfo} objects. - */ - public static TypeInfo getDTDTypeInfo( String name ) { - TypeInfo t = (TypeInfo)dtdCache.get(name); - if(t==null) throw new IllegalArgumentException("Unknown DTD datatype "+name); - return t; - } - - static { - String[] typeNames = new String[]{ - "CDATA", "ID", "IDREF", "IDREFS", "NMTOKEN", "NMTOKENS", - "ENTITY", "ENTITIES", "NOTATION"}; - for( int i=0; i<typeNames.length; i++ ) - dtdCache.put(typeNames[i],new TypeInfoImpl(dtdNamespaceURI,typeNames[i])); - } -} diff --git a/src/com/sun/org/apache/xerces/internal/util/XMLAttributesImpl.java b/src/com/sun/org/apache/xerces/internal/util/XMLAttributesImpl.java index a3b879f..a02d54a 100644 --- a/src/com/sun/org/apache/xerces/internal/util/XMLAttributesImpl.java +++ b/src/com/sun/org/apache/xerces/internal/util/XMLAttributesImpl.java @@ -1,71 +1,30 @@ /* - * reserved comment block - * DO NOT REMOVE OR ALTER! + * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. */ /* - * The Apache Software License, Version 1.1 + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * + * http://www.apache.org/licenses/LICENSE-2.0 * - * Copyright (c) 2000-2002 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Xerces" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation and was - * originally based on software copyright (c) 1999, International - * Business Machines, Inc., http://www.apache.org. For more - * information on the Apache Software Foundation, please see - * <http://www.apache.org/>. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package com.sun.org.apache.xerces.internal.util; -import com.sun.xml.internal.stream.XMLBufferListener; import com.sun.org.apache.xerces.internal.xni.Augmentations; import com.sun.org.apache.xerces.internal.xni.QName; import com.sun.org.apache.xerces.internal.xni.XMLAttributes; import com.sun.org.apache.xerces.internal.xni.XMLString; +import com.sun.xml.internal.stream.XMLBufferListener; /** * The XMLAttributesImpl class is an implementation of the XMLAttributes * interface which defines a collection of attributes for an element. @@ -95,6 +54,12 @@ implements XMLAttributes, XMLBufferListener { /** Default table size. */ protected static final int TABLE_SIZE = 101; + /** Maximum hash collisions per bucket. */ + protected static final int MAX_HASH_COLLISIONS = 40; + + protected static final int MULTIPLIERS_SIZE = 1 << 5; + protected static final int MULTIPLIERS_MASK = MULTIPLIERS_SIZE - 1; + /** * Threshold at which an instance is treated * as a large attribute list. @@ -126,7 +91,6 @@ implements XMLAttributes, XMLBufferListener { protected Attribute[] fAttributes = new Attribute[4]; /** - * Hashtable of attribute information. * Provides an alternate view of the attribute specification. */ protected Attribute[] fAttributeTableView; @@ -149,6 +113,12 @@ implements XMLAttributes, XMLBufferListener { */ protected boolean fIsTableViewConsistent; + /** + * Array of randomly selected hash function multipliers or <code>null</code> + * if the default String.hashCode() function should be used. + */ + protected int[] fHashMultipliers; + // // Constructors // @@ -251,7 +221,8 @@ implements XMLAttributes, XMLBufferListener { * the user of this class adds attributes, removes them, and * then adds more. */ - if (!fIsTableViewConsistent || fLength == SIZE_LIMIT) { + if (!fIsTableViewConsistent || fLength == SIZE_LIMIT || + (fLength > SIZE_LIMIT && fLength > fTableViewBuckets)) { prepareAndPopulateTableView(); fIsTableViewConsistent = true; } @@ -280,12 +251,14 @@ implements XMLAttributes, XMLBufferListener { // We need to check if any of the attributes has the same rawname. else { // Search the table. + int collisionCount = 0; Attribute found = fAttributeTableView[bucket]; while (found != null) { if (found.name.rawname == name.rawname) { break; } found = found.next; + ++collisionCount; } // This attribute is unique. if (found == null) { @@ -299,9 +272,19 @@ implements XMLAttributes, XMLBufferListener { fAttributes = attributes; } - // Update table view - fAttributes[index].next = fAttributeTableView[bucket]; - fAttributeTableView[bucket] = fAttributes[index]; + // Select a new hash function and rehash the table view + // if the collision threshold is exceeded. + if (collisionCount >= MAX_HASH_COLLISIONS) { + // The current attribute will be processed in the rehash. + // Need to set its name first. + fAttributes[index].name.setValues(name); + rebalanceTableView(fLength); + } + else { + // Update table view + fAttributes[index].next = fAttributeTableView[bucket]; + fAttributeTableView[bucket] = fAttributes[index]; + } } // Duplicate. We still need to find the index. else { @@ -807,56 +790,79 @@ implements XMLAttributes, XMLBufferListener { */ public QName checkDuplicatesNS() { // If the list is small check for duplicates using pairwise comparison. - if (fLength <= SIZE_LIMIT) { - for (int i = 0; i < fLength - 1; ++i) { - Attribute att1 = fAttributes[i]; - for (int j = i + 1; j < fLength; ++j) { - Attribute att2 = fAttributes[j]; + final int length = fLength; + if (length <= SIZE_LIMIT) { + final Attribute[] attributes = fAttributes; + for (int i = 0; i < length - 1; ++i) { + Attribute att1 = attributes[i]; + for (int j = i + 1; j < length; ++j) { + Attribute att2 = attributes[j]; if (att1.name.localpart == att2.name.localpart && att1.name.uri == att2.name.uri) { return att2.name; } } } + return null; } // If the list is large check duplicates using a hash table. else { - // We don't want this table view to be read if someone calls - // addAttribute so we invalidate it up front. - fIsTableViewConsistent = false; + return checkManyDuplicatesNS(); + } + } - prepareTableView(); + private QName checkManyDuplicatesNS() { + // We don't want this table view to be read if someone calls + // addAttribute so we invalidate it up front. + fIsTableViewConsistent = false; + + prepareTableView(); + + Attribute attr; + int bucket; - Attribute attr; - int bucket; + final int length = fLength; + final Attribute[] attributes = fAttributes; + final Attribute[] attributeTableView = fAttributeTableView; + final int[] attributeTableViewChainState = fAttributeTableViewChainState; + int largeCount = fLargeCount; - for (int i = fLength - 1; i >= 0; --i) { - attr = fAttributes[i]; - bucket = getTableViewBucket(attr.name.localpart, attr.name.uri); + for (int i = 0; i < length; ++i) { + attr = attributes[i]; + bucket = getTableViewBucket(attr.name.localpart, attr.name.uri); - // The chain is stale. - // This must be a unique attribute. - if (fAttributeTableViewChainState[bucket] != fLargeCount) { - fAttributeTableViewChainState[bucket] = fLargeCount; - attr.next = null; - fAttributeTableView[bucket] = attr; + // The chain is stale. + // This must be a unique attribute. + if (attributeTableViewChainState[bucket] != largeCount) { + attributeTableViewChainState[bucket] = largeCount; + attr.next = null; + attributeTableView[bucket] = attr; + } + // This chain is active. + // We need to check if any of the attributes has the same name. + else { + // Search the table. + int collisionCount = 0; + Attribute found = attributeTableView[bucket]; + while (found != null) { + if (found.name.localpart == attr.name.localpart && + found.name.uri == attr.name.uri) { + return attr.name; + } + found = found.next; + ++collisionCount; + } + // Select a new hash function and rehash the table view + // if the collision threshold is exceeded. + if (collisionCount >= MAX_HASH_COLLISIONS) { + // The current attribute will be processed in the rehash. + rebalanceTableViewNS(i+1); + largeCount = fLargeCount; } - // This chain is active. - // We need to check if any of the attributes has the same name. else { - // Search the table. - Attribute found = fAttributeTableView[bucket]; - while (found != null) { - if (found.name.localpart == attr.name.localpart && - found.name.uri == attr.name.uri) { - return attr.name; - } - found = found.next; - } - // Update table view - attr.next = fAttributeTableView[bucket]; - fAttributeTableView[bucket] = attr; + attr.next = attributeTableView[bucket]; + attributeTableView[bucket] = attr; } } } @@ -911,7 +917,7 @@ implements XMLAttributes, XMLBufferListener { * would be hashed */ protected int getTableViewBucket(String qname) { - return (qname.hashCode() & 0x7FFFFFFF) % fTableViewBuckets; + return (hash(qname) & 0x7FFFFFFF) % fTableViewBuckets; } /** @@ -925,14 +931,37 @@ implements XMLAttributes, XMLBufferListener { */ protected int getTableViewBucket(String localpart, String uri) { if (uri == null) { - return (localpart.hashCode() & 0x7FFFFFFF) % fTableViewBuckets; + return (hash(localpart) & 0x7FFFFFFF) % fTableViewBuckets; } else { - return ((localpart.hashCode() + uri.hashCode()) - & 0x7FFFFFFF) % fTableViewBuckets; + return (hash(localpart, uri) & 0x7FFFFFFF) % fTableViewBuckets; } } + private int hash(String localpart) { + if (fHashMultipliers == null) { + return localpart.hashCode(); + } + return hash0(localpart); + } // hash(String):int + + private int hash(String localpart, String uri) { + if (fHashMultipliers == null) { + return localpart.hashCode() + uri.hashCode() * 31; + } + return hash0(localpart) + hash0(uri) * fHashMultipliers[MULTIPLIERS_SIZE]; + } // hash(String,String):int + + private int hash0(String symbol) { + int code = 0; + final int length = symbol.length(); + final int[] multipliers = fHashMultipliers; + for (int i = 0; i < length; ++i) { + code = code * multipliers[i & MULTIPLIERS_MASK] + symbol.charAt(i); + } + return code; + } // hash0(String):int + /** * Purges all elements from the table view. */ @@ -948,10 +977,32 @@ implements XMLAttributes, XMLBufferListener { } } + /** + * Increases the capacity of the table view. + */ + private void growTableView() { + final int length = fLength; + int tableViewBuckets = fTableViewBuckets; + do { + tableViewBuckets = (tableViewBuckets << 1) + 1; + if (tableViewBuckets < 0) { + tableViewBuckets = Integer.MAX_VALUE; + break; + } + } + while (length > tableViewBuckets); + fTableViewBuckets = tableViewBuckets; + fAttributeTableView = null; + fLargeCount = 1; + } + /** * Prepares the table view of the attributes list for use. */ protected void prepareTableView() { + if (fLength > fTableViewBuckets) { + growTableView(); + } if (fAttributeTableView == null) { fAttributeTableView = new Attribute[fTableViewBuckets]; fAttributeTableViewChainState = new int[fTableViewBuckets]; @@ -967,11 +1018,15 @@ implements XMLAttributes, XMLBufferListener { * previously read. */ protected void prepareAndPopulateTableView() { + prepareAndPopulateTableView(fLength); + } + + private void prepareAndPopulateTableView(final int count) { prepareTableView(); - // Need to populate the hash table with the attributes we've scanned so far. + // Need to populate the hash table with the attributes we've processed so far. Attribute attr; int bucket; - for (int i = 0; i < fLength; ++i) { + for (int i = 0; i < count; ++i) { attr = fAttributes[i]; bucket = getTableViewBucket(attr.name.rawname); if (fAttributeTableViewChainState[bucket] != fLargeCount) { @@ -1135,7 +1190,56 @@ implements XMLAttributes, XMLBufferListener { } } public void refresh(int pos) { + } + + private void prepareAndPopulateTableViewNS(final int count) { + prepareTableView(); + // Need to populate the hash table with the attributes we've processed so far. + Attribute attr; + int bucket; + for (int i = 0; i < count; ++i) { + attr = fAttributes[i]; + bucket = getTableViewBucket(attr.name.localpart, attr.name.uri); + if (fAttributeTableViewChainState[bucket] != fLargeCount) { + fAttributeTableViewChainState[bucket] = fLargeCount; + attr.next = null; + fAttributeTableView[bucket] = attr; + } + else { + // Update table view + attr.next = fAttributeTableView[bucket]; + fAttributeTableView[bucket] = attr; + } + } + } + + /** + * Randomly selects a new hash function and reorganizes the table view + * in order to more evenly distribute its entries. This method is called + * automatically when the number of attributes in one bucket exceeds + * MAX_HASH_COLLISIONS. + */ + private void rebalanceTableView(final int count) { + if (fHashMultipliers == null) { + fHashMultipliers = new int[MULTIPLIERS_SIZE + 1]; + } + PrimeNumberSequenceGenerator.generateSequence(fHashMultipliers); + prepareAndPopulateTableView(count); + } + + /** + * Randomly selects a new hash function and reorganizes the table view + * in order to more evenly distribute its entries. This method is called + * automatically when the number of attributes in one bucket exceeds + * MAX_HASH_COLLISIONS. + */ + private void rebalanceTableViewNS(final int count) { + if (fHashMultipliers == null) { + fHashMultipliers = new int[MULTIPLIERS_SIZE + 1]; } + PrimeNumberSequenceGenerator.generateSequence(fHashMultipliers); + prepareAndPopulateTableViewNS(count); + } // // Classes diff --git a/src/com/sun/org/apache/xerces/internal/utils/XMLLimitAnalyzer.java b/src/com/sun/org/apache/xerces/internal/utils/XMLLimitAnalyzer.java index e8e723a..b2460d9 100644 --- a/src/com/sun/org/apache/xerces/internal/utils/XMLLimitAnalyzer.java +++ b/src/com/sun/org/apache/xerces/internal/utils/XMLLimitAnalyzer.java @@ -1,7 +1,7 @@ /* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. * - * Copyright (c) 2013 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. * * The contents of this file are subject to the terms of either the GNU * General Public License Version 2 only ("GPL") or the Common Development @@ -128,18 +128,21 @@ public final class XMLLimitAnalyzer { public void addValue(int index, String entityName, int value) { if (index == Limit.ENTITY_EXPANSION_LIMIT.ordinal() || index == Limit.MAX_OCCUR_NODE_LIMIT.ordinal() || - index == Limit.ELEMENT_ATTRIBUTE_LIMIT.ordinal()) { + index == Limit.ELEMENT_ATTRIBUTE_LIMIT.ordinal() || + index == Limit.TOTAL_ENTITY_SIZE_LIMIT.ordinal() + ) { totalValue[index] += value; return; } - if (index == Limit.MAX_ELEMENT_DEPTH_LIMIT.ordinal()) { + if (index == Limit.MAX_ELEMENT_DEPTH_LIMIT.ordinal() || + index == Limit.MAX_NAME_LIMIT.ordinal()) { totalValue[index] = value; return; } Map<String, Integer> cache; if (caches[index] == null) { - cache = new HashMap<String, Integer>(10); + cache = new HashMap<>(10); caches[index] = cache; } else { cache = caches[index]; @@ -147,10 +150,10 @@ public final class XMLLimitAnalyzer { int accumulatedValue = value; if (cache.containsKey(entityName)) { - accumulatedValue += cache.get(entityName).intValue(); - cache.put(entityName, Integer.valueOf(accumulatedValue)); + accumulatedValue += cache.get(entityName); + cache.put(entityName, accumulatedValue); } else { - cache.put(entityName, Integer.valueOf(value)); + cache.put(entityName, value); } if (accumulatedValue > values[index]) { @@ -223,6 +226,16 @@ public final class XMLLimitAnalyzer { } } + /** + * Resets the current value of the specified limit. + * @param limit The limit to be reset. + */ + public void reset(Limit limit) { + if (limit.ordinal() == Limit.TOTAL_ENTITY_SIZE_LIMIT.ordinal()) { + totalValue[limit.ordinal()] = 0; + } + } + public void debugPrint(XMLSecurityManager securityManager) { Formatter formatter = new Formatter(); System.out.println(formatter.format("%30s %15s %15s %15s %30s", diff --git a/src/com/sun/org/apache/xerces/internal/utils/XMLSecurityManager.java b/src/com/sun/org/apache/xerces/internal/utils/XMLSecurityManager.java index 1b2911f..7ae6df9 100644 --- a/src/com/sun/org/apache/xerces/internal/utils/XMLSecurityManager.java +++ b/src/com/sun/org/apache/xerces/internal/utils/XMLSecurityManager.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -61,20 +61,31 @@ public final class XMLSecurityManager { */ public static enum Limit { - ENTITY_EXPANSION_LIMIT(Constants.JDK_ENTITY_EXPANSION_LIMIT, Constants.SP_ENTITY_EXPANSION_LIMIT, 0, 64000), - MAX_OCCUR_NODE_LIMIT(Constants.JDK_MAX_OCCUR_LIMIT, Constants.SP_MAX_OCCUR_LIMIT, 0, 5000), - ELEMENT_ATTRIBUTE_LIMIT(Constants.JDK_ELEMENT_ATTRIBUTE_LIMIT, Constants.SP_ELEMENT_ATTRIBUTE_LIMIT, 0, 10000), - TOTAL_ENTITY_SIZE_LIMIT(Constants.JDK_TOTAL_ENTITY_SIZE_LIMIT, Constants.SP_TOTAL_ENTITY_SIZE_LIMIT, 0, 50000000), - GENERAL_ENTITY_SIZE_LIMIT(Constants.JDK_GENERAL_ENTITY_SIZE_LIMIT, Constants.SP_GENERAL_ENTITY_SIZE_LIMIT, 0, 0), - PARAMETER_ENTITY_SIZE_LIMIT(Constants.JDK_PARAMETER_ENTITY_SIZE_LIMIT, Constants.SP_PARAMETER_ENTITY_SIZE_LIMIT, 0, 1000000), - MAX_ELEMENT_DEPTH_LIMIT(Constants.JDK_MAX_ELEMENT_DEPTH, Constants.SP_MAX_ELEMENT_DEPTH, 0, 0); - + ENTITY_EXPANSION_LIMIT("EntityExpansionLimit", + Constants.JDK_ENTITY_EXPANSION_LIMIT, Constants.SP_ENTITY_EXPANSION_LIMIT, 0, 64000), + MAX_OCCUR_NODE_LIMIT("MaxOccurLimit", + Constants.JDK_MAX_OCCUR_LIMIT, Constants.SP_MAX_OCCUR_LIMIT, 0, 5000), + ELEMENT_ATTRIBUTE_LIMIT("ElementAttributeLimit", + Constants.JDK_ELEMENT_ATTRIBUTE_LIMIT, Constants.SP_ELEMENT_ATTRIBUTE_LIMIT, 0, 10000), + TOTAL_ENTITY_SIZE_LIMIT("TotalEntitySizeLimit", + Constants.JDK_TOTAL_ENTITY_SIZE_LIMIT, Constants.SP_TOTAL_ENTITY_SIZE_LIMIT, 0, 50000000), + GENERAL_ENTITY_SIZE_LIMIT("MaxEntitySizeLimit", + Constants.JDK_GENERAL_ENTITY_SIZE_LIMIT, Constants.SP_GENERAL_ENTITY_SIZE_LIMIT, 0, 0), + PARAMETER_ENTITY_SIZE_LIMIT("MaxEntitySizeLimit", + Constants.JDK_PARAMETER_ENTITY_SIZE_LIMIT, Constants.SP_PARAMETER_ENTITY_SIZE_LIMIT, 0, 1000000), + MAX_ELEMENT_DEPTH_LIMIT("MaxElementDepthLimit", + Constants.JDK_MAX_ELEMENT_DEPTH, Constants.SP_MAX_ELEMENT_DEPTH, 0, 0), + MAX_NAME_LIMIT("MaxXMLNameLimit", + Constants.JDK_XML_NAME_LIMIT, Constants.SP_XML_NAME_LIMIT, 1000, 1000); + + final String key; final String apiProperty; final String systemProperty; final int defaultValue; final int secureValue; - Limit(String apiProperty, String systemProperty, int value, int secureValue) { + Limit(String key, String apiProperty, String systemProperty, int value, int secureValue) { + this.key = key; this.apiProperty = apiProperty; this.systemProperty = systemProperty; this.defaultValue = value; @@ -89,6 +100,10 @@ public final class XMLSecurityManager { return (propertyName == null) ? false : systemProperty.equals(propertyName); } + public String key() { + return key; + } + public String apiProperty() { return apiProperty; } @@ -97,7 +112,7 @@ public final class XMLSecurityManager { return systemProperty; } - int defaultValue() { + public int defaultValue() { return defaultValue; } @@ -152,7 +167,7 @@ public final class XMLSecurityManager { /** * Index of the special entityCountInfo property */ - private int indexEntityCountInfo = 10000; + private final int indexEntityCountInfo = 10000; private String printEntityCountInfo = ""; /** @@ -433,7 +448,9 @@ public final class XMLSecurityManager { if (index == Limit.ELEMENT_ATTRIBUTE_LIMIT.ordinal() || index == Limit.ENTITY_EXPANSION_LIMIT.ordinal() || index == Limit.TOTAL_ENTITY_SIZE_LIMIT.ordinal() || - index == Limit.MAX_ELEMENT_DEPTH_LIMIT.ordinal()) { + index == Limit.MAX_ELEMENT_DEPTH_LIMIT.ordinal() || + index == Limit.MAX_NAME_LIMIT.ordinal() + ) { return (limitAnalyzer.getTotalValue(index) > values[index]); } else { return (limitAnalyzer.getValue(index) > values[index]); diff --git a/src/com/sun/org/apache/xerces/internal/utils/XMLSecurityPropertyManager.java b/src/com/sun/org/apache/xerces/internal/utils/XMLSecurityPropertyManager.java index 4286f04..43326e1 100644 --- a/src/com/sun/org/apache/xerces/internal/utils/XMLSecurityPropertyManager.java +++ b/src/com/sun/org/apache/xerces/internal/utils/XMLSecurityPropertyManager.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/src/com/sun/org/apache/xerces/internal/xni/parser/XMLDTDScanner.java b/src/com/sun/org/apache/xerces/internal/xni/parser/XMLDTDScanner.java index 49dea56..189152d 100644 --- a/src/com/sun/org/apache/xerces/internal/xni/parser/XMLDTDScanner.java +++ b/src/com/sun/org/apache/xerces/internal/xni/parser/XMLDTDScanner.java @@ -96,5 +96,14 @@ public interface XMLDTDScanner public boolean scanDTDExternalSubset(boolean complete) throws IOException, XNIException; + /** + * Skip the DTD if javax.xml.stream.supportDTD is false. + * @param supportDTD The value of the property javax.xml.stream.supportDTD. + * @return true if DTD is skipped, false otherwise. + * @throws java.io.IOException if i/o error occurs + */ + public boolean skipDTD(boolean supportDTD) + throws IOException; + public void setLimitAnalyzer(XMLLimitAnalyzer limitAnalyzer); } // interface XMLDTDScanner |