/hg/release/icedtea7-forest-2.6/jaxp: 6 new changesets
andrew at icedtea.classpath.org
andrew at icedtea.classpath.org
Thu Jul 21 16:01:25 UTC 2016
changeset 25c29801f4c8 in /hg/release/icedtea7-forest-2.6/jaxp
details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.6/jaxp?cmd=changeset;node=25c29801f4c8
author: andrew
date: Wed Jul 20 04:00:42 2016 +0100
Added tag icedtea-2.6.7pre01 for changeset 81a6bae36120
changeset 023fdb2f8ee2 in /hg/release/icedtea7-forest-2.6/jaxp
details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.6/jaxp?cmd=changeset;node=023fdb2f8ee2
author: aefimov
date: Fri Jul 08 04:17:27 2016 +0100
8148872: Complete name checking
Reviewed-by: dfuchs, lancea, ahgross
changeset f968b06f80c6 in /hg/release/icedtea7-forest-2.6/jaxp
details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.6/jaxp?cmd=changeset;node=f968b06f80c6
author: aefimov
date: Fri Jul 08 05:10:10 2016 +0100
8149962: Better delineation of XML processing
Reviewed-by: dfuchs, lancea, ahgross
changeset be2127cf0435 in /hg/release/icedtea7-forest-2.6/jaxp
details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.6/jaxp?cmd=changeset;node=be2127cf0435
author: asaha
date: Fri Jul 08 05:22:05 2016 +0100
8157077: 8u101 L10n resource file updates
Summary: 8u101 L10n resource file updates
Reviewed-by: coffeys
Contributed-by: li.jiang at oracle.com
changeset cd13b280e824 in /hg/release/icedtea7-forest-2.6/jaxp
details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.6/jaxp?cmd=changeset;node=cd13b280e824
author: andrew
date: Wed Jul 20 04:05:04 2016 +0100
Added tag jdk7u111-b00 for changeset be2127cf0435
changeset 74815983d3ea in /hg/release/icedtea7-forest-2.6/jaxp
details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.6/jaxp?cmd=changeset;node=74815983d3ea
author: andrew
date: Wed Jul 20 05:26:15 2016 +0100
Merge jdk7u111-b00
diffstat:
.hgtags | 2 +
src/com/sun/org/apache/xalan/internal/XalanConstants.java | 15 +
src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_zh_TW.java | 2 +-
src/com/sun/org/apache/xalan/internal/utils/XMLSecurityManager.java | 6 +-
src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_zh_TW.java | 2 +-
src/com/sun/org/apache/xerces/internal/impl/Constants.java | 17 +-
src/com/sun/org/apache/xerces/internal/impl/XML11DTDScannerImpl.java | 71 +--
src/com/sun/org/apache/xerces/internal/impl/XML11DocumentScannerImpl.java | 154 +----
src/com/sun/org/apache/xerces/internal/impl/XML11EntityScanner.java | 192 +++----
src/com/sun/org/apache/xerces/internal/impl/XML11NSDocumentScannerImpl.java | 57 +-
src/com/sun/org/apache/xerces/internal/impl/XMLDTDScannerImpl.java | 211 +++-----
src/com/sun/org/apache/xerces/internal/impl/XMLDocumentFragmentScannerImpl.java | 124 ++--
src/com/sun/org/apache/xerces/internal/impl/XMLDocumentScannerImpl.java | 38 +-
src/com/sun/org/apache/xerces/internal/impl/XMLEntityScanner.java | 237 ++++++--
src/com/sun/org/apache/xerces/internal/impl/XMLNSDocumentScannerImpl.java | 37 +-
src/com/sun/org/apache/xerces/internal/impl/XMLScanner.java | 244 ++++++---
src/com/sun/org/apache/xerces/internal/impl/XMLVersionDetector.java | 84 +--
src/com/sun/org/apache/xerces/internal/impl/msg/DatatypeMessages_zh_TW.properties | 4 +-
src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages.properties | 3 +-
src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_de.properties | 3 +-
src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_es.properties | 3 +-
src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_fr.properties | 3 +-
src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_it.properties | 3 +-
src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_ja.properties | 1 +
src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_ko.properties | 3 +-
src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_pt_BR.properties | 3 +-
src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_sv.properties | 3 +-
src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_zh_CN.properties | 3 +-
src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_zh_TW.properties | 10 +-
src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_zh_TW.properties | 2 +-
src/com/sun/org/apache/xerces/internal/utils/XMLLimitAnalyzer.java | 16 +-
src/com/sun/org/apache/xerces/internal/utils/XMLSecurityManager.java | 7 +-
src/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_de.java | 4 +-
33 files changed, 782 insertions(+), 782 deletions(-)
diffs (truncated from 4052 to 500 lines):
diff -r 81a6bae36120 -r 74815983d3ea .hgtags
--- a/.hgtags Wed Jun 01 02:06:50 2016 +0100
+++ b/.hgtags Wed Jul 20 05:26:15 2016 +0100
@@ -657,3 +657,5 @@
5ab0648fce587283f45235377a07720aec742e7b icedtea-2.6.6pre01
dcdbebfaf4b42da4927d3d0c682205a23cd7cdb8 jdk7u101-b00
683427778edf23bb16f6685a58e35d937d16f83d icedtea-2.6.6
+81a6bae36120086e865b83c3a6e282b1ea33cc39 icedtea-2.6.7pre01
+be2127cf0435d141d8072a94dbe75a527ceda453 jdk7u111-b00
diff -r 81a6bae36120 -r 74815983d3ea src/com/sun/org/apache/xalan/internal/XalanConstants.java
--- a/src/com/sun/org/apache/xalan/internal/XalanConstants.java Wed Jun 01 02:06:50 2016 +0100
+++ b/src/com/sun/org/apache/xalan/internal/XalanConstants.java Wed Jul 20 05:26:15 2016 +0100
@@ -81,6 +81,14 @@
*/
public static final String JDK_GENEAL_ENTITY_SIZE_LIMIT =
ORACLE_JAXP_PROPERTY_PREFIX + "maxGeneralEntitySizeLimit";
+
+ /**
+ * JDK node count limit in entities that limits the total number of nodes
+ * in all of entity references.
+ */
+ public static final String JDK_ENTITY_REPLACEMENT_LIMIT =
+ ORACLE_JAXP_PROPERTY_PREFIX + "entityReplacementLimit";
+
/**
* JDK maximum parameter entity size limit
*/
@@ -137,6 +145,13 @@
* JDK maximum general entity size limit
*/
public static final String SP_GENEAL_ENTITY_SIZE_LIMIT = "jdk.xml.maxGeneralEntitySizeLimit";
+
+ /**
+ * JDK node count limit in entities that limits the total number of nodes
+ * in all of entity references.
+ */
+ public static final String SP_ENTITY_REPLACEMENT_LIMIT = "jdk.xml.entityReplacementLimit";
+
/**
* JDK maximum parameter entity size limit
*/
diff -r 81a6bae36120 -r 74815983d3ea src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_zh_TW.java
--- a/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_zh_TW.java Wed Jun 01 02:06:50 2016 +0100
+++ b/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_zh_TW.java Wed Jul 20 05:26:15 2016 +0100
@@ -1268,7 +1268,7 @@
"\u627E\u4E0D\u5230\u5341\u9032\u4F4D\u683C\u5F0F\u7684\u5BA3\u544A: {0}"},
{ WG_OLD_XSLT_NS,
- "\u907A\u6F0F\u6216\u4E0D\u6B63\u78BA\u7684 XSLT \u547D\u540D\u7A7A\u9593\u3002 "},
+ "\u907A\u6F0F\u6216\u4E0D\u6B63\u78BA\u7684 XSLT \u547D\u540D\u7A7A\u9593\u3002"},
{ WG_ONE_DEFAULT_XSLDECIMALFORMAT_ALLOWED,
"\u53EA\u5141\u8A31\u4E00\u500B\u9810\u8A2D\u7684 xsl:decimal-format \u5BA3\u544A\u3002"},
diff -r 81a6bae36120 -r 74815983d3ea src/com/sun/org/apache/xalan/internal/utils/XMLSecurityManager.java
--- a/src/com/sun/org/apache/xalan/internal/utils/XMLSecurityManager.java Wed Jun 01 02:06:50 2016 +0100
+++ b/src/com/sun/org/apache/xalan/internal/utils/XMLSecurityManager.java Wed Jul 20 05:26:15 2016 +0100
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2016, 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
@@ -80,7 +80,9 @@
MAX_ELEMENT_DEPTH_LIMIT("MaxElementDepthLimit", XalanConstants.JDK_MAX_ELEMENT_DEPTH,
XalanConstants.SP_MAX_ELEMENT_DEPTH, 0, 0),
MAX_NAME_LIMIT("MaxXMLNameLimit", XalanConstants.JDK_XML_NAME_LIMIT,
- XalanConstants.SP_XML_NAME_LIMIT, 1000, 1000);
+ XalanConstants.SP_XML_NAME_LIMIT, 1000, 1000),
+ ENTITY_REPLACEMENT_LIMIT("EntityReplacementLimit", XalanConstants.JDK_ENTITY_REPLACEMENT_LIMIT,
+ XalanConstants.SP_ENTITY_REPLACEMENT_LIMIT, 0, 3000000);
final String key;
final String apiProperty;
diff -r 81a6bae36120 -r 74815983d3ea src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_zh_TW.java
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_zh_TW.java Wed Jun 01 02:06:50 2016 +0100
+++ b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_zh_TW.java Wed Jul 20 05:26:15 2016 +0100
@@ -685,7 +685,7 @@
* documentation.
*/
{ErrorMsg.COMPILE_USAGE_STR,
- "\u6982\u8981\n java com.sun.org.apache.xalan.internal.xsltc.cmdline.Compile [-o <output>]\n [-d <directory>] [-j <jarfile>] [-p <package>]\n [-n] [-x] [-u] [-v] [-h] { <stylesheet> | -i }\n\n\u9078\u9805\n -o <output> \u6307\u6D3E\u540D\u7A31 <output> \u81F3\u7522\u751F\u7684\n translet\u3002\u6839\u64DA\u9810\u8A2D\uFF0Ctranslet \u540D\u7A31\n \u884D\u751F\u81EA <stylesheet> \u540D\u7A31\u3002 \u82E5\u7DE8\u8B6F\n \u591A\u500B\u6A23\u5F0F\u8868\uFF0C\u5C07\u5FFD\u7565\u6B64\u9078\u9805\u3002\n -d <directory> \u6307\u5B9A translet \u7684\u76EE\u7684\u5730\u76EE\u9304\n -j <jarfile> \u5C01\u88DD translet \u985E\u5225\u6210\u70BA jar \u6A94\u6848\uFF0C\n \u540D\u7A31\u6307\u5B9A\u70BA <jarfile>\n -p <package> \u6307\u5B9A\u6240\u6709\u7522\u751F\u7684 translet \u985E\u5225\u7684\u5957\u88DD\u7A0B\u5F0F\n \u540D\u7A31\u524D\u7F6E\u78BC\u3002\n -n \u555F\u7528\u6A23\u677F\u5167\u5D4C (\u9810\u8A2D\u884C\u70BA\u4E00\u822C\u800C\u8A00\n \u8F03\u4F73)\u3002\n -x \u958B\u555F\u984D\u5916\u7684\u9664\u932F\u8A0A\u606F\u8F38\u51FA\n -u \u89E3\u8B6F <stylesheet> \u5F15\u6578\u70BA URL\n -i \u5F37\u5236\u7DE8\u8B6F\u5668\u5F9E stdin \u8B80\u53D6\u6A23\u5F0F\u8868\n -v \u5217\u5370\u7DE8\u8B6F\u5668\u7248\u672C\n -h \u5217\u5370\u6B64\u7528\u6CD5\u6558\u8FF0\n"},
+ "\u6982\u8981\n java com.sun.org.apache.xalan.internal.xsltc.cmdline.Compile [-o <output>]\n [-d <directory>] [-j <jarfile>] [-p <package>]\n [-n] [-x] [-u] [-v] [-h] { <stylesheet> | -i }\n\n\u9078\u9805\n -o <output> \u6307\u6D3E\u540D\u7A31 <output> \u81F3\u7522\u751F\u7684\n translet\u3002\u6839\u64DA\u9810\u8A2D\uFF0Ctranslet \u540D\u7A31\n \u884D\u751F\u81EA <stylesheet> \u540D\u7A31\u3002\u82E5\u7DE8\u8B6F\n \u591A\u500B\u6A23\u5F0F\u8868\uFF0C\u5C07\u5FFD\u7565\u6B64\u9078\u9805\u3002\n -d <directory> \u6307\u5B9A translet \u7684\u76EE\u7684\u5730\u76EE\u9304\n -j <jarfile> \u5C01\u88DD translet \u985E\u5225\u6210\u70BA jar \u6A94\u6848\uFF0C\n \u540D\u7A31\u6307\u5B9A\u70BA <jarfile>\n -p <package> \u6307\u5B9A\u6240\u6709\u7522\u751F\u7684 translet \u985E\u5225\u7684\u5957\u88DD\u7A0B\u5F0F\n \u540D\u7A31\u524D\u7F6E\u78BC\u3002\n -n \u555F\u7528\u6A23\u677F\u5167\u5D4C (\u9810\u8A2D\u884C\u70BA\u4E00\u822C\u800C\u8A00\n \u8F03\u4F73)\u3002\n -x \u958B\u555F\u984D\u5916\u7684\u9664\u932F\u8A0A\u606F\u8F38\u51FA\n -u \u89E3\u8B6F <stylesheet> \u5F15\u6578\u70BA URL\n -i \u5F37\u5236\u7DE8\u8B6F\u5668\u5F9E stdin \u8B80\u53D6\u6A23\u5F0F\u8868\n -v \u5217\u5370\u7DE8\u8B6F\u5668\u7248\u672C\n -h \u5217\u5370\u6B64\u7528\u6CD5\u6558\u8FF0\n"},
/*
* Note to translators: This message contains usage information for a
diff -r 81a6bae36120 -r 74815983d3ea src/com/sun/org/apache/xerces/internal/impl/Constants.java
--- a/src/com/sun/org/apache/xerces/internal/impl/Constants.java Wed Jun 01 02:06:50 2016 +0100
+++ b/src/com/sun/org/apache/xerces/internal/impl/Constants.java Wed Jul 20 05:26:15 2016 +0100
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
*/
/*
@@ -242,6 +242,14 @@
*/
public static final String JDK_GENEAL_ENTITY_SIZE_LIMIT =
ORACLE_JAXP_PROPERTY_PREFIX + "maxGeneralEntitySizeLimit";
+
+ /**
+ * JDK node count limit in entities that limits the total number of nodes
+ * in all of entity references.
+ */
+ public static final String JDK_ENTITY_REPLACEMENT_LIMIT =
+ ORACLE_JAXP_PROPERTY_PREFIX + "entityReplacementLimit";
+
/**
* JDK maximum parameter entity size limit
*/
@@ -295,6 +303,13 @@
* JDK maximum general entity size limit
*/
public static final String SP_GENEAL_ENTITY_SIZE_LIMIT = "jdk.xml.maxGeneralEntitySizeLimit";
+
+ /**
+ * JDK node count limit in entities that limits the total number of nodes
+ * in all of entity references.
+ */
+ public static final String SP_ENTITY_REPLACEMENT_LIMIT = "jdk.xml.entityReplacementLimit";
+
/**
* JDK maximum parameter entity size limit
*/
diff -r 81a6bae36120 -r 74815983d3ea src/com/sun/org/apache/xerces/internal/impl/XML11DTDScannerImpl.java
--- a/src/com/sun/org/apache/xerces/internal/impl/XML11DTDScannerImpl.java Wed Jun 01 02:06:50 2016 +0100
+++ b/src/com/sun/org/apache/xerces/internal/impl/XML11DTDScannerImpl.java Wed Jul 20 05:26:15 2016 +0100
@@ -1,62 +1,21 @@
/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
+ * Copyright (c) 2016, 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 at 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;
@@ -156,7 +115,7 @@
protected boolean scanPubidLiteral(XMLString literal)
throws IOException, XNIException
{
- int quote = fEntityScanner.scanChar();
+ int quote = fEntityScanner.scanChar(null);
if (quote != '\'' && quote != '"') {
reportFatalError("QuoteRequiredInPublicID", null);
return false;
@@ -167,7 +126,7 @@
boolean skipSpace = true;
boolean dataok = true;
while (true) {
- int c = fEntityScanner.scanChar();
+ int c = fEntityScanner.scanChar(null);
// REVISIT: it could really only be \n or 0x20; all else is normalized, no? - neilg
if (c == ' ' || c == '\n' || c == '\r' || c == 0x85 || c == 0x2028) {
if (!skipSpace) {
diff -r 81a6bae36120 -r 74815983d3ea src/com/sun/org/apache/xerces/internal/impl/XML11DocumentScannerImpl.java
--- a/src/com/sun/org/apache/xerces/internal/impl/XML11DocumentScannerImpl.java Wed Jun 01 02:06:50 2016 +0100
+++ b/src/com/sun/org/apache/xerces/internal/impl/XML11DocumentScannerImpl.java Wed Jul 20 05:26:15 2016 +0100
@@ -1,74 +1,32 @@
/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
+ * Copyright (c) 2016, 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 at 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.io.IOException;
-
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.xni.XMLString;
import com.sun.org.apache.xerces.internal.xni.XNIException;
+import java.io.IOException;
/**
* This class is responsible for scanning XML document structure
@@ -135,7 +93,7 @@
// happens when there is the character reference
// but scanContent doesn't do entity expansions...
// is this *really* necessary??? - NG
- fEntityScanner.scanChar();
+ fEntityScanner.scanChar(null);
content.append((char)c);
c = -1;
}
@@ -144,7 +102,7 @@
} */
if (c == ']') {
- content.append((char)fEntityScanner.scanChar());
+ content.append((char)fEntityScanner.scanChar(null));
// remember where we are in case we get an endEntity before we
// could flush the buffer out - this happens when we're parsing an
// entity which ends with a ]
@@ -153,12 +111,12 @@
// We work on a single character basis to handle cases such as:
// ']]]>' which we might otherwise miss.
//
- if (fEntityScanner.skipChar(']')) {
+ if (fEntityScanner.skipChar(']', null)) {
content.append(']');
- while (fEntityScanner.skipChar(']')) {
+ while (fEntityScanner.skipChar(']', null)) {
content.append(']');
}
- if (fEntityScanner.skipChar('>')) {
+ if (fEntityScanner.skipChar('>', null)) {
reportFatalError("CDEndInContent", null);
}
}
@@ -185,6 +143,7 @@
* @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.
+ * @param isNSURI The flag indicating whether the content is a namespace URI
*
* @return true if the non-normalized and normalized value are the same
*
@@ -194,7 +153,7 @@
protected boolean scanAttributeValue(XMLString value,
XMLString nonNormalizedValue,
String atName,
- boolean checkEntities,String eleName)
+ boolean checkEntities,String eleName, boolean isNSURI)
throws IOException, XNIException
{
// quote
@@ -203,10 +162,10 @@
reportFatalError("OpenQuoteExpected", new Object[]{eleName,atName});
}
- fEntityScanner.scanChar();
+ fEntityScanner.scanChar(NameType.ATTRIBUTE);
int entityDepth = fEntityDepth;
- int c = fEntityScanner.scanLiteral(quote, value);
+ int c = fEntityScanner.scanLiteral(quote, value, isNSURI);
if (DEBUG_ATTR_NORMALIZATION) {
System.out.println("** scanLiteral -> \""
+ value.toString() + "\"");
@@ -216,7 +175,7 @@
if (c == quote && (fromIndex = isUnchangedByNormalization(value)) == -1) {
/** Both the non-normalized and normalized attribute values are equal. **/
nonNormalizedValue.setValues(value);
- int cquote = fEntityScanner.scanChar();
+ int cquote = fEntityScanner.scanChar(NameType.ATTRIBUTE);
if (cquote != quote) {
reportFatalError("CloseQuoteExpected", new Object[]{eleName,atName});
}
@@ -239,11 +198,11 @@
+ fStringBuffer.toString() + "\"");
}
if (c == '&') {
- fEntityScanner.skipChar('&');
+ fEntityScanner.skipChar('&', NameType.REFERENCE);
if (entityDepth == fEntityDepth) {
fStringBuffer2.append('&');
}
- if (fEntityScanner.skipChar('#')) {
+ if (fEntityScanner.skipChar('#', NameType.REFERENCE)) {
if (entityDepth == fEntityDepth) {
fStringBuffer2.append('#');
}
@@ -257,59 +216,22 @@
}
}
else {
- String entityName = fEntityScanner.scanName();
+ String entityName = fEntityScanner.scanName(NameType.REFERENCE);
if (entityName == null) {
reportFatalError("NameRequiredInReference", null);
}
else if (entityDepth == fEntityDepth) {
fStringBuffer2.append(entityName);
}
- if (!fEntityScanner.skipChar(';')) {
+ if (!fEntityScanner.skipChar(';', NameType.REFERENCE)) {
reportFatalError("SemicolonRequiredInReference",
new Object []{entityName});
}
else if (entityDepth == fEntityDepth) {
fStringBuffer2.append(';');
}
- if (entityName == fAmpSymbol) {
- fStringBuffer.append('&');
- if (DEBUG_ATTR_NORMALIZATION) {
- System.out.println("** value5: \""
- + fStringBuffer.toString()
- + "\"");
- }
- }
- else if (entityName == fAposSymbol) {
- fStringBuffer.append('\'');
- if (DEBUG_ATTR_NORMALIZATION) {
- System.out.println("** value7: \""
- + fStringBuffer.toString()
- + "\"");
- }
- }
- else if (entityName == fLtSymbol) {
- fStringBuffer.append('<');
- if (DEBUG_ATTR_NORMALIZATION) {
- System.out.println("** value9: \""
- + fStringBuffer.toString()
- + "\"");
- }
- }
- else if (entityName == fGtSymbol) {
- fStringBuffer.append('>');
- if (DEBUG_ATTR_NORMALIZATION) {
- System.out.println("** valueB: \""
- + fStringBuffer.toString()
- + "\"");
- }
- }
- else if (entityName == fQuotSymbol) {
- fStringBuffer.append('"');
- if (DEBUG_ATTR_NORMALIZATION) {
- System.out.println("** valueD: \""
- + fStringBuffer.toString()
- + "\"");
- }
+ if (resolveCharacter(entityName, fStringBuffer)) {
+ checkEntityLimit(false, fEntityScanner.fCurrentEntity.name, 1);
}
else {
if (fEntityManager.isExternalEntity(entityName)) {
@@ -340,13 +262,13 @@
else if (c == '<') {
reportFatalError("LessthanInAttValue",
new Object[] { eleName, atName });
- fEntityScanner.scanChar();
+ fEntityScanner.scanChar(null);
if (entityDepth == fEntityDepth) {
fStringBuffer2.append((char)c);
}
}
else if (c == '%' || c == ']') {
- fEntityScanner.scanChar();
+ fEntityScanner.scanChar(null);
fStringBuffer.append((char)c);
if (entityDepth == fEntityDepth) {
fStringBuffer2.append((char)c);
@@ -360,7 +282,7 @@
// XML11EntityScanner. Not sure why
// this check was originally necessary. - NG
else if (c == '\n' || c == '\r' || c == 0x85 || c == 0x2028) {
- fEntityScanner.scanChar();
+ fEntityScanner.scanChar(null);
fStringBuffer.append(' ');
if (entityDepth == fEntityDepth) {
fStringBuffer2.append('\n');
@@ -383,12 +305,12 @@
else if (c != -1 && isInvalidLiteral(c)) {
reportFatalError("InvalidCharInAttValue",
new Object[] {eleName, atName, Integer.toString(c, 16)});
- fEntityScanner.scanChar();
+ fEntityScanner.scanChar(null);
if (entityDepth == fEntityDepth) {
fStringBuffer2.append((char)c);
}
}
More information about the distro-pkg-dev
mailing list