Merged changes from default
--HG--
branch : 8u40-verified-fixes
diff --git a/.hgtags b/.hgtags
index 23bc9f6..e597e34 100644
--- a/.hgtags
+++ b/.hgtags
@@ -336,6 +336,8 @@
7a721e57b38ff6c1d34af0b86f6482540a815d90 jdk8u25-b17
fddbc00bde281d7d437b052262e921ed51de8b9a jdk8u25-b18
30420a31a81f21e363f412ae9801b7467c8cc908 jdk8u25-b31
+b4231e682f98c8f7037e00fe6ef446d05a01811b jdk8u25-b32
+1c17ffddb76625e835d225c84a8c6ff23c1e5729 jdk8u25-b33
19b6e16343925a4bf27879795b530d4f64e5d262 jdk8u31-b00
469792d179304c9b3218930112547577e1aecb77 jdk8u31-b01
adbd3e31ef1a95b3f80a77dfbb843d52c053c6d3 jdk8u31-b02
@@ -350,6 +352,10 @@
f475dbc70345904bda6b520af43955e244292886 jdk8u31-b11
6563e438377f2086253577e08593b1ddfb901eff jdk8u31-b12
1dd828fd98f1b84de5dcadb904322b711e7489ff jdk8u31-b13
+dcc563c9db9ef290a0783378d43a039cd92a08e3 jdk8u31-b31
+119f4ae3151f4134a5e62034e66a4c17f524838b jdk8u31-b32
+d8a594fd8507343dc23fa18c01b17c96fced47fd jdk8u31-b33
+68f0cd7d60d45df8e4b73a85e31a16aa025d9278 jdk8u31-b34
3a1bba8076da4e54882123e98e219eab1c31ccef jdk8u40-b00
f219da378d0768ff042d77221e5d20676ecc16f0 jdk8u40-b01
16ef2134c32a4e60b5a60105b371163aa5936278 jdk8u40-b02
@@ -378,3 +384,154 @@
4c0d4c38279c5790aa5b61b03c4cfa9b2a58bc72 jdk8u40-b25
f693ef62c207dd0290957c95bd62ab653afe4626 jdk8u40-b26
56f6ca79467d04eb95383102046836b6ac7d2811 jdk8u40-b27
+7e43d4e20a33b8b6bd06112e39d367b51de921a7 jdk8u40-b31
+8facbe662ec106f1aae271f5c59909e124938c40 jdk8u40-b32
+9286acc600a779acb8bcfab38e82d4f50704afe3 jdk8u45-b00
+9fded65e1d36e3388111955d50ebf8511dd0345e jdk8u45-b01
+62566a3dbe5982565ce3e468ee3980b7937a86cc jdk8u45-b02
+629096783c27510c656229b1adc7fb180cada9c6 jdk8u45-b03
+85585012b976b72665f8f7740526bde25ccc62e4 jdk8u45-b04
+da025bade645f0d1e0ef2f825320bd5af0c23eba jdk8u45-b05
+49bc5472ded41c77dabb0840d385cbee1d60d8e9 jdk8u45-b06
+061930bd7d8fc2f05042e7eeb32adff1759c6d62 jdk8u45-b07
+50fba38f3a29f55baaae2da9b392bf9abc8389c1 jdk8u45-b08
+f893d8b9a0d148951014610b1aab2ba0a5105dfe jdk8u45-b09
+4de18a629048b90e0d875b9c0bd31800f1cc02ae jdk8u45-b10
+d4042340fe0aa9d33a161890e179bc21b6c7b8e6 jdk8u45-b11
+91d1102264e9b58b2ada4b5f112d472f0d86092b jdk8u45-b12
+a15025742f201f05ead3d731780a4ad437524491 jdk8u45-b13
+e0167ec9d7596ab9ac52a8c3b85c1aef5d3fbd92 jdk8u45-b14
+bf813e10d0bac17866ef2389baa8a1e6494e7800 jdk8u45-b15
+74452b827b62c31220709d14a65e71f37795199a jdk8u45-b31
+90fe13eb35388e095383bcb81eeb6d24875e3054 jdk8u45-b32
+3206c35f8a0ed724f5b2085dac3aa185b4c82cd5 jdk8u45-b33
+6739f3bca0d1a75f679ddbac66a1fba77d6b3a7a jdk8u45-b34
+46b54d3830f20a6a2573c1de168573eec221dc36 jdk8u45-b35
+30e45caf06c25d6740f498077ecdcba54da2265d jdk8u45-b36
+d5839b67be4eb681d59bc6d243b8438baec2f07e jdk8u45-b37
+ef437e576e3654f6f9c0cc116a0a824f382b9007 jdk8u51-b00
+d6ddc9950ff55dc9be44704ed59555e221a8fcc9 jdk8u51-b01
+da0ad0f75f08d8fbb4ee4d395e4386a4660b854e jdk8u51-b02
+34737dfadd630afba60b6ad63a696ae335d7e960 jdk8u51-b03
+75f055aeee9f9cab28a58e1deea9ecb8885b63d0 jdk8u51-b04
+5e57ca784de9ce92547c12d0bc3795c42794b962 jdk8u51-b05
+36c97b41563b7bed72014da6e497398c78616d5b jdk8u51-b06
+046bcf8f8e0059fa53136b06547112933d5284d6 jdk8u51-b07
+710b56801de0147716d91be7226b125b5a64c2ef jdk8u51-b08
+3b4c837abdf678ea2e60efcd2d20cc9ff1123c06 jdk8u51-b09
+7aacd8c67160af67f7c9d81974d021eeb229929e jdk8u51-b10
+04005432fba4982e5c073be55b917f8a11c838f0 jdk8u51-b11
+966c04d5702882603a02f5ba4a4e5d19d47960f6 jdk8u51-b12
+3f5353208a226a31d9ad86018a17fe5f3b102d4b jdk8u51-b13
+361ad9121468776eee1d647044481d80e8334ffa jdk8u51-b14
+14975d905d764c5a18b60b991b97375d42dcecd7 jdk8u51-b15
+050f5654fa19db518b354f06a67e0e1f03284a41 jdk8u51-b16
+4519799749671cef69091e354b7cd52496f6d970 jdk8u51-b31
+975b01e6be932672edd527f6efe4b430d7bcf07a jdk8u51-b32
+59aea46232797f247aab869d751e4b8090eb4789 jdk8u51-b33
+3b73732d6886dc8155f0c1fbb125ca60d9e2fd2b jdk8u60-b00
+b0e15cd169a93080c4e30e9eb3061d0b329bf38c jdk8u60-b01
+0b64e727bdb06c82caa02ef25ac2552ce3314537 jdk8u60-b02
+0c3f4e5092d20ed76754fdb3002bebb46952375e jdk8u60-b03
+bd05a145e589b5bc200898a34d2d0f78372e9ed0 jdk8u60-b04
+13a5799e90e958eea7c72bc93829d709a1053995 jdk8u60-b05
+b265b39444379ccd9d4038a8f10c0527f12ba06f jdk8u60-b06
+51eab6899806b399bcca4533ab01362a306e4d0b jdk8u60-b07
+0ef3e20f1d48ddf8b1845039f97dc1174d0701ad jdk8u60-b08
+566ff4ee50bbfbb9f414289b8206be077f07294e jdk8u60-b09
+497d106d476db2eaa0e0ca2756e211fdf9f0d34e jdk8u60-b10
+c8c6e549d1a6e454aa9fd5965a966f5e3a870e60 jdk8u60-b11
+412597b17df8a4109b4fcf32687785c2c93ac536 jdk8u60-b12
+c61fbe5729d4d6ce5522f357b95f285bada8b440 jdk8u60-b13
+ddb4bf8a306a8b0d94ca639994b2b420632d40b3 jdk8u60-b14
+040ce4bf5a41047116a0be643d791b9c76c412b3 jdk8u60-b15
+3cb841defba069c891f80fb03e2c71dad995ae6a jdk8u60-b16
+e882f38df713cac5cec98e18a013a81ce9fad0d3 jdk8u60-b17
+ee389d2cb785317ae0b8bb2c73e72daf9435824d jdk8u60-b18
+a86893381fbb1c03ee743b691a7b7d6a90903eca jdk8u60-b19
+7d03050620d74e6e6b60c9e64b5b8cbe557c8201 jdk8u60-b20
+def8014e497099d6f1b1fc64554b15345a574a96 jdk8u60-b21
+bc1ad5d83a65339c40a17406ea38d2ea8cbb9807 jdk8u60-b22
+9d6b607dcbf820cfec17d6f8775d8649630cfb35 jdk8u60-b23
+c8ea5afd3d53a31b2aae76bc814e7384cae87b87 jdk8u60-b24
+7a74fd4791e866c031df3c22cfc19ce71d3d952e jdk8u60-b25
+9db1721b527eee3b41ff73fcd36ae052227bbf59 jdk8u60-b26
+8f260851e05111c39353a6a4d06e752e7c86ec31 jdk8u60-b27
+37e7f34c2231d99a4ef3eb2c0b1a6899828f11f7 jdk8u60-b31
+393ae594ae7c3f4a776c976e38fb4598ae1c69fd jdk8u60-b32
+d6ef96871920e6f6a0c437850c5afb6d7fc5b4f8 jdk8u52-b06
+aa8bfb1b3e83bdda687d6c065bb51174d8cc5a81 jdk8u52-b07
+d6ef96871920e6f6a0c437850c5afb6d7fc5b4f8 jdk8u65-b00
+04ad73240341cb02d20bb5510f1a66d9e67c4437 jdk8u65-b01
+bd0b41c3c7d4de40c32ee63ec26cd315799a5fbe jdk8u65-b02
+c68c94b3f7f95b1406ecbcf13fd3558192485e19 jdk8u65-b03
+9f9e85cded9f1891115db7d67d18af223c54f5a7 jdk8u65-b04
+977d4ac5561ee94009f70848b1ef7b26230545e0 jdk8u65-b05
+f98b8f06a46ad7d7ab19179c8465c2861bf1a7f6 jdk8u65-b06
+977fdc7ce23e19e43eb7353cdecf09b5b7dfeab3 jdk8u65-b07
+e46c609d4dfda54114ad79955a465355cbc1e230 jdk8u65-b08
+392abce5f026cfe44635f5d6231668d77993c637 jdk8u65-b09
+17bbcffe748d20003332b8c4e6e94cb15a96d725 jdk8u65-b10
+17bbcffe748d20003332b8c4e6e94cb15a96d725 jdk8u65-b10
+0000000000000000000000000000000000000000 jdk8u65-b10
+0000000000000000000000000000000000000000 jdk8u65-b10
+2da19171bdfff7d997009fd1776e86a18f4f7531 jdk8u65-b10
+992064f34aef6eec053701097e5ff6341e4e4172 jdk8u65-b11
+9ee795292f6a23d1ddc224efb5c4ae0f074e5aef jdk8u65-b12
+905f3128a1bf1e26fc23d5374856a78669aa5831 jdk8u65-b13
+294ba041e04544b7abb18c08141ceb4e891d1e66 jdk8u65-b14
+973119b82b13f5138fe7df6be831e86310542717 jdk8u65-b15
+782a028b22af03b2e9018f960bd977fdb2b440f8 jdk8u65-b16
+b6b6756b041d47befdb48b2a71e254f61539b95a jdk8u65-b17
+bc1ad5d83a65339c40a17406ea38d2ea8cbb9807 jdk8u66-b00
+0f2ed27c7d793cee4d91591c6a0b1a730e985906 jdk8u66-b01
+096038a770142b0e6501d04d03283165da9661c6 jdk8u66-b02
+b6ac3a1b7a2c6ba396e894ac5b965ea2ab10cf3d jdk8u66-b07
+87cb8f939ec67923a21dc97436d09f48dad22ecb jdk8u66-b08
+50c5c22f8520993a4ffccaf66b48fa8834f01c35 jdk8u66-b09
+069e64abd19ec46bf85d7b6bf27b1b310d0ae9b7 jdk8u66-b10
+7fdbb05280f4440fcf3bd115097b67f17e2b030c jdk8u66-b11
+d857d6033bf1499c015ef2a2313f53a3e6491df3 jdk8u66-b12
+6e9d5443defdc9ed595528794b82c64a049d5e28 jdk8u66-b13
+94b6e3ddc19334578abefbc44a7ec6f9e20a6e24 jdk8u66-b14
+25cf8ddfc8bf163211d1dfd79f31765cac58eef5 jdk8u66-b15
+40ce5a6d733d44d93cbd5c0105a820ad7a7f4754 jdk8u66-b16
+fc348901e958842a757d59c6b35846d13ab86793 jdk8u66-b17
+4ae0c2d6dd24931f3f271e645221e5331e351c00 jdk8u66-b18
+8af7da6c13af3c95bc9933e6d1e0d83648f6c0ae jdk8u66-b31
+700dc6c623439c5df98253fba49387919dd8732d jdk8u71-b00
+f13e36a4ac819281990312f13f156dbb6f913371 jdk8u71-b01
+90bca51fcdaa065b823ece61e4b0af1ad81955e5 jdk8u71-b02
+33134f35eea3fbffd695d24229d7894c7c2cf14f jdk8u71-b03
+28922f863973b2dc0c87b767685958ec7fc13b97 jdk8u71-b04
+6c783cdd685f6fc8bbc25e4debb07c2096f7b64a jdk8u71-b05
+ae391e3b725697f17e739eaf6b669af10c54ed28 jdk8u71-b06
+5cadfe102e5c7fa1d5ea37991a3e7fc0337e7fab jdk8u71-b07
+6efaec82e8da45264718ce9391bc02f196da63a0 jdk8u71-b08
+19185d4e00661de65f3707328b014e3a011f5456 jdk8u71-b09
+d2d1de379f90baea494a747bacfddf6b0591089b jdk8u71-b10
+e71972e92232ad5bb17c79609d75ad3b8062bf10 jdk8u71-b11
+17f54afcb17f19dfa18680814376bbe06ca81e12 jdk8u71-b12
+260ef1c987a2d566d7caf7de4f31eb30c144f73b jdk8u71-b13
+079fe6e5b8526a2b8b92de5ffcab52d2e1abf3f0 jdk8u71-b14
+16a7adec5fae8bb84e415bbeda6da704f38a6156 jdk8u71-b15
+60e623d06ebdcdc681943b16f00a87aeedf46873 jdk8u72-b00
+176a2ce2e2d6fd07964eca60c28c6b0049d7bc4d jdk8u72-b01
+3c5915665396301b730f808f8f5aa6e95b7c6113 jdk8u72-b02
+fb395cc3de779ad4274063c2a1d876194bcfaabf jdk8u72-b03
+5b5626716c88646895c4ada9ed1a35b24e7148c8 jdk8u72-b04
+1636e47c2d48d92827dac1493d292ebe19a2e108 jdk8u72-b05
+3a3863b12884f6167261f995b5eb0b8c69495f30 jdk8u72-b06
+8045ef94fd11dbda897404de345d1ea1eef52a01 jdk8u72-b07
+be05920afa17d374bc853d890a1575db097ac91c jdk8u72-b08
+8404d311c13333d4b2455bb75bf1aa10a7e55bc2 jdk8u72-b09
+619ab54940fc02e32966ceedcbd7726d7b50ee97 jdk8u72-b10
+8cff3169fa7b95c47599c1312e4dae97ea5228f3 jdk8u72-b11
+68b880e0f5de1d49914790f1a6e5c6e4c3847434 jdk8u72-b12
+58630fde67f4ba7b0fbe8509bb0b105f065383a8 jdk8u72-b13
+05c35ec04d298ad11a97a0c82e54e4468542c6e7 jdk8u72-b14
+1bcc418943405c5ef677eb3f63783683261bd2d3 jdk8u72-b15
+acbcb6682c9b3e66f9cc61a6a62e8cb5f24c75d3 jdk8u76-b00
+b3c914ad842d61818e0c5850409f77478b13acc6 jdk8u76-b01
+7711933ec18462ece8a1b9a9527ec873c520b1ab jdk8u76-b02
+11dd1c13f1bd75f58fc0b020c767f2c331abb2a7 jdk8u76-b03
diff --git a/THIRD_PARTY_README b/THIRD_PARTY_README
index c34ce6b..2b20da2 100644
--- a/THIRD_PARTY_README
+++ b/THIRD_PARTY_README
@@ -1140,37 +1140,6 @@
--------------------------------------------------------------------------------
-%% This notice is provided with respect to JSON, which may be included
-with JRE 8 & JDK 8.
-
---- begin of LICENSE ---
-
-Copyright (c) 2002 JSON.org
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-The Software shall be used for Good, not Evil.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.
-
---- end of LICENSE ---
-
--------------------------------------------------------------------------------
-
%% This notice is provided with respect to Kerberos functionality, which
which may be included with JRE 8, JDK 8, and OpenJDK 8.
@@ -1250,7 +1219,7 @@
-------------------------------------------------------------------------------
-%% This notice is provided with respect to libpng 1.5.4, which may be
+%% This notice is provided with respect to libpng 1.6.16, which may be
included with JRE 8, JDK 8, and OpenJDK 8.
--- begin of LICENSE ---
@@ -1266,8 +1235,8 @@
This code is released under the libpng license.
-libpng versions 1.2.6, August 15, 2004, through 1.5.4, July 7, 2011, are
-Copyright (c) 2004, 2006-2011 Glenn Randers-Pehrson, and are
+libpng versions 1.2.6, August 15, 2004, through 1.6.16, December 22, 2014, are
+Copyright (c) 2004, 2006-2014 Glenn Randers-Pehrson, and are
distributed according to the same disclaimer and license as libpng-1.2.5
with the following individual added to the list of Contributing Authors
@@ -1364,13 +1333,13 @@
Glenn Randers-Pehrson
glennrp at users.sourceforge.net
-July 7, 2011
+December 22, 2014
--- end of LICENSE ---
-------------------------------------------------------------------------------
-%% This notice is provided with respect to libungif 4.1.3, which may be
+%% This notice is provided with respect to GIFLIB 5.1.1 & libungif 4.1.3, which may be
included with JRE 8, JDK 8, and OpenJDK 8.
--- begin of LICENSE ---
@@ -1399,13 +1368,13 @@
-------------------------------------------------------------------------------
-%% This notice is provided with respect to Little CMS 2.5, which may be
+%% This notice is provided with respect to Little CMS 2.7, which may be
included with JRE 8, JDK 8, and OpenJDK 8.
--- begin of LICENSE ---
Little CMS
-Copyright (c) 1998-2011 Marti Maria Saguer
+Copyright (c) 1998-2015 Marti Maria Saguer
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
diff --git a/src/com/sun/org/apache/xalan/internal/XalanConstants.java b/src/com/sun/org/apache/xalan/internal/XalanConstants.java
index 70f31a1..e35d775 100644
--- a/src/com/sun/org/apache/xalan/internal/XalanConstants.java
+++ b/src/com/sun/org/apache/xalan/internal/XalanConstants.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 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
@@ -151,6 +151,16 @@
*/
public static final String SP_MAX_ELEMENT_DEPTH = "jdk.xml.maxElementDepth";
+ /**
+ * JDK TransformerFactory and Transformer attribute that specifies a class
+ * loader that will be used for extension functions class loading
+ * Value: a "null", the default value, means that the default EF class loading
+ * path will be used.
+ * Instance of ClassLoader: the specified instance of ClassLoader will be used
+ * for extension functions loading during translation process
+ */
+ public static final String JDK_EXTENSION_CLASSLOADER = "jdk.xml.transform.extensionClassLoader";
+
//legacy System Properties
public final static String ENTITY_EXPANSION_LIMIT = "entityExpansionLimit";
public static final String ELEMENT_ATTRIBUTE_LIMIT = "elementAttributeLimit" ;
diff --git a/src/com/sun/org/apache/xalan/internal/lib/ExsltSets.java b/src/com/sun/org/apache/xalan/internal/lib/ExsltSets.java
index e35996c..46d5df1 100644
--- a/src/com/sun/org/apache/xalan/internal/lib/ExsltSets.java
+++ b/src/com/sun/org/apache/xalan/internal/lib/ExsltSets.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 1999-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,10 +22,10 @@
*/
package com.sun.org.apache.xalan.internal.lib;
-import java.util.Hashtable;
-
import com.sun.org.apache.xml.internal.utils.DOMHelper;
import com.sun.org.apache.xpath.internal.NodeSet;
+import java.util.HashMap;
+import java.util.Map;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
@@ -192,7 +192,7 @@
NodeSet dist = new NodeSet();
dist.setShouldCacheNodes(true);
- Hashtable stringTable = new Hashtable();
+ Map<String, Node> stringTable = new HashMap<>();
for (int i = 0; i < nl.getLength(); i++)
{
diff --git a/src/com/sun/org/apache/xalan/internal/lib/Extensions.java b/src/com/sun/org/apache/xalan/internal/lib/Extensions.java
index 23082e8..e914709 100644
--- a/src/com/sun/org/apache/xalan/internal/lib/Extensions.java
+++ b/src/com/sun/org/apache/xalan/internal/lib/Extensions.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 1999-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,28 +22,24 @@
*/
package com.sun.org.apache.xalan.internal.lib;
-import java.util.Hashtable;
-import java.util.StringTokenizer;
-
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException;
-
import com.sun.org.apache.xalan.internal.extensions.ExpressionContext;
+import com.sun.org.apache.xalan.internal.utils.ObjectFactory;
import com.sun.org.apache.xalan.internal.xslt.EnvironmentCheck;
import com.sun.org.apache.xpath.internal.NodeSet;
import com.sun.org.apache.xpath.internal.objects.XBoolean;
import com.sun.org.apache.xpath.internal.objects.XNumber;
import com.sun.org.apache.xpath.internal.objects.XObject;
-import com.sun.org.apache.xalan.internal.utils.ObjectFactory;
-
+import java.util.Hashtable;
+import java.util.Map;
+import java.util.StringTokenizer;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
import org.w3c.dom.Document;
import org.w3c.dom.DocumentFragment;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.w3c.dom.Text;
import org.w3c.dom.traversal.NodeIterator;
-
import org.xml.sax.SAXNotSupportedException;
/**
@@ -313,7 +309,7 @@
// If reflection failed, fallback to our internal EnvironmentCheck
EnvironmentCheck envChecker = new EnvironmentCheck();
- Hashtable h = envChecker.getEnvironmentHash();
+ Map<String, Object> h = envChecker.getEnvironmentHash();
resultNode = factoryDocument.createElement("checkEnvironmentExtension");
envChecker.appendEnvironmentReport(resultNode, factoryDocument, h);
envChecker = null;
diff --git a/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_de.java b/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_de.java
index a02f458..966d0ca 100644
--- a/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_de.java
+++ b/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_de.java
@@ -1359,7 +1359,7 @@
{ "optionE", " [-E (Entit\u00E4tsreferenzen nicht einblenden)]"},
{ "optionV", " [-E (Entit\u00E4tsreferenzen nicht einblenden)]"},
{ "optionQC", " [-QC (Stille Musterkonfliktwarnungen)]"},
- { "optionQ", " [-Q (Stiller Modus)]"},
+ { "optionQ", " [-Q (Silent-Modus)]"},
{ "optionLF", " [-LF (Nur Zeilenvorsch\u00FCbe bei Ausgabe verwenden {Standard ist CR/LF})]"},
{ "optionCR", " [-CR (Nur Zeilenschaltungen bei Ausgabe verwenden {Standard ist CR/LF})]"},
{ "optionESCAPE", " [-ESCAPE (Escapezeichen {Standard ist <>&\"'\r\n}]"},
diff --git a/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_fr.java b/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_fr.java
index 57f6b13..2ffbbba 100644
--- a/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_fr.java
+++ b/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_fr.java
@@ -1210,7 +1210,7 @@
"Le nom de fonction ne peut pas \u00EAtre NULL."},
{ ER_XPATH_RESOLVER_NEGATIVE_ARITY,
- "Le nombre d'arguments ne peut pas \u00EAtre n\u00E9gatif."},
+ "L'arit\u00E9 ne peut pas \u00EAtre n\u00E9gative."},
// Warnings...
{ WG_FOUND_CURLYBRACE,
diff --git a/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_sv.java b/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_sv.java
index a673bb5..183697b 100644
--- a/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_sv.java
+++ b/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_sv.java
@@ -1223,10 +1223,10 @@
"Gammal syntax: Namnet p\u00E5 'expr'-attributet har \u00E4ndrats till 'select'."},
{ WG_NO_LOCALE_IN_FORMATNUMBER,
- "Xalan hanterar \u00E4nnu inte spr\u00E5knamnet i funktionen format-number."},
+ "Xalan hanterar \u00E4nnu inte spr\u00E5kkonventionen i funktionen format-number."},
{ WG_LOCALE_NOT_FOUND,
- "Varning: Hittade inte spr\u00E5kinst\u00E4llning f\u00F6r xml:lang={0}"},
+ "Varning: Hittade inte spr\u00E5kkonvention f\u00F6r xml:lang={0}"},
{ WG_CANNOT_MAKE_URL_FROM,
"Kan inte skapa URL fr\u00E5n: {0}"},
@@ -1283,10 +1283,10 @@
"xsl:stylesheet kr\u00E4ver ett 'version'-attribut!"},
{ WG_ILLEGAL_ATTRIBUTE_NAME,
- "Ogiltigt attributnamn: {0}"},
+ "Otill\u00E5tet attributnamn: {0}"},
{ WG_ILLEGAL_ATTRIBUTE_VALUE,
- "Ogiltigt v\u00E4rde anv\u00E4nds f\u00F6r attributet {0}: {1}"},
+ "Otill\u00E5tet v\u00E4rde anv\u00E4nds f\u00F6r attributet {0}: {1}"},
{ WG_EMPTY_SECOND_ARG,
"Resulterande nodupps\u00E4ttning fr\u00E5n dokumentfunktionens andra argumentet \u00E4r tomt. En tom nodupps\u00E4ttning anv\u00E4nds."},
@@ -1326,8 +1326,8 @@
{ "version", ">>>>>>> Xalan version "},
{ "version2", "<<<<<<<"},
{ "yes", "ja"},
- { "line", "Rad #"},
- { "column","Kolumn #"},
+ { "line", "Rad nr"},
+ { "column","Kolumn nr"},
{ "xsldone", "XSLProcessor: utf\u00F6rd"},
diff --git a/src/com/sun/org/apache/xalan/internal/utils/XMLSecurityManager.java b/src/com/sun/org/apache/xalan/internal/utils/XMLSecurityManager.java
index 0883841..0701bb1 100644
--- a/src/com/sun/org/apache/xalan/internal/utils/XMLSecurityManager.java
+++ b/src/com/sun/org/apache/xalan/internal/utils/XMLSecurityManager.java
@@ -65,27 +65,31 @@
*/
public static enum Limit {
- ENTITY_EXPANSION_LIMIT(XalanConstants.JDK_ENTITY_EXPANSION_LIMIT,
+ ENTITY_EXPANSION_LIMIT("EntityExpansionLimit", XalanConstants.JDK_ENTITY_EXPANSION_LIMIT,
XalanConstants.SP_ENTITY_EXPANSION_LIMIT, 0, 64000),
- MAX_OCCUR_NODE_LIMIT(XalanConstants.JDK_MAX_OCCUR_LIMIT,
+ MAX_OCCUR_NODE_LIMIT("MaxOccurLimit", XalanConstants.JDK_MAX_OCCUR_LIMIT,
XalanConstants.SP_MAX_OCCUR_LIMIT, 0, 5000),
- ELEMENT_ATTRIBUTE_LIMIT(XalanConstants.JDK_ELEMENT_ATTRIBUTE_LIMIT,
+ ELEMENT_ATTRIBUTE_LIMIT("ElementAttributeLimit", XalanConstants.JDK_ELEMENT_ATTRIBUTE_LIMIT,
XalanConstants.SP_ELEMENT_ATTRIBUTE_LIMIT, 0, 10000),
- TOTAL_ENTITY_SIZE_LIMIT(XalanConstants.JDK_TOTAL_ENTITY_SIZE_LIMIT,
+ TOTAL_ENTITY_SIZE_LIMIT("TotalEntitySizeLimit", XalanConstants.JDK_TOTAL_ENTITY_SIZE_LIMIT,
XalanConstants.SP_TOTAL_ENTITY_SIZE_LIMIT, 0, 50000000),
- GENERAL_ENTITY_SIZE_LIMIT(XalanConstants.JDK_GENERAL_ENTITY_SIZE_LIMIT,
+ GENERAL_ENTITY_SIZE_LIMIT("MaxEntitySizeLimit", XalanConstants.JDK_GENERAL_ENTITY_SIZE_LIMIT,
XalanConstants.SP_GENERAL_ENTITY_SIZE_LIMIT, 0, 0),
- PARAMETER_ENTITY_SIZE_LIMIT(XalanConstants.JDK_PARAMETER_ENTITY_SIZE_LIMIT,
+ PARAMETER_ENTITY_SIZE_LIMIT("MaxEntitySizeLimit", XalanConstants.JDK_PARAMETER_ENTITY_SIZE_LIMIT,
XalanConstants.SP_PARAMETER_ENTITY_SIZE_LIMIT, 0, 1000000),
- MAX_ELEMENT_DEPTH_LIMIT(XalanConstants.JDK_MAX_ELEMENT_DEPTH,
- XalanConstants.SP_MAX_ELEMENT_DEPTH, 0, 0);
+ 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);
+ 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;
@@ -100,6 +104,10 @@
return (propertyName == null) ? false : systemProperty.equals(propertyName);
}
+ public String key() {
+ return key;
+ }
+
public String apiProperty() {
return apiProperty;
}
@@ -108,7 +116,7 @@
return systemProperty;
}
- int defaultValue() {
+ public int defaultValue() {
return defaultValue;
}
@@ -160,7 +168,7 @@
/**
* Index of the special entityCountInfo property
*/
- private int indexEntityCountInfo = 10000;
+ private final int indexEntityCountInfo = 10000;
private String printEntityCountInfo = "";
/**
diff --git a/src/com/sun/org/apache/xalan/internal/xslt/EnvironmentCheck.java b/src/com/sun/org/apache/xalan/internal/xslt/EnvironmentCheck.java
index 928da3e..a9331f2 100644
--- a/src/com/sun/org/apache/xalan/internal/xslt/EnvironmentCheck.java
+++ b/src/com/sun/org/apache/xalan/internal/xslt/EnvironmentCheck.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 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
*
@@ -24,17 +24,17 @@
import com.sun.org.apache.xalan.internal.utils.ObjectFactory;
import com.sun.org.apache.xalan.internal.utils.SecuritySupport;
-
import java.io.File;
import java.io.FileWriter;
import java.io.PrintWriter;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
-import java.util.Enumeration;
-import java.util.Hashtable;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
import java.util.StringTokenizer;
-import java.util.Vector;
-
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
@@ -171,7 +171,7 @@
outWriter = pw;
// Setup a hash to store various environment information in
- Hashtable hash = getEnvironmentHash();
+ Map<String, Object> hash = getEnvironmentHash();
// Check for ERROR keys in the hashtable, and print report
boolean environmentHasErrors = writeEnvironmentReport(hash);
@@ -214,13 +214,13 @@
* point out the most common classpath and system property
* problems that we've seen.</p>
*
- * @return Hashtable full of useful environment info about Xalan
- * and related system properties, etc.
+ * @return Map full of useful environment info about Xalan and related
+ * system properties, etc.
*/
- public Hashtable getEnvironmentHash()
+ public Map<String, Object> getEnvironmentHash()
{
// Setup a hash to store various environment information in
- Hashtable hash = new Hashtable();
+ Map<String, Object> hash = new HashMap<>();
// Call various worker methods to fill in the hash
// These are explicitly separate for maintenance and so
@@ -242,22 +242,22 @@
* Dump a basic Xalan environment report to outWriter.
*
* <p>This dumps a simple header and then each of the entries in
- * the Hashtable to our PrintWriter; it does special processing
+ * the Map to our PrintWriter; it does special processing
* for entries that are .jars found in the classpath.</p>
*
- * @param h Hashtable of items to report on; presumably
+ * @param h Map of items to report on; presumably
* filled in by our various check*() methods
* @return true if your environment appears to have no major
* problems; false if potential environment problems found
- * @see #appendEnvironmentReport(Node, Document, Hashtable)
+ * @see #appendEnvironmentReport(Node, Document, Map)
* for an equivalent that appends to a Node instead
*/
- protected boolean writeEnvironmentReport(Hashtable h)
+ protected boolean writeEnvironmentReport(Map<String, Object> h)
{
if (null == h)
{
- logMsg("# ERROR: writeEnvironmentReport called with null Hashtable");
+ logMsg("# ERROR: writeEnvironmentReport called with null Map");
return false;
}
@@ -267,39 +267,28 @@
"#---- BEGIN writeEnvironmentReport($Revision: 1.10 $): Useful stuff found: ----");
// Fake the Properties-like output
- for (Enumeration keys = h.keys();
- keys.hasMoreElements();
- /* no increment portion */
- )
- {
- Object key = keys.nextElement();
- String keyStr = (String) key;
- try
- {
- // Special processing for classes found..
- if (keyStr.startsWith(FOUNDCLASSES))
- {
- Vector v = (Vector) h.get(keyStr);
- errors |= logFoundJars(v, keyStr);
+ for (Map.Entry<String, Object> entry : h.entrySet()) {
+ String keyStr = entry.getKey();
+ try {
+ // Special processing for classes found..
+ if (keyStr.startsWith(FOUNDCLASSES)) {
+ List<Map> v = (ArrayList<Map>)entry.getValue();
+ errors |= logFoundJars(v, keyStr);
+ }
+ // ..normal processing for all other entries
+ else {
+ // Note: we could just check for the ERROR key by itself,
+ // since we now set that, but since we have to go
+ // through the whole hash anyway, do it this way,
+ // which is safer for maintenance
+ if (keyStr.startsWith(ERROR)) {
+ errors = true;
+ }
+ logMsg(keyStr + "=" + h.get(keyStr));
+ }
+ } catch (Exception e) {
+ logMsg("Reading-" + keyStr + "= threw: " + e.toString());
}
- // ..normal processing for all other entries
- else
- {
- // Note: we could just check for the ERROR key by itself,
- // since we now set that, but since we have to go
- // through the whole hash anyway, do it this way,
- // which is safer for maintenance
- if (keyStr.startsWith(ERROR))
- {
- errors = true;
- }
- logMsg(keyStr + "=" + h.get(keyStr));
- }
- }
- catch (Exception e)
- {
- logMsg("Reading-" + key + "= threw: " + e.toString());
- }
}
logMsg(
@@ -350,14 +339,14 @@
* Takes the information encoded from a checkPathForJars()
* call and dumps it out to our PrintWriter.
*
- * @param v Vector of Hashtables of .jar file info
+ * @param v List of Maps of .jar file info
* @param desc description to print out in header
*
* @return false if OK, true if any .jars were reported
* as having errors
* @see #checkPathForJars(String, String[])
*/
- protected boolean logFoundJars(Vector v, String desc)
+ protected boolean logFoundJars(List<Map> v, String desc)
{
if ((null == v) || (v.size() < 1))
@@ -367,32 +356,20 @@
logMsg("#---- BEGIN Listing XML-related jars in: " + desc + " ----");
- for (int i = 0; i < v.size(); i++)
- {
- Hashtable subhash = (Hashtable) v.elementAt(i);
+ for (Map<String, String> v1 : v) {
+ for (Map.Entry<String, String> entry : v1.entrySet()) {
+ String keyStr = entry.getKey();
+ try {
+ if (keyStr.startsWith(ERROR)) {
+ errors = true;
+ }
+ logMsg(keyStr + "=" + entry.getValue());
- for (Enumeration keys = subhash.keys();
- keys.hasMoreElements();
- /* no increment portion */
- )
- {
- Object key = keys.nextElement();
- String keyStr = (String) key;
- try
- {
- if (keyStr.startsWith(ERROR))
- {
- errors = true;
- }
- logMsg(keyStr + "=" + subhash.get(keyStr));
-
+ } catch (Exception e) {
+ errors = true;
+ logMsg("Reading-" + keyStr + "= threw: " + e.toString());
+ }
}
- catch (Exception e)
- {
- errors = true;
- logMsg("Reading-" + key + "= threw: " + e.toString());
- }
- }
}
logMsg("#----- END Listing XML-related jars in: " + desc + " -----");
@@ -410,10 +387,10 @@
* @param container Node to append our report to
* @param factory Document providing createElement, etc. services
* @param h Hash presumably from {@link #getEnvironmentHash()}
- * @see #writeEnvironmentReport(Hashtable)
+ * @see #writeEnvironmentReport(Map)
* for an equivalent that writes to a PrintWriter instead
*/
- public void appendEnvironmentReport(Node container, Document factory, Hashtable h)
+ public void appendEnvironmentReport(Node container, Document factory, Map<String, Object> h)
{
if ((null == container) || (null == factory))
{
@@ -430,7 +407,7 @@
{
Element statusNode = factory.createElement("status");
statusNode.setAttribute("result", "ERROR");
- statusNode.appendChild(factory.createTextNode("appendEnvironmentReport called with null Hashtable!"));
+ statusNode.appendChild(factory.createTextNode("appendEnvironmentReport called with null Map!"));
envCheckNode.appendChild(statusNode);
return;
}
@@ -440,47 +417,35 @@
Element hashNode = factory.createElement("environment");
envCheckNode.appendChild(hashNode);
- for (Enumeration keys = h.keys();
- keys.hasMoreElements();
- /* no increment portion */
- )
- {
- Object key = keys.nextElement();
- String keyStr = (String) key;
- try
- {
- // Special processing for classes found..
- if (keyStr.startsWith(FOUNDCLASSES))
- {
- Vector v = (Vector) h.get(keyStr);
- // errors |= logFoundJars(v, keyStr);
- errors |= appendFoundJars(hashNode, factory, v, keyStr);
- }
- // ..normal processing for all other entries
- else
- {
- // Note: we could just check for the ERROR key by itself,
- // since we now set that, but since we have to go
- // through the whole hash anyway, do it this way,
- // which is safer for maintenance
- if (keyStr.startsWith(ERROR))
- {
+ for (Map.Entry<String, Object> entry : h.entrySet()) {
+ String keyStr = entry.getKey();
+ try {
+ // Special processing for classes found..
+ if (keyStr.startsWith(FOUNDCLASSES)) {
+ List<Map> v = (List<Map>)entry.getValue();
+ // errors |= logFoundJars(v, keyStr);
+ errors |= appendFoundJars(hashNode, factory, v, keyStr);
+ } // ..normal processing for all other entries
+ else {
+ // Note: we could just check for the ERROR key by itself,
+ // since we now set that, but since we have to go
+ // through the whole hash anyway, do it this way,
+ // which is safer for maintenance
+ if (keyStr.startsWith(ERROR)) {
+ errors = true;
+ }
+ Element node = factory.createElement("item");
+ node.setAttribute("key", keyStr);
+ node.appendChild(factory.createTextNode((String) h.get(keyStr)));
+ hashNode.appendChild(node);
+ }
+ } catch (Exception e) {
errors = true;
- }
- Element node = factory.createElement("item");
- node.setAttribute("key", keyStr);
- node.appendChild(factory.createTextNode((String)h.get(keyStr)));
- hashNode.appendChild(node);
+ Element node = factory.createElement("item");
+ node.setAttribute("key", keyStr);
+ node.appendChild(factory.createTextNode(ERROR + " Reading " + keyStr + " threw: " + e.toString()));
+ hashNode.appendChild(node);
}
- }
- catch (Exception e)
- {
- errors = true;
- Element node = factory.createElement("item");
- node.setAttribute("key", keyStr);
- node.appendChild(factory.createTextNode(ERROR + " Reading " + key + " threw: " + e.toString()));
- hashNode.appendChild(node);
- }
} // end of for...
Element statusNode = factory.createElement("status");
@@ -502,7 +467,7 @@
*
* @param container Node to append our report to
* @param factory Document providing createElement, etc. services
- * @param v Vector of Hashtables of .jar file info
+ * @param v Map of Maps of .jar file info
* @param desc description to print out in header
*
* @return false if OK, true if any .jars were reported
@@ -510,7 +475,7 @@
* @see #checkPathForJars(String, String[])
*/
protected boolean appendFoundJars(Node container, Document factory,
- Vector v, String desc)
+ List<Map> v, String desc)
{
if ((null == v) || (v.size() < 1))
@@ -518,37 +483,25 @@
boolean errors = false;
- for (int i = 0; i < v.size(); i++)
- {
- Hashtable subhash = (Hashtable) v.elementAt(i);
-
- for (Enumeration keys = subhash.keys();
- keys.hasMoreElements();
- /* no increment portion */
- )
- {
- Object key = keys.nextElement();
- try
- {
- String keyStr = (String) key;
- if (keyStr.startsWith(ERROR))
- {
- errors = true;
- }
- Element node = factory.createElement("foundJar");
- node.setAttribute("name", keyStr.substring(0, keyStr.indexOf("-")));
- node.setAttribute("desc", keyStr.substring(keyStr.indexOf("-") + 1));
- node.appendChild(factory.createTextNode((String)subhash.get(keyStr)));
- container.appendChild(node);
+ for (Map<String, String> v1 : v) {
+ for (Map.Entry<String, String> entry : v1.entrySet()) {
+ String keyStr = entry.getKey();
+ try {
+ if (keyStr.startsWith(ERROR)) {
+ errors = true;
+ }
+ Element node = factory.createElement("foundJar");
+ node.setAttribute("name", keyStr.substring(0, keyStr.indexOf("-")));
+ node.setAttribute("desc", keyStr.substring(keyStr.indexOf("-") + 1));
+ node.appendChild(factory.createTextNode(entry.getValue()));
+ container.appendChild(node);
+ } catch (Exception e) {
+ errors = true;
+ Element node = factory.createElement("foundJar");
+ node.appendChild(factory.createTextNode(ERROR + " Reading " + keyStr + " threw: " + e.toString()));
+ container.appendChild(node);
+ }
}
- catch (Exception e)
- {
- errors = true;
- Element node = factory.createElement("foundJar");
- node.appendChild(factory.createTextNode(ERROR + " Reading " + key + " threw: " + e.toString()));
- container.appendChild(node);
- }
- }
}
return errors;
}
@@ -562,15 +515,15 @@
* //@todo NOTE: We don't actually search java.ext.dirs for
* // *.jar files therein! This should be updated
*
- * @param h Hashtable to put information in
+ * @param h Map to put information in
* @see #jarNames
* @see #checkPathForJars(String, String[])
*/
- protected void checkSystemProperties(Hashtable h)
+ protected void checkSystemProperties(Map<String, Object> h)
{
if (null == h)
- h = new Hashtable();
+ h = new HashMap<>();
// Grab java version for later use
try
@@ -598,22 +551,22 @@
h.put("java.class.path", cp);
- Vector classpathJars = checkPathForJars(cp, jarNames);
+ List<Map> classpathJars = checkPathForJars(cp, jarNames);
- if (null != classpathJars)
- h.put(FOUNDCLASSES + "java.class.path", classpathJars);
+ if (null != classpathJars) {
+ h.put(FOUNDCLASSES + "java.class.path", classpathJars);
+ }
// Also check for JDK 1.2+ type classpaths
String othercp = SecuritySupport.getSystemProperty("sun.boot.class.path");
- if (null != othercp)
- {
- h.put("sun.boot.class.path", othercp);
+ if (null != othercp) {
+ h.put("sun.boot.class.path", othercp);
+ classpathJars = checkPathForJars(othercp, jarNames);
- classpathJars = checkPathForJars(othercp, jarNames);
-
- if (null != classpathJars)
- h.put(FOUNDCLASSES + "sun.boot.class.path", classpathJars);
+ if (null != classpathJars) {
+ h.put(FOUNDCLASSES + "sun.boot.class.path", classpathJars);
+ }
}
//@todo NOTE: We don't actually search java.ext.dirs for
@@ -654,20 +607,20 @@
* @param cp classpath to search
* @param jars array of .jar base filenames to look for
*
- * @return Vector of Hashtables filled with info about found .jars
+ * @return List of Maps filled with info about found .jars
* @see #jarNames
- * @see #logFoundJars(Vector, String)
- * @see #appendFoundJars(Node, Document, Vector, String )
+ * @see #logFoundJars(Map, String)
+ * @see #appendFoundJars(Node, Document, Map, String )
* @see #getApparentVersion(String, long)
*/
- protected Vector checkPathForJars(String cp, String[] jars)
+ protected List<Map> checkPathForJars(String cp, String[] jars)
{
if ((null == cp) || (null == jars) || (0 == cp.length())
|| (0 == jars.length))
return null;
- Vector v = new Vector();
+ List<Map> v = new ArrayList<>();
StringTokenizer st = new StringTokenizer(cp, File.pathSeparator);
while (st.hasMoreTokens())
@@ -687,37 +640,32 @@
// If any requested jarName exists, report on
// the details of that .jar file
- try
- {
- Hashtable h = new Hashtable(2);
- // Note "-" char is looked for in appendFoundJars
- h.put(jars[i] + "-path", f.getAbsolutePath());
+ try {
+ Map<String, String> h = new HashMap<>(2);
+ // Note "-" char is looked for in appendFoundJars
+ h.put(jars[i] + "-path", f.getAbsolutePath());
- // We won't bother reporting on the xalan.jar apparent version
- // since this requires knowing the jar size of the xalan.jar
- // before we build it.
- // For other jars, eg. xml-apis.jar and xercesImpl.jar, we
- // report the apparent version of the file we've found
- if (!("xalan.jar".equalsIgnoreCase(jars[i]))) {
- h.put(jars[i] + "-apparent.version",
- getApparentVersion(jars[i], f.length()));
- }
- v.addElement(h);
- }
- catch (Exception e)
- {
+ // We won't bother reporting on the xalan.jar apparent version
+ // since this requires knowing the jar size of the xalan.jar
+ // before we build it.
+ // For other jars, eg. xml-apis.jar and xercesImpl.jar, we
+ // report the apparent version of the file we've found
+ if (!("xalan.jar".equalsIgnoreCase(jars[i]))) {
+ h.put(jars[i] + "-apparent.version",
+ getApparentVersion(jars[i], f.length()));
+ }
+ v.add(h);
+ } catch (Exception e) {
- /* no-op, don't add it */
+ /* no-op, don't add it */
}
- }
- else
- {
- Hashtable h = new Hashtable(2);
+ } else {
+ Map<String, String> h = new HashMap<>(2);
// Note "-" char is looked for in appendFoundJars
h.put(jars[i] + "-path", WARNING + " Classpath entry: "
- + filename + " does not exist");
+ + filename + " does not exist");
h.put(jars[i] + "-apparent.version", CLASS_NOTPRESENT);
- v.addElement(h);
+ v.add(h);
}
}
}
@@ -748,8 +696,8 @@
{
// If we found a matching size and it's for our
// jar, then return it's description
- // Lookup in static jarVersions Hashtable
- String foundSize = (String) jarVersions.get(new Long(jarSize));
+ // Lookup in static JARVERSIONS Map
+ String foundSize = JARVERSIONS.get(new Long(jarSize));
if ((null != foundSize) && (foundSize.startsWith(jarName)))
{
@@ -783,13 +731,13 @@
* and not found; only tests the interfaces, and does not
* check for reference implementation versions.
*
- * @param h Hashtable to put information in
+ * @param h Map to put information in
*/
- protected void checkJAXPVersion(Hashtable h)
+ protected void checkJAXPVersion(Map<String, Object> h)
{
if (null == h)
- h = new Hashtable();
+ h = new HashMap<>();
Class clazz = null;
@@ -814,13 +762,13 @@
*
* Looks for version info in xalan.jar from Xalan-J products.
*
- * @param h Hashtable to put information in
+ * @param h Map to put information in
*/
- protected void checkProcessorVersion(Hashtable h)
+ protected void checkProcessorVersion(Map<String, Object> h)
{
if (null == h)
- h = new Hashtable();
+ h = new HashMap<>();
try
{
@@ -900,13 +848,13 @@
*
* //@todo actually look up version info in crimson manifest
*
- * @param h Hashtable to put information in
+ * @param h Map to put information in
*/
- protected void checkParserVersion(Hashtable h)
+ protected void checkParserVersion(Map<String, Object> h)
{
if (null == h)
- h = new Hashtable();
+ h = new HashMap<>();
try
{
@@ -961,13 +909,13 @@
/**
* Report product version information from Ant.
*
- * @param h Hashtable to put information in
+ * @param h Map to put information in
*/
- protected void checkAntVersion(Hashtable h)
+ protected void checkAntVersion(Map<String, Object> h)
{
if (null == h)
- h = new Hashtable();
+ h = new HashMap<>();
try
{
@@ -991,13 +939,13 @@
/**
* Report version info from DOM interfaces.
*
- * @param h Hashtable to put information in
+ * @param h Map to put information in
*/
- protected boolean checkDOML3(Hashtable h)
+ protected boolean checkDOML3(Map<String, Object> h)
{
if (null == h)
- h = new Hashtable();
+ h = new HashMap<>();
final String DOM_CLASS = "org.w3c.dom.Document";
final String DOM_LEVEL3_METHOD = "getDoctype"; // no parameter
@@ -1026,13 +974,13 @@
* level 2 working draft, the DOM level 2 final draft,
* and not found.
*
- * @param h Hashtable to put information in
+ * @param h Map to put information in
*/
- protected void checkDOMVersion(Hashtable h)
+ protected void checkDOMVersion(Map<String, Object> h)
{
if (null == h)
- h = new Hashtable();
+ h = new HashMap<>();
final String DOM_LEVEL2_CLASS = "org.w3c.dom.Document";
final String DOM_LEVEL2_METHOD = "createElementNS"; // String, String
@@ -1102,13 +1050,13 @@
* Currently distinguishes between SAX 2, SAX 2.0beta2,
* SAX1, and not found.
*
- * @param h Hashtable to put information in
+ * @param h Map to put information in
*/
- protected void checkSAXVersion(Hashtable h)
+ protected void checkSAXVersion(Map<String, Object> h)
{
if (null == h)
- h = new Hashtable();
+ h = new HashMap<>();
final String SAX_VERSION1_CLASS = "org.xml.sax.Parser";
final String SAX_VERSION1_METHOD = "parse"; // String
@@ -1188,17 +1136,17 @@
*
* @see #getApparentVersion(String, long)
*/
- private static Hashtable jarVersions = new Hashtable();
+ private static final Map<Long, String> JARVERSIONS;
/**
- * Static initializer for jarVersions table.
+ * Static initializer for JARVERSIONS table.
* Doing this just once saves time and space.
*
* @see #getApparentVersion(String, long)
*/
static
{
- // Note: hackish Hashtable, this could use improvement
+ Map<Long, String> jarVersions = new HashMap<>();
jarVersions.put(new Long(857192), "xalan.jar from xalan-j_1_1");
jarVersions.put(new Long(440237), "xalan.jar from xalan-j_1_2");
jarVersions.put(new Long(436094), "xalan.jar from xalan-j_1_2_1");
@@ -1287,6 +1235,8 @@
// jakarta-ant: since many people use ant these days
jarVersions.put(new Long(136198), "parser.jar from jakarta-ant-1.3 or 1.2");
jarVersions.put(new Long(5537), "jaxp.jar from jakarta-ant-1.3 or 1.2");
+
+ JARVERSIONS = Collections.unmodifiableMap(jarVersions);
}
/** Simple PrintWriter we send output to; defaults to System.out. */
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/DOM.java b/src/com/sun/org/apache/xalan/internal/xsltc/DOM.java
index 603f0bc..bf6fbf1 100644
--- a/src/com/sun/org/apache/xalan/internal/xsltc/DOM.java
+++ b/src/com/sun/org/apache/xalan/internal/xsltc/DOM.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 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
*
@@ -23,14 +23,12 @@
package com.sun.org.apache.xalan.internal.xsltc;
-import com.sun.org.apache.xalan.internal.xsltc.runtime.Hashtable;
import com.sun.org.apache.xml.internal.dtm.DTMAxisIterator;
-
+import com.sun.org.apache.xml.internal.serializer.SerializationHandler;
+import java.util.Map;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
-import com.sun.org.apache.xml.internal.serializer.SerializationHandler;
-
/**
* @author Jacek Ambroziak
* @author Santiago Pericas-Geertsen
@@ -103,5 +101,5 @@
public int getNSType(int node);
public int getDocument();
public String getUnparsedEntityURI(String name);
- public Hashtable getElementsWithIDs();
+ public Map<String, Integer> getElementsWithIDs();
}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/ApplyTemplates.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/ApplyTemplates.java
index d4aeb31..174a1d1 100644
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/ApplyTemplates.java
+++ b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/ApplyTemplates.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
*
@@ -23,9 +23,6 @@
package com.sun.org.apache.xalan.internal.xsltc.compiler;
-import java.util.Enumeration;
-import java.util.Vector;
-
import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
import com.sun.org.apache.bcel.internal.generic.INVOKEINTERFACE;
import com.sun.org.apache.bcel.internal.generic.INVOKEVIRTUAL;
@@ -41,6 +38,8 @@
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Util;
import com.sun.org.apache.xml.internal.utils.XML11Char;
+import java.util.Iterator;
+import java.util.Vector;
/**
* @author Jacek Ambroziak
@@ -122,9 +121,9 @@
// check if sorting nodes is required
final Vector sortObjects = new Vector();
- final Enumeration children = elements();
- while (children.hasMoreElements()) {
- final Object child = children.nextElement();
+ final Iterator<SyntaxTreeNode> children = elements();
+ while (children.hasNext()) {
+ final SyntaxTreeNode child = children.next();
if (child instanceof Sort) {
sortObjects.addElement(child);
}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/AttributeSet.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/AttributeSet.java
index 1ba7abe..2bbcaf6 100644
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/AttributeSet.java
+++ b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/AttributeSet.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
*
@@ -23,9 +23,6 @@
package com.sun.org.apache.xalan.internal.xsltc.compiler;
-import java.util.Enumeration;
-import java.util.Vector;
-
import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
import com.sun.org.apache.bcel.internal.generic.INVOKESPECIAL;
import com.sun.org.apache.bcel.internal.generic.InstructionList;
@@ -37,6 +34,8 @@
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Util;
import com.sun.org.apache.xml.internal.utils.XML11Char;
+import java.util.Iterator;
+import java.util.List;
/**
* @author Jacek Ambroziak
@@ -111,10 +110,10 @@
// Parse the contents of this node. All child elements must be
// <xsl:attribute> elements. Other elements cause an error.
- final Vector contents = getContents();
+ final List<SyntaxTreeNode> contents = getContents();
final int count = contents.size();
for (int i=0; i<count; i++) {
- SyntaxTreeNode child = (SyntaxTreeNode)contents.elementAt(i);
+ SyntaxTreeNode child = contents.get(i);
if (child instanceof XslAttribute) {
parser.getSymbolTable().setCurrentNode(child);
child.parseContents(parser);
@@ -181,9 +180,9 @@
if (_useSets != null) _useSets.translate(classGen, methodGen);
// Translate all local attributes
- final Enumeration attributes = elements();
- while (attributes.hasMoreElements()) {
- SyntaxTreeNode element = (SyntaxTreeNode)attributes.nextElement();
+ final Iterator<SyntaxTreeNode> attributes = elements();
+ while (attributes.hasNext()) {
+ SyntaxTreeNode element = attributes.next();
if (element instanceof XslAttribute) {
final XslAttribute attribute = (XslAttribute)element;
attribute.translate(classGen, methodGen);
@@ -198,10 +197,10 @@
public String toString() {
StringBuffer buf = new StringBuffer("attribute-set: ");
// Translate all local attributes
- final Enumeration attributes = elements();
- while (attributes.hasMoreElements()) {
+ final Iterator<SyntaxTreeNode> attributes = elements();
+ while (attributes.hasNext()) {
final XslAttribute attribute =
- (XslAttribute)attributes.nextElement();
+ (XslAttribute)attributes.next();
buf.append(attribute);
}
return(buf.toString());
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/AttributeValueTemplate.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/AttributeValueTemplate.java
index f73c427..9b58759 100644
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/AttributeValueTemplate.java
+++ b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/AttributeValueTemplate.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
*
@@ -23,11 +23,6 @@
package com.sun.org.apache.xalan.internal.xsltc.compiler;
-import java.util.Enumeration;
-import java.util.Vector;
-import java.util.StringTokenizer;
-import java.util.NoSuchElementException;
-
import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
import com.sun.org.apache.bcel.internal.generic.INVOKESPECIAL;
import com.sun.org.apache.bcel.internal.generic.INVOKEVIRTUAL;
@@ -39,6 +34,10 @@
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
+import java.util.Iterator;
+import java.util.List;
+import java.util.NoSuchElementException;
+import java.util.StringTokenizer;
/**
* @author Jacek Ambroziak
@@ -206,12 +205,12 @@
}
public Type typeCheck(SymbolTable stable) throws TypeCheckError {
- final Vector contents = getContents();
+ final List<SyntaxTreeNode> contents = getContents();
final int n = contents.size();
for (int i = 0; i < n; i++) {
- final Expression exp = (Expression)contents.elementAt(i);
+ final Expression exp = (Expression)contents.get(i);
if (!exp.typeCheck(stable).identicalTo(Type.String)) {
- contents.setElementAt(new CastExpr(exp, Type.String), i);
+ contents.set(i, new CastExpr(exp, Type.String));
}
}
return _type = Type.String;
@@ -251,9 +250,9 @@
il.append(DUP);
il.append(new INVOKESPECIAL(initBuffer));
// StringBuffer is on the stack
- final Enumeration elements = elements();
- while (elements.hasMoreElements()) {
- final Expression exp = (Expression)elements.nextElement();
+ final Iterator<SyntaxTreeNode> elements = elements();
+ while (elements.hasNext()) {
+ final Expression exp = (Expression)elements.next();
exp.translate(classGen, methodGen);
il.append(append);
}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/CastExpr.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/CastExpr.java
index 07809ef..e6f0b45 100644
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/CastExpr.java
+++ b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/CastExpr.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 2001-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,
@@ -51,7 +51,7 @@
/**
* Legal conversions between internal types.
*/
- static private MultiHashtable InternalTypeMap = new MultiHashtable();
+ private static final MultiHashtable<Type, Type> InternalTypeMap = new MultiHashtable<>();
static {
// Possible type conversions between internal types
@@ -118,6 +118,8 @@
InternalTypeMap.put(Type.Object, Type.String);
InternalTypeMap.put(Type.Void, Type.String);
+
+ InternalTypeMap.makeUnmodifiable();
}
private boolean _typeTest = false;
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Choose.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Choose.java
index 904b470..0e23819 100644
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Choose.java
+++ b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Choose.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
*
@@ -23,9 +23,6 @@
package com.sun.org.apache.xalan.internal.xsltc.compiler;
-import java.util.Enumeration;
-import java.util.Vector;
-
import com.sun.org.apache.bcel.internal.generic.BranchHandle;
import com.sun.org.apache.bcel.internal.generic.GOTO;
import com.sun.org.apache.bcel.internal.generic.IFEQ;
@@ -37,6 +34,9 @@
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Util;
+import java.util.Enumeration;
+import java.util.Iterator;
+import java.util.Vector;
/**
* @author Jacek Ambroziak
@@ -62,15 +62,15 @@
public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
final Vector whenElements = new Vector();
Otherwise otherwise = null;
- Enumeration elements = elements();
+ Iterator<SyntaxTreeNode> elements = elements();
// These two are for reporting errors only
ErrorMsg error = null;
final int line = getLineNumber();
// Traverse all child nodes - must be either When or Otherwise
- while (elements.hasMoreElements()) {
- Object element = elements.nextElement();
+ while (elements.hasNext()) {
+ SyntaxTreeNode element = elements.next();
// Add a When child element
if (element instanceof When) {
whenElements.addElement(element);
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/ForEach.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/ForEach.java
index ed33ca4..9b350d7 100644
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/ForEach.java
+++ b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/ForEach.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
*
@@ -23,9 +23,6 @@
package com.sun.org.apache.xalan.internal.xsltc.compiler;
-import java.util.Enumeration;
-import java.util.Vector;
-
import com.sun.org.apache.bcel.internal.generic.BranchHandle;
import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
import com.sun.org.apache.bcel.internal.generic.GOTO;
@@ -42,6 +39,8 @@
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Util;
+import java.util.Iterator;
+import java.util.Vector;
/**
* @author Jacek Ambroziak
@@ -97,9 +96,9 @@
// Collect sort objects associated with this instruction
final Vector sortObjects = new Vector();
- Enumeration children = elements();
- while (children.hasMoreElements()) {
- final Object child = children.nextElement();
+ Iterator<SyntaxTreeNode> children = elements();
+ while (children.hasNext()) {
+ final SyntaxTreeNode child = children.next();
if (child instanceof Sort) {
sortObjects.addElement(child);
}
@@ -187,7 +186,7 @@
MethodGenerator methodGen) {
final int n = elementCount();
for (int i = 0; i < n; i++) {
- final Object child = getContents().elementAt(i);
+ final SyntaxTreeNode child = getContents().get(i);
if (child instanceof Variable) {
Variable var = (Variable)child;
var.initialize(classGen, methodGen);
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/FunctionCall.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/FunctionCall.java
index 56bebd8..11b3241 100644
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/FunctionCall.java
+++ b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/FunctionCall.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 2001-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,
@@ -23,13 +23,6 @@
package com.sun.org.apache.xalan.internal.xsltc.compiler;
-import java.lang.reflect.Constructor;
-import java.lang.reflect.Method;
-import java.lang.reflect.Modifier;
-import java.util.Enumeration;
-import java.util.Hashtable;
-import java.util.Vector;
-
import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
import com.sun.org.apache.bcel.internal.generic.IFEQ;
import com.sun.org.apache.bcel.internal.generic.INVOKEINTERFACE;
@@ -43,6 +36,7 @@
import com.sun.org.apache.bcel.internal.generic.NEW;
import com.sun.org.apache.bcel.internal.generic.PUSH;
import com.sun.org.apache.xalan.internal.utils.FeatureManager;
+import com.sun.org.apache.xalan.internal.utils.ObjectFactory;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.BooleanType;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ErrorMsg;
@@ -54,8 +48,15 @@
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ReferenceType;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
-import com.sun.org.apache.xalan.internal.utils.ObjectFactory;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.Method;
+import java.lang.reflect.Modifier;
+import java.util.Collections;
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.Map;
import java.util.Objects;
+import java.util.Vector;
/**
* @author Jacek Ambroziak
@@ -104,6 +105,9 @@
protected final static String EXSLT_STRINGS =
"http://exslt.org/strings";
+ protected final static String XALAN_CLASSPACKAGE_NAMESPACE =
+ "xalan://";
+
// Namespace format constants
protected final static int NAMESPACE_FORMAT_JAVA = 0;
protected final static int NAMESPACE_FORMAT_CLASS = 1;
@@ -135,23 +139,23 @@
private boolean _isStatic = false;
// Legal conversions between internal and Java types.
- private static final MultiHashtable _internal2Java = new MultiHashtable();
+ private static final MultiHashtable<Type, JavaType> _internal2Java = new MultiHashtable<>();
// Legal conversions between Java and internal types.
- private static final Hashtable _java2Internal = new Hashtable();
+ private static final Map<Class<?>, Type> JAVA2INTERNAL;
// The mappings between EXSLT extension namespaces and implementation classes
- private static final Hashtable _extensionNamespaceTable = new Hashtable();
+ private static final Map<String, String> EXTENSIONNAMESPACE;
// Extension functions that are implemented in BasisLibrary
- private static final Hashtable _extensionFunctionTable = new Hashtable();
+ private static final Map<String, String> EXTENSIONFUNCTION;
/**
* inner class to used in internal2Java mappings, contains
* the Java type and the distance between the internal type and
* the Java type.
*/
static class JavaType {
- public Class type;
+ public Class<?> type;
public int distance;
public JavaType(Class type, int distance){
@@ -165,8 +169,15 @@
}
@Override
- public boolean equals(Object query){
- return query != null && query.equals(type);
+ public boolean equals(Object query) {
+ if (query == null) {
+ return false;
+ }
+ if (query.getClass().isAssignableFrom(JavaType.class)) {
+ return ((JavaType)query).type.equals(type);
+ } else {
+ return query.equals(type);
+ }
}
}
@@ -177,99 +188,112 @@
* These two tables are used when calling external (Java) functions.
*/
static {
+ final Class<?> nodeClass, nodeListClass;
try {
- final Class nodeClass = Class.forName("org.w3c.dom.Node");
- final Class nodeListClass = Class.forName("org.w3c.dom.NodeList");
-
- // -- Internal to Java --------------------------------------------
-
- // Type.Boolean -> { boolean(0), Boolean(1), Object(2) }
- _internal2Java.put(Type.Boolean, new JavaType(Boolean.TYPE, 0));
- _internal2Java.put(Type.Boolean, new JavaType(Boolean.class, 1));
- _internal2Java.put(Type.Boolean, new JavaType(Object.class, 2));
-
- // Type.Real -> { double(0), Double(1), float(2), long(3), int(4),
- // short(5), byte(6), char(7), Object(8) }
- _internal2Java.put(Type.Real, new JavaType(Double.TYPE, 0));
- _internal2Java.put(Type.Real, new JavaType(Double.class, 1));
- _internal2Java.put(Type.Real, new JavaType(Float.TYPE, 2));
- _internal2Java.put(Type.Real, new JavaType(Long.TYPE, 3));
- _internal2Java.put(Type.Real, new JavaType(Integer.TYPE, 4));
- _internal2Java.put(Type.Real, new JavaType(Short.TYPE, 5));
- _internal2Java.put(Type.Real, new JavaType(Byte.TYPE, 6));
- _internal2Java.put(Type.Real, new JavaType(Character.TYPE, 7));
- _internal2Java.put(Type.Real, new JavaType(Object.class, 8));
-
- // Type.Int must be the same as Type.Real
- _internal2Java.put(Type.Int, new JavaType(Double.TYPE, 0));
- _internal2Java.put(Type.Int, new JavaType(Double.class, 1));
- _internal2Java.put(Type.Int, new JavaType(Float.TYPE, 2));
- _internal2Java.put(Type.Int, new JavaType(Long.TYPE, 3));
- _internal2Java.put(Type.Int, new JavaType(Integer.TYPE, 4));
- _internal2Java.put(Type.Int, new JavaType(Short.TYPE, 5));
- _internal2Java.put(Type.Int, new JavaType(Byte.TYPE, 6));
- _internal2Java.put(Type.Int, new JavaType(Character.TYPE, 7));
- _internal2Java.put(Type.Int, new JavaType(Object.class, 8));
-
- // Type.String -> { String(0), Object(1) }
- _internal2Java.put(Type.String, new JavaType(String.class, 0));
- _internal2Java.put(Type.String, new JavaType(Object.class, 1));
-
- // Type.NodeSet -> { NodeList(0), Node(1), Object(2), String(3) }
- _internal2Java.put(Type.NodeSet, new JavaType(nodeListClass, 0));
- _internal2Java.put(Type.NodeSet, new JavaType(nodeClass, 1));
- _internal2Java.put(Type.NodeSet, new JavaType(Object.class, 2));
- _internal2Java.put(Type.NodeSet, new JavaType(String.class, 3));
-
- // Type.Node -> { Node(0), NodeList(1), Object(2), String(3) }
- _internal2Java.put(Type.Node, new JavaType(nodeListClass, 0));
- _internal2Java.put(Type.Node, new JavaType(nodeClass, 1));
- _internal2Java.put(Type.Node, new JavaType(Object.class, 2));
- _internal2Java.put(Type.Node, new JavaType(String.class, 3));
-
- // Type.ResultTree -> { NodeList(0), Node(1), Object(2), String(3) }
- _internal2Java.put(Type.ResultTree, new JavaType(nodeListClass, 0));
- _internal2Java.put(Type.ResultTree, new JavaType(nodeClass, 1));
- _internal2Java.put(Type.ResultTree, new JavaType(Object.class, 2));
- _internal2Java.put(Type.ResultTree, new JavaType(String.class, 3));
-
- _internal2Java.put(Type.Reference, new JavaType(Object.class, 0));
-
- // Possible conversions between Java and internal types
- _java2Internal.put(Boolean.TYPE, Type.Boolean);
- _java2Internal.put(Void.TYPE, Type.Void);
- _java2Internal.put(Character.TYPE, Type.Real);
- _java2Internal.put(Byte.TYPE, Type.Real);
- _java2Internal.put(Short.TYPE, Type.Real);
- _java2Internal.put(Integer.TYPE, Type.Real);
- _java2Internal.put(Long.TYPE, Type.Real);
- _java2Internal.put(Float.TYPE, Type.Real);
- _java2Internal.put(Double.TYPE, Type.Real);
-
- _java2Internal.put(String.class, Type.String);
-
- _java2Internal.put(Object.class, Type.Reference);
-
- // Conversions from org.w3c.dom.Node/NodeList to internal NodeSet
- _java2Internal.put(nodeListClass, Type.NodeSet);
- _java2Internal.put(nodeClass, Type.NodeSet);
-
- // Initialize the extension namespace table
- _extensionNamespaceTable.put(EXT_XALAN, "com.sun.org.apache.xalan.internal.lib.Extensions");
- _extensionNamespaceTable.put(EXSLT_COMMON, "com.sun.org.apache.xalan.internal.lib.ExsltCommon");
- _extensionNamespaceTable.put(EXSLT_MATH, "com.sun.org.apache.xalan.internal.lib.ExsltMath");
- _extensionNamespaceTable.put(EXSLT_SETS, "com.sun.org.apache.xalan.internal.lib.ExsltSets");
- _extensionNamespaceTable.put(EXSLT_DATETIME, "com.sun.org.apache.xalan.internal.lib.ExsltDatetime");
- _extensionNamespaceTable.put(EXSLT_STRINGS, "com.sun.org.apache.xalan.internal.lib.ExsltStrings");
-
- // Initialize the extension function table
- _extensionFunctionTable.put(EXSLT_COMMON + ":nodeSet", "nodeset");
- _extensionFunctionTable.put(EXSLT_COMMON + ":objectType", "objectType");
- _extensionFunctionTable.put(EXT_XALAN + ":nodeset", "nodeset");
+ nodeClass = Class.forName("org.w3c.dom.Node");
+ nodeListClass = Class.forName("org.w3c.dom.NodeList");
}
catch (ClassNotFoundException e) {
- System.err.println(e);
+ ErrorMsg err = new ErrorMsg(ErrorMsg.CLASS_NOT_FOUND_ERR,"org.w3c.dom.Node or NodeList");
+ throw new ExceptionInInitializerError(err.toString());
}
+
+ // -- Internal to Java --------------------------------------------
+
+ // Type.Boolean -> { boolean(0), Boolean(1), Object(2) }
+ _internal2Java.put(Type.Boolean, new JavaType(Boolean.TYPE, 0));
+ _internal2Java.put(Type.Boolean, new JavaType(Boolean.class, 1));
+ _internal2Java.put(Type.Boolean, new JavaType(Object.class, 2));
+
+ // Type.Real -> { double(0), Double(1), float(2), long(3), int(4),
+ // short(5), byte(6), char(7), Object(8) }
+ _internal2Java.put(Type.Real, new JavaType(Double.TYPE, 0));
+ _internal2Java.put(Type.Real, new JavaType(Double.class, 1));
+ _internal2Java.put(Type.Real, new JavaType(Float.TYPE, 2));
+ _internal2Java.put(Type.Real, new JavaType(Long.TYPE, 3));
+ _internal2Java.put(Type.Real, new JavaType(Integer.TYPE, 4));
+ _internal2Java.put(Type.Real, new JavaType(Short.TYPE, 5));
+ _internal2Java.put(Type.Real, new JavaType(Byte.TYPE, 6));
+ _internal2Java.put(Type.Real, new JavaType(Character.TYPE, 7));
+ _internal2Java.put(Type.Real, new JavaType(Object.class, 8));
+
+ // Type.Int must be the same as Type.Real
+ _internal2Java.put(Type.Int, new JavaType(Double.TYPE, 0));
+ _internal2Java.put(Type.Int, new JavaType(Double.class, 1));
+ _internal2Java.put(Type.Int, new JavaType(Float.TYPE, 2));
+ _internal2Java.put(Type.Int, new JavaType(Long.TYPE, 3));
+ _internal2Java.put(Type.Int, new JavaType(Integer.TYPE, 4));
+ _internal2Java.put(Type.Int, new JavaType(Short.TYPE, 5));
+ _internal2Java.put(Type.Int, new JavaType(Byte.TYPE, 6));
+ _internal2Java.put(Type.Int, new JavaType(Character.TYPE, 7));
+ _internal2Java.put(Type.Int, new JavaType(Object.class, 8));
+
+ // Type.String -> { String(0), Object(1) }
+ _internal2Java.put(Type.String, new JavaType(String.class, 0));
+ _internal2Java.put(Type.String, new JavaType(Object.class, 1));
+
+ // Type.NodeSet -> { NodeList(0), Node(1), Object(2), String(3) }
+ _internal2Java.put(Type.NodeSet, new JavaType(nodeListClass, 0));
+ _internal2Java.put(Type.NodeSet, new JavaType(nodeClass, 1));
+ _internal2Java.put(Type.NodeSet, new JavaType(Object.class, 2));
+ _internal2Java.put(Type.NodeSet, new JavaType(String.class, 3));
+
+ // Type.Node -> { Node(0), NodeList(1), Object(2), String(3) }
+ _internal2Java.put(Type.Node, new JavaType(nodeListClass, 0));
+ _internal2Java.put(Type.Node, new JavaType(nodeClass, 1));
+ _internal2Java.put(Type.Node, new JavaType(Object.class, 2));
+ _internal2Java.put(Type.Node, new JavaType(String.class, 3));
+
+ // Type.ResultTree -> { NodeList(0), Node(1), Object(2), String(3) }
+ _internal2Java.put(Type.ResultTree, new JavaType(nodeListClass, 0));
+ _internal2Java.put(Type.ResultTree, new JavaType(nodeClass, 1));
+ _internal2Java.put(Type.ResultTree, new JavaType(Object.class, 2));
+ _internal2Java.put(Type.ResultTree, new JavaType(String.class, 3));
+
+ _internal2Java.put(Type.Reference, new JavaType(Object.class, 0));
+
+ _internal2Java.makeUnmodifiable();
+
+ Map<Class<?>, Type> java2Internal = new HashMap<>();
+ Map<String, String> extensionNamespaceTable = new HashMap<>();
+ Map<String, String> extensionFunctionTable = new HashMap<>();
+
+ // Possible conversions between Java and internal types
+ java2Internal.put(Boolean.TYPE, Type.Boolean);
+ java2Internal.put(Void.TYPE, Type.Void);
+ java2Internal.put(Character.TYPE, Type.Real);
+ java2Internal.put(Byte.TYPE, Type.Real);
+ java2Internal.put(Short.TYPE, Type.Real);
+ java2Internal.put(Integer.TYPE, Type.Real);
+ java2Internal.put(Long.TYPE, Type.Real);
+ java2Internal.put(Float.TYPE, Type.Real);
+ java2Internal.put(Double.TYPE, Type.Real);
+
+ java2Internal.put(String.class, Type.String);
+
+ java2Internal.put(Object.class, Type.Reference);
+
+ // Conversions from org.w3c.dom.Node/NodeList to internal NodeSet
+ java2Internal.put(nodeListClass, Type.NodeSet);
+ java2Internal.put(nodeClass, Type.NodeSet);
+
+ // Initialize the extension namespace table
+ extensionNamespaceTable.put(EXT_XALAN, "com.sun.org.apache.xalan.internal.lib.Extensions");
+ extensionNamespaceTable.put(EXSLT_COMMON, "com.sun.org.apache.xalan.internal.lib.ExsltCommon");
+ extensionNamespaceTable.put(EXSLT_MATH, "com.sun.org.apache.xalan.internal.lib.ExsltMath");
+ extensionNamespaceTable.put(EXSLT_SETS, "com.sun.org.apache.xalan.internal.lib.ExsltSets");
+ extensionNamespaceTable.put(EXSLT_DATETIME, "com.sun.org.apache.xalan.internal.lib.ExsltDatetime");
+ extensionNamespaceTable.put(EXSLT_STRINGS, "com.sun.org.apache.xalan.internal.lib.ExsltStrings");
+
+ // Initialize the extension function table
+ extensionFunctionTable.put(EXSLT_COMMON + ":nodeSet", "nodeset");
+ extensionFunctionTable.put(EXSLT_COMMON + ":objectType", "objectType");
+ extensionFunctionTable.put(EXT_XALAN + ":nodeset", "nodeset");
+
+ JAVA2INTERNAL = Collections.unmodifiableMap(java2Internal);
+ EXTENSIONNAMESPACE = Collections.unmodifiableMap(extensionNamespaceTable);
+ EXTENSIONFUNCTION = Collections.unmodifiableMap(extensionFunctionTable);
+
}
public FunctionCall(QName fname, Vector arguments) {
@@ -301,7 +325,7 @@
public String getClassNameFromUri(String uri)
{
- String className = (String)_extensionNamespaceTable.get(uri);
+ String className = EXTENSIONNAMESPACE.get(uri);
if (className != null)
return className;
@@ -381,7 +405,7 @@
local = replaceDash(local);
}
- String extFunction = (String)_extensionFunctionTable.get(namespace + ":" + local);
+ String extFunction = EXTENSIONFUNCTION.get(namespace + ":" + local);
if (extFunction != null) {
_fname = new QName(null, null, extFunction);
return typeCheckStandard(stable);
@@ -461,15 +485,15 @@
(Constructor)constructors.elementAt(i);
final Class[] paramTypes = constructor.getParameterTypes();
- Class extType = null;
+ Class<?> extType;
int currConstrDistance = 0;
for (j = 0; j < nArgs; j++) {
// Convert from internal (translet) type to external (Java) type
extType = paramTypes[j];
final Type intType = (Type)argsType.elementAt(j);
- Object match = _internal2Java.maps(intType, extType);
+ JavaType match = _internal2Java.maps(intType, new JavaType(extType, 0));
if (match != null) {
- currConstrDistance += ((JavaType)match).distance;
+ currConstrDistance += match.distance;
}
else if (intType instanceof ObjectType) {
ObjectType objectType = (ObjectType)intType;
@@ -594,9 +618,9 @@
// Convert from internal (translet) type to external (Java) type
extType = paramTypes[j];
final Type intType = (Type)argsType.elementAt(j);
- Object match = _internal2Java.maps(intType, extType);
+ JavaType match = _internal2Java.maps(intType, new JavaType(extType, 0));
if (match != null) {
- currMethodDistance += ((JavaType)match).distance;
+ currMethodDistance += match.distance;
}
else {
// no mapping available
@@ -628,7 +652,7 @@
// Check if the return type can be converted
extType = method.getReturnType();
- _type = (Type) _java2Internal.get(extType);
+ _type = JAVA2INTERNAL.get(extType);
if (_type == null) {
_type = Type.newObjectType(extType);
}
@@ -900,8 +924,22 @@
if (_className != null && _className.length() > 0) {
final int nArgs = _arguments.size();
try {
- if (_clazz == null) {
- _clazz = ObjectFactory.findProviderClass(_className, true);
+ if (_clazz == null) {
+ final boolean isSecureProcessing = getXSLTC().isSecureProcessing();
+ final boolean isExtensionFunctionEnabled = getXSLTC()
+ .getFeature(FeatureManager.Feature.ORACLE_ENABLE_EXTENSION_FUNCTION);
+
+ //Check if FSP and SM - only then proceed with loading
+ if (namespace != null && isSecureProcessing
+ && isExtensionFunctionEnabled
+ && (namespace.startsWith(JAVA_EXT_XALAN)
+ || namespace.startsWith(JAVA_EXT_XSLTC)
+ || namespace.startsWith(JAVA_EXT_XALAN_OLD)
+ || namespace.startsWith(XALAN_CLASSPACKAGE_NAMESPACE))) {
+ _clazz = getXSLTC().loadExternalFunction(_className);
+ } else {
+ _clazz = ObjectFactory.findProviderClass(_className, true);
+ }
if (_clazz == null) {
final ErrorMsg msg =
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Import.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Import.java
index e1971d3..5207f38 100644
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Import.java
+++ b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Import.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 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
*
@@ -31,10 +31,7 @@
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
import com.sun.org.apache.xml.internal.utils.SystemIDResolver;
-import java.io.File;
-import java.net.URL;
-import java.net.MalformedURLException;
-import java.util.Enumeration;
+import java.util.Iterator;
import javax.xml.XMLConstants;
import org.xml.sax.InputSource;
import org.xml.sax.XMLReader;
@@ -133,10 +130,10 @@
parser.setCurrentStylesheet(_imported);
_imported.parseContents(parser);
- final Enumeration elements = _imported.elements();
+ final Iterator<SyntaxTreeNode> elements = _imported.elements();
final Stylesheet topStylesheet = parser.getTopLevelStylesheet();
- while (elements.hasMoreElements()) {
- final Object element = elements.nextElement();
+ while (elements.hasNext()) {
+ final SyntaxTreeNode element = elements.next();
if (element instanceof TopLevelElement) {
if (element instanceof Variable) {
topStylesheet.addVariable((Variable) element);
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Include.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Include.java
index 5bf12f8..29d07d4 100644
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Include.java
+++ b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Include.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 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
*
@@ -31,11 +31,7 @@
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
import com.sun.org.apache.xml.internal.utils.SystemIDResolver;
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.Enumeration;
+import java.util.Iterator;
import javax.xml.XMLConstants;
import org.xml.sax.InputSource;
import org.xml.sax.XMLReader;
@@ -133,10 +129,10 @@
parser.setCurrentStylesheet(_included);
_included.parseContents(parser);
- final Enumeration elements = _included.elements();
+ final Iterator<SyntaxTreeNode> elements = _included.elements();
final Stylesheet topStylesheet = parser.getTopLevelStylesheet();
- while (elements.hasMoreElements()) {
- final Object element = elements.nextElement();
+ while (elements.hasNext()) {
+ final SyntaxTreeNode element = elements.next();
if (element instanceof TopLevelElement) {
if (element instanceof Variable) {
topStylesheet.addVariable((Variable) element);
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Key.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Key.java
index 82dbffb..fbedcc3 100644
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Key.java
+++ b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Key.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 2001-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,
@@ -23,8 +23,6 @@
package com.sun.org.apache.xalan.internal.xsltc.compiler;
-import java.util.Vector;
-
import com.sun.org.apache.bcel.internal.generic.BranchHandle;
import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
import com.sun.org.apache.bcel.internal.generic.GOTO;
@@ -226,7 +224,7 @@
// AbstractTranslet.buildKeyIndex(name,node_id,value) => void
final int key = cpg.addMethodref(TRANSLET_CLASS,
"buildKeyIndex",
- "("+STRING_SIG+"I"+OBJECT_SIG+")V");
+ "("+STRING_SIG+"I"+STRING_SIG+")V");
// AbstractTranslet.SetKeyIndexDom(name, Dom) => void
final int keyDom = cpg.addMethodref(TRANSLET_CLASS,
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/LiteralElement.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/LiteralElement.java
index e9a0c84..5e8e742 100644
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/LiteralElement.java
+++ b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/LiteralElement.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 2001-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,
@@ -23,10 +23,6 @@
package com.sun.org.apache.xalan.internal.xsltc.compiler;
-import java.util.Enumeration;
-import java.util.Hashtable;
-import java.util.Vector;
-
import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
import com.sun.org.apache.bcel.internal.generic.InstructionList;
import com.sun.org.apache.bcel.internal.generic.PUSH;
@@ -36,9 +32,13 @@
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Util;
-
import com.sun.org.apache.xml.internal.serializer.ElemDesc;
import com.sun.org.apache.xml.internal.serializer.ToHTMLStream;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
/**
* @author Jacek Ambroziak
@@ -49,8 +49,8 @@
private String _name;
private LiteralElement _literalElemParent = null;
- private Vector _attributeElements = null;
- private Hashtable _accessedPrefixes = null;
+ private List<SyntaxTreeNode> _attributeElements = null;
+ private Map<String, String> _accessedPrefixes = null;
// True if all attributes of this LRE are unique, i.e. they all have
// different names. This flag is set to false if some attribute
@@ -85,14 +85,13 @@
return result;
}
}
- return _accessedPrefixes != null ?
- (String) _accessedPrefixes.get(prefix) : null;
+ return _accessedPrefixes != null ? _accessedPrefixes.get(prefix) : null;
}
/**
* Method used to keep track of what namespaces that are references by
* this literal element and its attributes. The output must contain a
- * definition for each namespace, so we stuff them in a hashtable.
+ * definition for each namespace, so we stuff them in a map.
*/
public void registerNamespace(String prefix, String uri,
SymbolTable stable, boolean declared) {
@@ -107,12 +106,12 @@
// Check if we have any declared namesaces
if (_accessedPrefixes == null) {
- _accessedPrefixes = new Hashtable();
+ _accessedPrefixes = new HashMap<>();
}
else {
if (!declared) {
// Check if this node has a declaration for this namespace
- final String old = (String)_accessedPrefixes.get(prefix);
+ final String old = _accessedPrefixes.get(prefix);
if (old != null) {
if (old.equals(uri))
return;
@@ -169,7 +168,7 @@
*/
public void addAttribute(SyntaxTreeNode attribute) {
if (_attributeElements == null) {
- _attributeElements = new Vector(2);
+ _attributeElements = new ArrayList<>(2);
}
_attributeElements.add(attribute);
}
@@ -179,9 +178,9 @@
*/
public void setFirstAttribute(SyntaxTreeNode attribute) {
if (_attributeElements == null) {
- _attributeElements = new Vector(2);
+ _attributeElements = new ArrayList<>(2);
}
- _attributeElements.insertElementAt(attribute,0);
+ _attributeElements.add(0, attribute);
}
/**
@@ -191,10 +190,7 @@
public Type typeCheck(SymbolTable stable) throws TypeCheckError {
// Type-check all attributes
if (_attributeElements != null) {
- final int count = _attributeElements.size();
- for (int i = 0; i < count; i++) {
- SyntaxTreeNode node =
- (SyntaxTreeNode)_attributeElements.elementAt(i);
+ for (SyntaxTreeNode node : _attributeElements) {
node.typeCheck(stable);
}
}
@@ -207,15 +203,13 @@
* and assembles a list of all prefixes that (for the given node) maps
* to _ANY_ namespace URI. Used by literal result elements to determine
*/
- public Enumeration getNamespaceScope(SyntaxTreeNode node) {
- Hashtable all = new Hashtable();
+ public Set<Map.Entry<String, String>> getNamespaceScope(SyntaxTreeNode node) {
+ Map<String, String> all = new HashMap<>();
while (node != null) {
- Hashtable mapping = node.getPrefixMapping();
+ Map<String, String> mapping = node.getPrefixMapping();
if (mapping != null) {
- Enumeration prefixes = mapping.keys();
- while (prefixes.hasMoreElements()) {
- String prefix = (String)prefixes.nextElement();
+ for( String prefix : mapping.keySet()) {
if (!all.containsKey(prefix)) {
all.put(prefix, mapping.get(prefix));
}
@@ -223,7 +217,7 @@
}
node = node.getParent();
}
- return(all.keys());
+ return all.entrySet();
}
/**
@@ -288,9 +282,9 @@
// Register all namespaces that are in scope, except for those that
// are listed in the xsl:stylesheet element's *-prefixes attributes
- final Enumeration include = getNamespaceScope(this);
- while (include.hasMoreElements()) {
- final String prefix = (String)include.nextElement();
+ Set<Map.Entry<String, String>> include = getNamespaceScope(this);
+ for (Map.Entry<String, String> entry : include) {
+ final String prefix = entry.getKey();
if (!prefix.equals("xml")) {
final String uri = lookupNamespace(prefix);
if (uri != null && !stable.isExcludedNamespace(uri)) {
@@ -356,11 +350,10 @@
// Compile code to emit namespace attributes
if (_accessedPrefixes != null) {
boolean declaresDefaultNS = false;
- Enumeration e = _accessedPrefixes.keys();
- while (e.hasMoreElements()) {
- final String prefix = (String)e.nextElement();
- final String uri = (String)_accessedPrefixes.get(prefix);
+ for (Map.Entry<String, String> entry : _accessedPrefixes.entrySet()) {
+ final String prefix = entry.getKey();
+ final String uri = entry.getValue();
if (uri != Constants.EMPTYSTRING ||
prefix != Constants.EMPTYSTRING)
@@ -391,10 +384,7 @@
// Output all attributes
if (_attributeElements != null) {
- final int count = _attributeElements.size();
- for (int i = 0; i < count; i++) {
- SyntaxTreeNode node =
- (SyntaxTreeNode)_attributeElements.elementAt(i);
+ for (SyntaxTreeNode node : _attributeElements) {
if (!(node instanceof XslAttribute)) {
node.translate(classGen, methodGen);
}
@@ -445,18 +435,18 @@
if (_attributeElements != null) {
int numAttrs = _attributeElements.size();
- Hashtable attrsTable = null;
+ Map<String, SyntaxTreeNode> attrsTable = null;
for (int i = 0; i < numAttrs; i++) {
- SyntaxTreeNode node = (SyntaxTreeNode)_attributeElements.elementAt(i);
+ SyntaxTreeNode node = _attributeElements.get(i);
if (node instanceof UseAttributeSets) {
return false;
}
else if (node instanceof XslAttribute) {
if (attrsTable == null) {
- attrsTable = new Hashtable();
+ attrsTable = new HashMap<>();
for (int k = 0; k < i; k++) {
- SyntaxTreeNode n = (SyntaxTreeNode)_attributeElements.elementAt(k);
+ SyntaxTreeNode n = _attributeElements.get(k);
if (n instanceof LiteralAttribute) {
LiteralAttribute literalAttr = (LiteralAttribute)n;
attrsTable.put(literalAttr.getName(), literalAttr);
@@ -491,10 +481,8 @@
* <xsl:attribute> children of the current node are not included in the check.
*/
private boolean canProduceAttributeNodes(SyntaxTreeNode node, boolean ignoreXslAttribute) {
- Vector contents = node.getContents();
- int size = contents.size();
- for (int i = 0; i < size; i++) {
- SyntaxTreeNode child = (SyntaxTreeNode)contents.elementAt(i);
+ List<SyntaxTreeNode> contents = node.getContents();
+ for (SyntaxTreeNode child : contents) {
if (child instanceof Text) {
Text text = (Text)child;
if (text.isIgnore())
@@ -532,10 +520,8 @@
return true;
}
else if (child instanceof Choose) {
- Vector chooseContents = child.getContents();
- int num = chooseContents.size();
- for (int k = 0; k < num; k++) {
- SyntaxTreeNode chooseChild = (SyntaxTreeNode)chooseContents.elementAt(k);
+ List<SyntaxTreeNode> chooseContents = child.getContents();
+ for (SyntaxTreeNode chooseChild : chooseContents) {
if (chooseChild instanceof When || chooseChild instanceof Otherwise) {
if (canProduceAttributeNodes(chooseChild, false))
return true;
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Mode.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Mode.java
index 66f7a95..7fb86be 100644
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Mode.java
+++ b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Mode.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
*
@@ -23,12 +23,6 @@
package com.sun.org.apache.xalan.internal.xsltc.compiler;
-import java.util.Enumeration;
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.Vector;
-
-import com.sun.org.apache.bcel.internal.generic.Instruction;
import com.sun.org.apache.bcel.internal.generic.BranchHandle;
import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
import com.sun.org.apache.bcel.internal.generic.DUP;
@@ -38,6 +32,7 @@
import com.sun.org.apache.bcel.internal.generic.INVOKEINTERFACE;
import com.sun.org.apache.bcel.internal.generic.INVOKEVIRTUAL;
import com.sun.org.apache.bcel.internal.generic.ISTORE;
+import com.sun.org.apache.bcel.internal.generic.Instruction;
import com.sun.org.apache.bcel.internal.generic.InstructionHandle;
import com.sun.org.apache.bcel.internal.generic.InstructionList;
import com.sun.org.apache.bcel.internal.generic.LocalVariableGen;
@@ -51,6 +46,12 @@
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Util;
import com.sun.org.apache.xml.internal.dtm.Axis;
import com.sun.org.apache.xml.internal.dtm.DTM;
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Set;
+import java.util.Vector;
/**
* Mode gathers all the templates belonging to a given mode;
@@ -128,22 +129,22 @@
/**
* A mapping between templates and test sequences.
*/
- private Hashtable _neededTemplates = new Hashtable();
+ private Map<Template, Object> _neededTemplates = new HashMap<>();
/**
* A mapping between named templates and Mode objects.
*/
- private Hashtable _namedTemplates = new Hashtable();
+ private Map<Template, Mode> _namedTemplates = new HashMap<>();
/**
* A mapping between templates and instruction handles.
*/
- private Hashtable _templateIHs = new Hashtable();
+ private Map<Template, InstructionHandle> _templateIHs = new HashMap<>();
/**
* A mapping between templates and instruction lists.
*/
- private Hashtable _templateILs = new Hashtable();
+ private Map<Template, InstructionList> _templateILs = new HashMap<>();
/**
* A reference to the pattern matching the root node.
@@ -152,14 +153,14 @@
/**
* Stores ranges of template precendences for the compilation
- * of apply-imports (a Hashtable for historical reasons).
+ * of apply-imports.
*/
- private Hashtable _importLevels = null;
+ private Map<Integer, Integer> _importLevels = null;
/**
* A mapping between key names and keys.
*/
- private Hashtable _keys = null;
+ private Map<String, Key> _keys = null;
/**
* Variable index for the current node used in code generation.
@@ -195,9 +196,9 @@
public String functionName(int min, int max) {
if (_importLevels == null) {
- _importLevels = new Hashtable();
+ _importLevels = new HashMap<>();
}
- _importLevels.put(new Integer(max), new Integer(min));
+ _importLevels.put(max, min);
return _methodName + '_' + max;
}
@@ -244,7 +245,7 @@
/**
* Process all the test patterns in this mode
*/
- public void processPatterns(Hashtable keys) {
+ public void processPatterns(Map<String, Key> keys) {
_keys = keys;
/*
@@ -300,7 +301,7 @@
*/
private void flattenAlternative(Pattern pattern,
Template template,
- Hashtable keys) {
+ Map<String, Key> keys) {
// Patterns on type id() and key() are special since they do not have
// any kernel node type (it can be anything as long as the node is in
// the id's or key's index).
@@ -560,15 +561,13 @@
MethodGenerator methodGen,
InstructionHandle next)
{
- Enumeration templates = _namedTemplates.keys();
- while (templates.hasMoreElements()) {
- final Template template = (Template)templates.nextElement();
+ Set<Template> templates = _namedTemplates.keySet();
+ for (Template template : templates) {
compileNamedTemplate(template, classGen);
}
- templates = _neededTemplates.keys();
- while (templates.hasMoreElements()) {
- final Template template = (Template)templates.nextElement();
+ templates = _neededTemplates.keySet();
+ for (Template template : templates) {
if (template.hasContents()) {
// !!! TODO templates both named and matched
InstructionList til = template.compile(classGen, methodGen);
@@ -584,13 +583,12 @@
}
private void appendTemplateCode(InstructionList body) {
- final Enumeration templates = _neededTemplates.keys();
- while (templates.hasMoreElements()) {
- final Object iList =
- _templateILs.get(templates.nextElement());
+ for (Template template : _neededTemplates.keySet()) {
+ final InstructionList iList = _templateILs.get(template);
if (iList != null) {
- body.append((InstructionList)iList);
+ body.append(iList);
}
+
}
}
@@ -1043,11 +1041,8 @@
// Compile method(s) for <xsl:apply-imports/> for this mode
if (_importLevels != null) {
- Enumeration levels = _importLevels.keys();
- while (levels.hasMoreElements()) {
- Integer max = (Integer)levels.nextElement();
- Integer min = (Integer)_importLevels.get(max);
- compileApplyImports(classGen, min.intValue(), max.intValue());
+ for (Map.Entry<Integer, Integer> entry : _importLevels.entrySet()) {
+ compileApplyImports(classGen, entry.getValue(), entry.getKey());
}
}
}
@@ -1055,9 +1050,7 @@
private void compileTemplateCalls(ClassGenerator classGen,
MethodGenerator methodGen,
InstructionHandle next, int min, int max){
- Enumeration templates = _neededTemplates.keys();
- while (templates.hasMoreElements()) {
- final Template template = (Template)templates.nextElement();
+ for (Template template : _neededTemplates.keySet()) {
final int prec = template.getImportPrecedence();
if ((prec >= min) && (prec < max)) {
if (template.hasContents()) {
@@ -1081,10 +1074,10 @@
final Vector names = xsltc.getNamesIndex();
// Clear some datastructures
- _namedTemplates = new Hashtable();
- _neededTemplates = new Hashtable();
- _templateIHs = new Hashtable();
- _templateILs = new Hashtable();
+ _namedTemplates = new HashMap<>();
+ _neededTemplates = new HashMap<>();
+ _templateIHs = new HashMap<>();
+ _templateILs = new HashMap<>();
_patternGroups = new Vector[32];
_rootPattern = null;
@@ -1503,7 +1496,7 @@
}
public InstructionHandle getTemplateInstructionHandle(Template template) {
- return (InstructionHandle)_templateIHs.get(template);
+ return _templateIHs.get(template);
}
/**
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Parser.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Parser.java
index 0903d9a..2584f43 100644
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Parser.java
+++ b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Parser.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
*
@@ -37,9 +37,10 @@
import java.io.File;
import java.io.IOException;
import java.io.StringReader;
-import java.util.Dictionary;
-import java.util.Enumeration;
-import java.util.Hashtable;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
import java.util.Properties;
import java.util.Stack;
import java.util.StringTokenizer;
@@ -77,14 +78,14 @@
private Vector _errors; // Contains all compilation errors
private Vector _warnings; // Contains all compilation errors
- private Hashtable _instructionClasses; // Maps instructions to classes
- private Hashtable _instructionAttrs;; // reqd and opt attrs
- private Hashtable _qNames;
- private Hashtable _namespaces;
+ private Map<String, String> _instructionClasses; // Maps instructions to classes
+ private Map<String, String[]> _instructionAttrs; // reqd and opt attrs
+ private Map<String, QName> _qNames;
+ private Map<String, Map> _namespaces;
private QName _useAttributeSets;
private QName _excludeResultPrefixes;
private QName _extensionElementPrefixes;
- private Hashtable _variableScope;
+ private Map<String, Object> _variableScope;
private Stylesheet _currentStylesheet;
private SymbolTable _symbolTable; // Maps QNames to syntax-tree nodes
private Output _output;
@@ -106,11 +107,11 @@
}
public void init() {
- _qNames = new Hashtable(512);
- _namespaces = new Hashtable();
- _instructionClasses = new Hashtable();
- _instructionAttrs = new Hashtable();
- _variableScope = new Hashtable();
+ _qNames = new HashMap<>(512);
+ _namespaces = new HashMap<>();
+ _instructionClasses = new HashMap<>();
+ _instructionAttrs = new HashMap<>();
+ _variableScope = new HashMap<>();
_template = null;
_errors = new Vector();
_warnings = new Vector();
@@ -169,7 +170,7 @@
}
private void addVariableOrParam(VariableBase var) {
- Object existing = _variableScope.get(var.getName());
+ Object existing = _variableScope.get(var.getName().getStringRep());
if (existing != null) {
if (existing instanceof Stack) {
Stack stack = (Stack)existing;
@@ -179,26 +180,26 @@
Stack stack = new Stack();
stack.push(existing);
stack.push(var);
- _variableScope.put(var.getName(), stack);
+ _variableScope.put(var.getName().getStringRep(), stack);
}
}
else {
- _variableScope.put(var.getName(), var);
+ _variableScope.put(var.getName().getStringRep(), var);
}
}
public void removeVariable(QName name) {
- Object existing = _variableScope.get(name);
+ Object existing = _variableScope.get(name.getStringRep());
if (existing instanceof Stack) {
Stack stack = (Stack)existing;
if (!stack.isEmpty()) stack.pop();
if (!stack.isEmpty()) return;
}
- _variableScope.remove(name);
+ _variableScope.remove(name.getStringRep());
}
public VariableBase lookupVariable(QName name) {
- Object existing = _variableScope.get(name);
+ Object existing = _variableScope.get(name.getStringRep());
if (existing instanceof VariableBase) {
return((VariableBase)existing);
}
@@ -305,7 +306,7 @@
public QName getQName(String namespace, String prefix, String localname) {
if (namespace == null || namespace.equals(EMPTYSTRING)) {
- QName name = (QName)_qNames.get(localname);
+ QName name = _qNames.get(localname);
if (name == null) {
name = new QName(null, prefix, localname);
_qNames.put(localname, name);
@@ -313,7 +314,7 @@
return name;
}
else {
- Dictionary space = (Dictionary)_namespaces.get(namespace);
+ Map<String, QName> space = _namespaces.get(namespace);
String lexicalQName =
(prefix == null || prefix.length() == 0)
? localname
@@ -321,12 +322,12 @@
if (space == null) {
final QName name = new QName(namespace, prefix, localname);
- _namespaces.put(namespace, space = new Hashtable());
+ _namespaces.put(namespace, space = new HashMap<>());
space.put(lexicalQName, name);
return name;
}
else {
- QName name = (QName)space.get(lexicalQName);
+ QName name = space.get(lexicalQName);
if (name == null) {
name = new QName(namespace, prefix, localname);
space.put(lexicalQName, name);
@@ -397,9 +398,9 @@
if (stylesheet != null) {
stylesheet.parseContents(this);
final int precedence = stylesheet.getImportPrecedence();
- final Enumeration elements = stylesheet.elements();
- while (elements.hasMoreElements()) {
- Object child = elements.nextElement();
+ final Iterator<SyntaxTreeNode> elements = stylesheet.elements();
+ while (elements.hasNext()) {
+ SyntaxTreeNode child = elements.next();
if (child instanceof Text) {
final int l = getLineNumber();
ErrorMsg err =
@@ -609,11 +610,11 @@
String id = root.getAttribute("id");
if (id.equals(href)) return root;
}
- Vector children = root.getContents();
+ List<SyntaxTreeNode> children = root.getContents();
if (children != null) {
final int count = children.size();
for (int i = 0; i < count; i++) {
- SyntaxTreeNode child = (SyntaxTreeNode)children.elementAt(i);
+ SyntaxTreeNode child = children.get(i);
SyntaxTreeNode node = findStylesheet(child, href);
if (node != null) return node;
}
@@ -640,7 +641,7 @@
}
private void initAttrTable(String elementName, String[] attrs) {
- _instructionAttrs.put(getQName(XSLT_URI, XSL, elementName),
+ _instructionAttrs.put(getQName(XSLT_URI, XSL, elementName).getStringRep(),
attrs);
}
@@ -704,7 +705,7 @@
/**
- * Initialize the _instructionClasses Hashtable, which maps XSL element
+ * Initialize the _instructionClasses map, which maps XSL element
* names to Java classes in this package.
*/
private void initStdClasses() {
@@ -746,12 +747,12 @@
}
private void initStdClass(String elementName, String className) {
- _instructionClasses.put(getQName(XSLT_URI, XSL, elementName),
+ _instructionClasses.put(getQName(XSLT_URI, XSL, elementName).getStringRep(),
COMPILER_PACKAGE + '.' + className);
}
public boolean elementSupported(String namespace, String localName) {
- return(_instructionClasses.get(getQName(namespace, XSL, localName)) != null);
+ return(_instructionClasses.get(getQName(namespace, XSL, localName).getStringRep()) != null);
}
public boolean functionSupported(String fname) {
@@ -764,12 +765,12 @@
}
private void initExtClass(String elementName, String className) {
- _instructionClasses.put(getQName(TRANSLET_URI, TRANSLET, elementName),
+ _instructionClasses.put(getQName(TRANSLET_URI, TRANSLET, elementName).getStringRep(),
COMPILER_PACKAGE + '.' + className);
}
private void initExtClass(String namespace, String elementName, String className) {
- _instructionClasses.put(getQName(namespace, TRANSLET, elementName),
+ _instructionClasses.put(getQName(namespace, TRANSLET, elementName).getStringRep(),
COMPILER_PACKAGE + '.' + className);
}
@@ -969,7 +970,7 @@
{
SyntaxTreeNode node = null;
QName qname = getQName(uri, prefix, local);
- String className = (String)_instructionClasses.get(qname);
+ String className = _instructionClasses.get(qname.getStringRep());
if (className != null) {
try {
@@ -1052,7 +1053,7 @@
{
QName qname = node.getQName();
boolean isStylesheet = (node instanceof Stylesheet);
- String[] legal = (String[]) _instructionAttrs.get(qname);
+ String[] legal = _instructionAttrs.get(qname.getStringRep());
if (versionIsOne && legal != null) {
int j;
final int n = attrs.getLength();
@@ -1250,7 +1251,7 @@
/************************ SAX2 ContentHandler INTERFACE *****************/
private Stack _parentStack = null;
- private Hashtable _prefixMapping = null;
+ private Map<String, String> _prefixMapping = null;
/**
* SAX2: Receive notification of the beginning of a document.
@@ -1274,7 +1275,7 @@
*/
public void startPrefixMapping(String prefix, String uri) {
if (_prefixMapping == null) {
- _prefixMapping = new Hashtable();
+ _prefixMapping = new HashMap<>();
}
_prefixMapping.put(prefix, uri);
}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Stylesheet.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Stylesheet.java
index 2c244e1..5894996 100644
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Stylesheet.java
+++ b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Stylesheet.java
@@ -1,15 +1,15 @@
/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
+ * Copyright (c) 2007, 2015, Oracle and/or its affiliates. All rights reserved.
*/
/*
- * Copyright 2001-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,
@@ -23,14 +23,6 @@
package com.sun.org.apache.xalan.internal.xsltc.compiler;
-import java.util.Vector;
-import java.util.Enumeration;
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.Properties;
-import java.util.StringTokenizer;
-
-import com.sun.org.apache.xml.internal.utils.SystemIDResolver;
import com.sun.org.apache.bcel.internal.generic.ANEWARRAY;
import com.sun.org.apache.bcel.internal.generic.BasicType;
import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
@@ -59,6 +51,14 @@
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Util;
import com.sun.org.apache.xalan.internal.xsltc.runtime.AbstractTranslet;
import com.sun.org.apache.xml.internal.dtm.DTM;
+import com.sun.org.apache.xml.internal.utils.SystemIDResolver;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+import java.util.StringTokenizer;
+import java.util.Vector;
/**
* @author Jacek Ambroziak
@@ -121,7 +121,7 @@
/**
* Mapping between mode names and Mode instances.
*/
- private final Hashtable _modes = new Hashtable();
+ private final Map<String, Mode> _modes = new HashMap<>();
/**
* A reference to the default Mode object.
@@ -131,7 +131,7 @@
/**
* Mapping between extension URIs and their prefixes.
*/
- private final Hashtable _extensions = new Hashtable();
+ private final Map<String, String> _extensions = new HashMap<>();
/**
* Reference to the stylesheet from which this stylesheet was
@@ -164,7 +164,7 @@
/**
* Mapping between key names and Key objects (needed by Key/IdPattern).
*/
- private Hashtable _keys = new Hashtable();
+ private Map<String, Key> _keys = new HashMap<>();
/**
* A reference to the SourceLoader set by the user (a URIResolver
@@ -323,9 +323,9 @@
_importPrecedence = precedence;
// Set import precedence for all included stylesheets
- final Enumeration elements = elements();
- while (elements.hasMoreElements()) {
- SyntaxTreeNode child = (SyntaxTreeNode)elements.nextElement();
+ final Iterator<SyntaxTreeNode> elements = elements();
+ while (elements.hasNext()) {
+ SyntaxTreeNode child = elements.next();
if (child instanceof Include) {
Stylesheet included = ((Include)child).getIncludedStylesheet();
if (included != null && included._includedFrom == this) {
@@ -573,13 +573,13 @@
stable.excludeNamespaces(excludePrefixes);
stable.excludeNamespaces(extensionPrefixes);
- final Vector contents = getContents();
+ final List<SyntaxTreeNode> contents = getContents();
final int count = contents.size();
// We have to scan the stylesheet element's top-level elements for
// variables and/or parameters before we parse the other elements
for (int i = 0; i < count; i++) {
- SyntaxTreeNode child = (SyntaxTreeNode)contents.elementAt(i);
+ SyntaxTreeNode child = contents.get(i);
if ((child instanceof VariableBase) ||
(child instanceof NamespaceAlias)) {
parser.getSymbolTable().setCurrentNode(child);
@@ -589,7 +589,7 @@
// Now go through all the other top-level elements...
for (int i = 0; i < count; i++) {
- SyntaxTreeNode child = (SyntaxTreeNode)contents.elementAt(i);
+ SyntaxTreeNode child = contents.get(i);
if (!(child instanceof VariableBase) &&
!(child instanceof NamespaceAlias)) {
parser.getSymbolTable().setCurrentNode(child);
@@ -612,18 +612,14 @@
if (_defaultMode == null)
_defaultMode = new Mode(null, this, Constants.EMPTYSTRING);
_defaultMode.processPatterns(_keys);
- final Enumeration modes = _modes.elements();
- while (modes.hasMoreElements()) {
- final Mode mode = (Mode)modes.nextElement();
+ for (Mode mode : _modes.values()) {
mode.processPatterns(_keys);
}
}
private void compileModes(ClassGenerator classGen) {
_defaultMode.compileApplyTemplates(classGen);
- final Enumeration modes = _modes.elements();
- while (modes.hasMoreElements()) {
- final Mode mode = (Mode)modes.nextElement();
+ for (Mode mode : _modes.values()) {
mode.compileApplyTemplates(classGen);
}
}
@@ -636,10 +632,10 @@
return _defaultMode;
}
else {
- Mode mode = (Mode)_modes.get(modeName);
+ Mode mode = _modes.get(modeName.getStringRep());
if (mode == null) {
final String suffix = Integer.toString(_nextModeSerial++);
- _modes.put(modeName, mode = new Mode(modeName, this, suffix));
+ _modes.put(modeName.getStringRep(), mode = new Mode(modeName, this, suffix));
}
return mode;
}
@@ -707,9 +703,9 @@
compileTransform(classGen);
// Translate all non-template elements and filter out all templates
- final Enumeration elements = elements();
- while (elements.hasMoreElements()) {
- Object element = elements.nextElement();
+ final Iterator<SyntaxTreeNode> elements = elements();
+ while (elements.hasNext()) {
+ SyntaxTreeNode element = elements.next();
// xsl:template
if (element instanceof Template) {
// Separate templates by modes
@@ -1054,9 +1050,9 @@
// Create a new list containing variables/params + keys
Vector varDepElements = new Vector(_globals);
- Enumeration elements = elements();
- while (elements.hasMoreElements()) {
- final Object element = elements.nextElement();
+ Iterator<SyntaxTreeNode> elements = elements();
+ while (elements.hasNext()) {
+ SyntaxTreeNode element = elements.next();
if (element instanceof Key) {
varDepElements.add(element);
}
@@ -1079,8 +1075,8 @@
// Compile code for other top-level elements
Vector whitespaceRules = new Vector();
elements = elements();
- while (elements.hasMoreElements()) {
- final Object element = elements.nextElement();
+ while (elements.hasNext()) {
+ SyntaxTreeNode element = elements.next();
// xsl:decimal-format
if (element instanceof DecimalFormatting) {
((DecimalFormatting)element).translate(classGen,toplevel);
@@ -1198,10 +1194,10 @@
buildKeys.addException("com.sun.org.apache.xalan.internal.xsltc.TransletException");
- final Enumeration elements = elements();
- while (elements.hasMoreElements()) {
+ final Iterator<SyntaxTreeNode> elements = elements();
+ while (elements.hasNext()) {
// xsl:key
- final Object element = elements.nextElement();
+ final SyntaxTreeNode element = elements.next();
if (element instanceof Key) {
final Key key = (Key)element;
key.translate(classGen, buildKeys);
@@ -1325,8 +1321,8 @@
"buildKeys", keySig);
// Look for top-level elements that need handling
- final Enumeration toplevel = elements();
- if (_globals.size() > 0 || toplevel.hasMoreElements()) {
+ final Iterator<SyntaxTreeNode> toplevel = elements();
+ if (_globals.size() > 0 || toplevel.hasNext()) {
// Compile method for handling top-level elements
final String topLevelSig = compileTopLevel(classGen);
// Get a reference to that method
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/SymbolTable.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/SymbolTable.java
index 9a59fe2..dfb95b7 100644
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/SymbolTable.java
+++ b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/SymbolTable.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
*
@@ -23,13 +23,13 @@
package com.sun.org.apache.xalan.internal.xsltc.compiler;
-import java.util.Hashtable;
+import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodType;
+import java.util.HashMap;
+import java.util.Map;
import java.util.Stack;
import java.util.StringTokenizer;
import java.util.Vector;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodType;
-
/**
* @author Jacek Ambroziak
* @author Santiago Pericas-Geertsen
@@ -37,67 +37,67 @@
*/
final class SymbolTable {
- // These hashtables are used for all stylesheets
- private final Hashtable _stylesheets = new Hashtable();
- private final Hashtable _primops = new Hashtable();
+ // These maps are used for all stylesheets
+ private final Map<String, Stylesheet> _stylesheets = new HashMap<>();
+ private final Map<String, Vector> _primops = new HashMap<>();
- // These hashtables are used for some stylesheets
- private Hashtable _variables = null;
- private Hashtable _templates = null;
- private Hashtable _attributeSets = null;
- private Hashtable _aliases = null;
- private Hashtable _excludedURI = null;
- private Stack _excludedURIStack = null;
- private Hashtable _decimalFormats = null;
- private Hashtable _keys = null;
+ // These maps are used for some stylesheets
+ private Map<String, VariableBase> _variables = null;
+ private Map<String, Template> _templates = null;
+ private Map<String, AttributeSet> _attributeSets = null;
+ private Map<String, String> _aliases = null;
+ private Map<String, Integer> _excludedURI = null;
+ private Stack<Map<String, Integer>> _excludedURIStack = null;
+ private Map<String, DecimalFormatting> _decimalFormats = null;
+ private Map<String, Key> _keys = null;
public DecimalFormatting getDecimalFormatting(QName name) {
if (_decimalFormats == null) return null;
- return((DecimalFormatting)_decimalFormats.get(name));
+ return(_decimalFormats.get(name.getStringRep()));
}
public void addDecimalFormatting(QName name, DecimalFormatting symbols) {
- if (_decimalFormats == null) _decimalFormats = new Hashtable();
- _decimalFormats.put(name, symbols);
+ if (_decimalFormats == null) _decimalFormats = new HashMap<>();
+ _decimalFormats.put(name.getStringRep(), symbols);
}
public Key getKey(QName name) {
if (_keys == null) return null;
- return (Key) _keys.get(name);
+ return _keys.get(name.getStringRep());
}
public void addKey(QName name, Key key) {
- if (_keys == null) _keys = new Hashtable();
- _keys.put(name, key);
+ if (_keys == null) _keys = new HashMap<>();
+ _keys.put(name.getStringRep(), key);
}
public Stylesheet addStylesheet(QName name, Stylesheet node) {
- return (Stylesheet)_stylesheets.put(name, node);
+ return _stylesheets.put(name.getStringRep(), node);
}
public Stylesheet lookupStylesheet(QName name) {
- return (Stylesheet)_stylesheets.get(name);
+ return _stylesheets.get(name.getStringRep());
}
public Template addTemplate(Template template) {
final QName name = template.getName();
- if (_templates == null) _templates = new Hashtable();
- return (Template)_templates.put(name, template);
+ if (_templates == null) _templates = new HashMap<>();
+ return _templates.put(name.getStringRep(), template);
}
public Template lookupTemplate(QName name) {
if (_templates == null) return null;
- return (Template)_templates.get(name);
+ return _templates.get(name.getStringRep());
}
public Variable addVariable(Variable variable) {
- if (_variables == null) _variables = new Hashtable();
+ if (_variables == null) _variables = new HashMap<>();
final String name = variable.getName().getStringRep();
return (Variable)_variables.put(name, variable);
}
public Param addParam(Param parameter) {
- if (_variables == null) _variables = new Hashtable();
+ if (_variables == null) _variables = new HashMap<>();
final String name = parameter.getName().getStringRep();
return (Param)_variables.put(name, parameter);
}
@@ -105,14 +105,14 @@
public Variable lookupVariable(QName qname) {
if (_variables == null) return null;
final String name = qname.getStringRep();
- final Object obj = _variables.get(name);
+ final VariableBase obj = _variables.get(name);
return obj instanceof Variable ? (Variable)obj : null;
}
public Param lookupParam(QName qname) {
if (_variables == null) return null;
final String name = qname.getStringRep();
- final Object obj = _variables.get(name);
+ final VariableBase obj = _variables.get(name);
return obj instanceof Param ? (Param)obj : null;
}
@@ -123,13 +123,13 @@
}
public AttributeSet addAttributeSet(AttributeSet atts) {
- if (_attributeSets == null) _attributeSets = new Hashtable();
- return (AttributeSet)_attributeSets.put(atts.getName(), atts);
+ if (_attributeSets == null) _attributeSets = new HashMap<>();
+ return _attributeSets.put(atts.getName().getStringRep(), atts);
}
public AttributeSet lookupAttributeSet(QName name) {
if (_attributeSets == null) return null;
- return (AttributeSet)_attributeSets.get(name);
+ return _attributeSets.get(name.getStringRep());
}
/**
@@ -138,7 +138,7 @@
* is prepended.
*/
public void addPrimop(String name, MethodType mtype) {
- Vector methods = (Vector)_primops.get(name);
+ Vector methods = _primops.get(name);
if (methods == null) {
_primops.put(name, methods = new Vector());
}
@@ -150,7 +150,7 @@
* prepending the prefix <tt>PrimopPrefix</tt>.
*/
public Vector lookupPrimop(String name) {
- return (Vector)_primops.get(name);
+ return _primops.get(name);
}
/**
@@ -181,7 +181,7 @@
* Adds an alias for a namespace prefix
*/
public void addPrefixAlias(String prefix, String alias) {
- if (_aliases == null) _aliases = new Hashtable();
+ if (_aliases == null) _aliases = new HashMap<>();
_aliases.put(prefix,alias);
}
@@ -190,7 +190,7 @@
*/
public String lookupPrefixAlias(String prefix) {
if (_aliases == null) return null;
- return (String)_aliases.get(prefix);
+ return _aliases.get(prefix);
}
/**
@@ -201,15 +201,15 @@
// The null-namespace cannot be excluded
if (uri == null) return;
- // Create new hashtable of exlcuded URIs if none exists
- if (_excludedURI == null) _excludedURI = new Hashtable();
+ // Create a new map of exlcuded URIs if none exists
+ if (_excludedURI == null) _excludedURI = new HashMap<>();
// Register the namespace URI
- Integer refcnt = (Integer)_excludedURI.get(uri);
+ Integer refcnt = _excludedURI.get(uri);
if (refcnt == null)
- refcnt = new Integer(1);
+ refcnt = 1;
else
- refcnt = new Integer(refcnt.intValue() + 1);
+ refcnt = refcnt + 1;
_excludedURI.put(uri,refcnt);
}
@@ -237,8 +237,8 @@
*/
public boolean isExcludedNamespace(String uri) {
if (uri != null && _excludedURI != null) {
- final Integer refcnt = (Integer)_excludedURI.get(uri);
- return (refcnt != null && refcnt.intValue() > 0);
+ final Integer refcnt = _excludedURI.get(uri);
+ return (refcnt != null && refcnt > 0);
}
return false;
}
@@ -257,9 +257,9 @@
uri = lookupNamespace(Constants.EMPTYSTRING);
else
uri = lookupNamespace(prefix);
- Integer refcnt = (Integer)_excludedURI.get(uri);
+ Integer refcnt = _excludedURI.get(uri);
if (refcnt != null)
- _excludedURI.put(uri, new Integer(refcnt.intValue() - 1));
+ _excludedURI.put(uri, refcnt - 1);
}
}
}
@@ -286,7 +286,7 @@
* the current stylesheet.
*/
public void popExcludedNamespacesContext() {
- _excludedURI = (Hashtable) _excludedURIStack.pop();
+ _excludedURI = _excludedURIStack.pop();
if (_excludedURIStack.isEmpty()) {
_excludedURIStack = null;
}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/SyntaxTreeNode.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/SyntaxTreeNode.java
index a14aac6..e9020cf 100644
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/SyntaxTreeNode.java
+++ b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/SyntaxTreeNode.java
@@ -1,13 +1,13 @@
/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
+ * Copyright (c) 2006, 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
*
@@ -23,10 +23,6 @@
package com.sun.org.apache.xalan.internal.xsltc.compiler;
-import java.util.Enumeration;
-import java.util.Hashtable;
-import java.util.Vector;
-
import com.sun.org.apache.bcel.internal.generic.ANEWARRAY;
import com.sun.org.apache.bcel.internal.generic.BasicType;
import com.sun.org.apache.bcel.internal.generic.CHECKCAST;
@@ -41,14 +37,18 @@
import com.sun.org.apache.bcel.internal.generic.NEW;
import com.sun.org.apache.bcel.internal.generic.NEWARRAY;
import com.sun.org.apache.bcel.internal.generic.PUSH;
+import com.sun.org.apache.xalan.internal.xsltc.DOM;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ErrorMsg;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
-import com.sun.org.apache.xalan.internal.xsltc.DOM;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Util;
-
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
import org.xml.sax.Attributes;
import org.xml.sax.helpers.AttributesImpl;
@@ -70,13 +70,13 @@
protected SyntaxTreeNode _parent; // Parent node
private Stylesheet _stylesheet; // Stylesheet ancestor node
private Template _template; // Template ancestor node
- private final Vector _contents = new Vector(2); // Child nodes
+ private final List<SyntaxTreeNode> _contents = new ArrayList<>(2); // Child nodes
// Element description data
protected QName _qname; // The element QName
private int _line; // Source file line number
protected AttributesImpl _attributes = null; // Attributes of this element
- private Hashtable _prefixMapping = null; // Namespace declarations
+ private Map<String, String> _prefixMapping = null; // Namespace declarations
// Sentinel - used to denote unrecognised syntaxt tree nodes.
protected static final SyntaxTreeNode Dummy = new AbsolutePathPattern(null);
@@ -217,22 +217,22 @@
* Sets the prefix mapping for the namespaces that were declared in this
* element. This does not include all prefix mappings in scope, so one
* may have to check ancestor elements to get all mappings that are in
- * in scope. The prefixes must be passed in as a Hashtable that maps
+ * in scope. The prefixes must be passed in as a Map that maps
* namespace prefixes (String objects) to namespace URIs (also String).
- * @param mapping The Hashtable containing the mappings.
+ * @param mapping The Map containing the mappings.
*/
- protected void setPrefixMapping(Hashtable mapping) {
+ protected void setPrefixMapping(Map<String, String> mapping) {
_prefixMapping = mapping;
}
/**
- * Returns a Hashtable containing the prefix mappings that were declared
+ * Returns a Map containing the prefix mappings that were declared
* for this element. This does not include all prefix mappings in scope,
* so one may have to check ancestor elements to get all mappings that are
* in in scope.
* @return Prefix mappings (for this element only).
*/
- protected Hashtable getPrefixMapping() {
+ protected Map<String, String> getPrefixMapping() {
return _prefixMapping;
}
@@ -243,7 +243,7 @@
*/
protected void addPrefixMapping(String prefix, String uri) {
if (_prefixMapping == null)
- _prefixMapping = new Hashtable();
+ _prefixMapping = new HashMap<>();
_prefixMapping.put(prefix, uri);
}
@@ -259,9 +259,9 @@
// Initialise the output (default is 'null' for undefined)
String uri = null;
- // First look up the prefix/uri mapping in our own hashtable...
+ // First look up the prefix/uri mapping in our own map...
if (_prefixMapping != null)
- uri = (String)_prefixMapping.get(prefix);
+ uri = _prefixMapping.get(prefix);
// ... but if we can't find it there we ask our parent for the mapping
if ((uri == null) && (_parent != null)) {
uri = _parent.lookupNamespace(prefix);
@@ -286,13 +286,12 @@
// Initialise the output (default is 'null' for undefined)
String prefix = null;
- // First look up the prefix/uri mapping in our own hashtable...
+ // First look up the prefix/uri mapping in our own map...
if ((_prefixMapping != null) &&
- (_prefixMapping.contains(uri))) {
- Enumeration prefixes = _prefixMapping.keys();
- while (prefixes.hasMoreElements()) {
- prefix = (String)prefixes.nextElement();
- String mapsTo = (String)_prefixMapping.get(prefix);
+ (_prefixMapping.containsValue(uri))) {
+ for (Map.Entry<String, String> entry : _prefixMapping.entrySet()) {
+ prefix = entry.getKey();
+ String mapsTo = entry.getValue();
if (mapsTo.equals(uri)) return(prefix);
}
}
@@ -427,20 +426,18 @@
*/
protected final void parseChildren(Parser parser) {
- Vector locals = null; // only create when needed
+ List<QName> locals = null; // only create when needed
- final int count = _contents.size();
- for (int i=0; i<count; i++) {
- SyntaxTreeNode child = (SyntaxTreeNode)_contents.elementAt(i);
+ for (SyntaxTreeNode child : _contents) {
parser.getSymbolTable().setCurrentNode(child);
child.parseContents(parser);
// if variable or parameter, add it to scope
final QName varOrParamName = updateScope(parser, child);
if (varOrParamName != null) {
if (locals == null) {
- locals = new Vector(2);
+ locals = new ArrayList<>(2);
}
- locals.addElement(varOrParamName);
+ locals.add(varOrParamName);
}
}
@@ -448,9 +445,8 @@
// after the last element, remove any locals from scope
if (locals != null) {
- final int nLocals = locals.size();
- for (int i = 0; i < nLocals; i++) {
- parser.removeVariable((QName)locals.elementAt(i));
+ for (QName varOrParamName : locals) {
+ parser.removeVariable(varOrParamName);
}
}
}
@@ -487,9 +483,7 @@
* @param stable The compiler/parser's symbol table
*/
protected Type typeCheckContents(SymbolTable stable) throws TypeCheckError {
- final int n = elementCount();
- for (int i = 0; i < n; i++) {
- SyntaxTreeNode item = (SyntaxTreeNode)_contents.elementAt(i);
+ for (SyntaxTreeNode item : _contents) {
item.typeCheck(stable);
}
return Type.Void;
@@ -513,9 +507,8 @@
// Call translate() on all child nodes
final int n = elementCount();
- for (int i = 0; i < n; i++) {
+ for (SyntaxTreeNode item : _contents) {
methodGen.markChunkStart();
- final SyntaxTreeNode item = (SyntaxTreeNode)_contents.elementAt(i);
item.translate(classGen, methodGen);
methodGen.markChunkEnd();
}
@@ -526,8 +519,8 @@
// references falling out-of-scope inside the for-each element.
// (the cause of which being 'lazy' register allocation for references)
for (int i = 0; i < n; i++) {
- if( _contents.elementAt(i) instanceof VariableBase) {
- final VariableBase var = (VariableBase)_contents.elementAt(i);
+ if( _contents.get(i) instanceof VariableBase) {
+ final VariableBase var = (VariableBase)_contents.get(i);
var.unmapRegister(methodGen);
}
}
@@ -543,9 +536,8 @@
*/
private boolean isSimpleRTF(SyntaxTreeNode node) {
- Vector contents = node.getContents();
- for (int i = 0; i < contents.size(); i++) {
- SyntaxTreeNode item = (SyntaxTreeNode)contents.elementAt(i);
+ List<SyntaxTreeNode> contents = node.getContents();
+ for (SyntaxTreeNode item : contents) {
if (!isTextElement(item, false))
return false;
}
@@ -564,9 +556,8 @@
*/
private boolean isAdaptiveRTF(SyntaxTreeNode node) {
- Vector contents = node.getContents();
- for (int i = 0; i < contents.size(); i++) {
- SyntaxTreeNode item = (SyntaxTreeNode)contents.elementAt(i);
+ List<SyntaxTreeNode> contents = node.getContents();
+ for (SyntaxTreeNode item : contents) {
if (!isTextElement(item, true))
return false;
}
@@ -600,9 +591,8 @@
return doExtendedCheck ? isAdaptiveRTF(node) : isSimpleRTF(node);
}
else if (node instanceof Choose) {
- Vector contents = node.getContents();
- for (int i = 0; i < contents.size(); i++) {
- SyntaxTreeNode item = (SyntaxTreeNode)contents.elementAt(i);
+ List<SyntaxTreeNode> contents = node.getContents();
+ for (SyntaxTreeNode item : contents) {
if (item instanceof Text ||
((item instanceof When || item instanceof Otherwise)
&& ((doExtendedCheck && isAdaptiveRTF(item))
@@ -769,9 +759,7 @@
* @return 'true' if the contents of this node is context dependent.
*/
protected boolean dependentContents() {
- final int n = elementCount();
- for (int i = 0; i < n; i++) {
- final SyntaxTreeNode item = (SyntaxTreeNode)_contents.elementAt(i);
+ for (SyntaxTreeNode item : _contents) {
if (item.contextDependent()) {
return true;
}
@@ -784,7 +772,7 @@
* @param element is the new child node.
*/
protected final void addElement(SyntaxTreeNode element) {
- _contents.addElement(element);
+ _contents.add(element);
element.setParent(this);
}
@@ -794,7 +782,7 @@
* @param element is the new child node.
*/
protected final void setFirstElement(SyntaxTreeNode element) {
- _contents.insertElementAt(element,0);
+ _contents.add(0, element);
element.setParent(this);
}
@@ -808,10 +796,10 @@
}
/**
- * Returns a Vector containing all the child nodes of this node.
- * @return A Vector containing all the child nodes of this node.
+ * Returns a List containing all the child nodes of this node.
+ * @return A List containing all the child nodes of this node.
*/
- protected final Vector getContents() {
+ protected final List<SyntaxTreeNode> getContents() {
return _contents;
}
@@ -832,11 +820,11 @@
}
/**
- * Returns an Enumeration of all child nodes of this node.
- * @return An Enumeration of all child nodes of this node.
+ * Returns an Iterator of all child nodes of this node.
+ * @return An Iterator of all child nodes of this node.
*/
- protected final Enumeration elements() {
- return _contents.elements();
+ protected final Iterator<SyntaxTreeNode> elements() {
+ return _contents.iterator();
}
/**
@@ -845,7 +833,7 @@
* @return The child node.
*/
protected final Object elementAt(int pos) {
- return _contents.elementAt(pos);
+ return _contents.get(pos);
}
/**
@@ -853,8 +841,8 @@
* @return The child node.
*/
protected final SyntaxTreeNode lastChild() {
- if (_contents.size() == 0) return null;
- return (SyntaxTreeNode)_contents.lastElement();
+ if (_contents.isEmpty()) return null;
+ return _contents.get(_contents.size() - 1);
}
/**
@@ -873,9 +861,7 @@
* @param indent Indentation level for syntax tree levels.
*/
protected void displayContents(int indent) {
- final int n = elementCount();
- for (int i = 0; i < n; i++) {
- SyntaxTreeNode item = (SyntaxTreeNode)_contents.elementAt(i);
+ for (SyntaxTreeNode item : _contents) {
item.display(indent);
}
}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Template.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Template.java
index 61302e2..b4d8228 100644
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Template.java
+++ b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Template.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
*
@@ -23,11 +23,8 @@
package com.sun.org.apache.xalan.internal.xsltc.compiler;
-import java.util.Vector;
-
import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
import com.sun.org.apache.bcel.internal.generic.INVOKEVIRTUAL;
-import com.sun.org.apache.bcel.internal.generic.InstructionHandle;
import com.sun.org.apache.bcel.internal.generic.InstructionList;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ErrorMsg;
@@ -37,6 +34,8 @@
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Util;
import com.sun.org.apache.xml.internal.utils.XML11Char;
+import java.util.List;
+import java.util.Vector;
/**
@@ -274,8 +273,8 @@
_priority = Double.NaN;
_pattern = parser.parsePattern(this, "/");
- final Vector contents = _stylesheet.getContents();
- final SyntaxTreeNode root = (SyntaxTreeNode)contents.elementAt(0);
+ final List<SyntaxTreeNode> contents = _stylesheet.getContents();
+ final SyntaxTreeNode root = contents.get(0);
if (root instanceof LiteralElement) {
addElement(root);
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/TestSeq.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/TestSeq.java
index 72164de..d8ca7e8 100644
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/TestSeq.java
+++ b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/TestSeq.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
*
@@ -23,14 +23,13 @@
package com.sun.org.apache.xalan.internal.xsltc.compiler;
-import java.util.Dictionary;
-import java.util.Vector;
-
import com.sun.org.apache.bcel.internal.generic.GOTO_W;
import com.sun.org.apache.bcel.internal.generic.InstructionHandle;
import com.sun.org.apache.bcel.internal.generic.InstructionList;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
+import java.util.Map;
+import java.util.Vector;
/**
* A test sequence is a sequence of patterns that
@@ -179,7 +178,7 @@
* this test sequence. Note that a single template can occur
* in several test sequences if its pattern is a union.
*/
- public void findTemplates(Dictionary templates) {
+ public void findTemplates(Map<Template, Object> templates) {
if (_default != null) {
templates.put(_default, this);
}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/UnsupportedElement.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/UnsupportedElement.java
index 1f9e26c..e4c8e21 100644
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/UnsupportedElement.java
+++ b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/UnsupportedElement.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
*
@@ -23,19 +23,18 @@
package com.sun.org.apache.xalan.internal.xsltc.compiler;
-import java.util.Vector;
-
import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
import com.sun.org.apache.bcel.internal.generic.INVOKESTATIC;
import com.sun.org.apache.bcel.internal.generic.InstructionList;
import com.sun.org.apache.bcel.internal.generic.PUSH;
-
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ErrorMsg;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Util;
+import java.util.List;
+import java.util.Vector;
/**
* @author Morten Jorgensen
@@ -83,11 +82,11 @@
*/
private void processFallbacks(Parser parser) {
- Vector children = getContents();
+ List<SyntaxTreeNode> children = getContents();
if (children != null) {
final int count = children.size();
for (int i = 0; i < count; i++) {
- SyntaxTreeNode child = (SyntaxTreeNode)children.elementAt(i);
+ SyntaxTreeNode child = children.get(i);
if (child instanceof Fallback) {
Fallback fallback = (Fallback)child;
fallback.activate();
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/XSLTC.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/XSLTC.java
index b6f81f7..3218181 100644
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/XSLTC.java
+++ b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/XSLTC.java
@@ -1,13 +1,13 @@
/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
+ * Copyright (c) 2012, 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
*
@@ -23,24 +23,6 @@
package com.sun.org.apache.xalan.internal.xsltc.compiler;
-import java.io.BufferedOutputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URL;
-import java.util.Date;
-import java.util.Enumeration;
-import java.util.Hashtable;
-import java.util.Map;
-import java.util.Properties;
-import java.util.Vector;
-import java.util.jar.JarEntry;
-import java.util.jar.JarOutputStream;
-import java.util.jar.Manifest;
-import javax.xml.XMLConstants;
-
import com.sun.org.apache.bcel.internal.classfile.JavaClass;
import com.sun.org.apache.xalan.internal.XalanConstants;
import com.sun.org.apache.xalan.internal.utils.FeatureManager;
@@ -50,7 +32,24 @@
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ErrorMsg;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Util;
import com.sun.org.apache.xml.internal.dtm.DTM;
-
+import java.io.BufferedOutputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+import java.util.Collections;
+import java.util.Date;
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Properties;
+import java.util.Vector;
+import java.util.jar.JarEntry;
+import java.util.jar.JarOutputStream;
+import java.util.jar.Manifest;
+import javax.xml.XMLConstants;
import org.xml.sax.InputSource;
import org.xml.sax.XMLReader;
@@ -88,14 +87,14 @@
// Name index tables
private int _nextGType; // Next available element type
private Vector _namesIndex; // Index of all registered QNames
- private Hashtable _elements; // Hashtable of all registered elements
- private Hashtable _attributes; // Hashtable of all registered attributes
+ private Map<String, Integer> _elements; // Map of all registered elements
+ private Map<String, Integer> _attributes; // Map of all registered attributes
// Namespace index tables
private int _nextNSType; // Next available namespace type
private Vector _namespaceIndex; // Index of all registered namespaces
- private Hashtable _namespaces; // Hashtable of all registered namespaces
- private Hashtable _namespacePrefixes;// Hashtable of all registered namespace prefixes
+ private Map<String, Integer> _namespaces; // Map of all registered namespaces
+ private Map<String, Integer> _namespacePrefixes;// Map of all registered namespace prefixes
// All literal text in the stylesheet
@@ -153,11 +152,25 @@
private final FeatureManager _featureManager;
/**
+ * Extension function class loader variables
+ */
+
+ /* Class loader reference that will be used for external extension functions loading */
+ private ClassLoader _extensionClassLoader;
+
+ /**
+ * HashMap with the loaded classes
+ */
+ private final Map<String, Class> _externalExtensionFunctions;
+
+ /**
* XSLTC compiler constructor
*/
public XSLTC(boolean useServicesMechanism, FeatureManager featureManager) {
_parser = new Parser(this, useServicesMechanism);
_featureManager = featureManager;
+ _extensionClassLoader = null;
+ _externalExtensionFunctions = new HashMap<>();
}
/**
@@ -207,6 +220,8 @@
return _accessExternalDTD;
} else if (name.equals(XalanConstants.SECURITY_MANAGER)) {
return _xmlSecurityManager;
+ } else if (name.equals(XalanConstants.JDK_EXTENSION_CLASSLOADER)) {
+ return _extensionClassLoader;
}
return null;
}
@@ -222,6 +237,11 @@
_accessExternalDTD = (String)value;
} else if (name.equals(XalanConstants.SECURITY_MANAGER)) {
_xmlSecurityManager = (XMLSecurityManager)value;
+ } else if (name.equals(XalanConstants.JDK_EXTENSION_CLASSLOADER)) {
+ _extensionClassLoader = (ClassLoader) value;
+ /* Clear the external extension functions HashMap if extension class
+ loader was changed */
+ _externalExtensionFunctions.clear();
}
}
@@ -256,18 +276,53 @@
_bcelClasses = new Vector();
}
+ private void setExternalExtensionFunctions(String name, Class clazz) {
+ if (_isSecureProcessing && clazz != null && !_externalExtensionFunctions.containsKey(name)) {
+ _externalExtensionFunctions.put(name, clazz);
+ }
+ }
+
+ /*
+ * Function loads an external extension functions.
+ * The filtering of function types (external,internal) takes place in FunctionCall class
+ *
+ */
+ Class loadExternalFunction(String name) throws ClassNotFoundException {
+ Class loaded = null;
+ //Check if the function is not loaded already
+ if (_externalExtensionFunctions.containsKey(name)) {
+ loaded = _externalExtensionFunctions.get(name);
+ } else if (_extensionClassLoader != null) {
+ loaded = Class.forName(name, true, _extensionClassLoader);
+ setExternalExtensionFunctions(name, loaded);
+ }
+ if (loaded == null) {
+ throw new ClassNotFoundException(name);
+ }
+ //Return loaded class
+ return (Class) loaded;
+ }
+
+ /*
+ * Returns unmodifiable view of HashMap with loaded external extension
+ * functions - will be needed for the TransformerImpl
+ */
+ public Map<String, Class> getExternalExtensionFunctions() {
+ return Collections.unmodifiableMap(_externalExtensionFunctions);
+ }
+
/**
* Initializes the compiler to produce a new translet
*/
private void reset() {
_nextGType = DTM.NTYPES;
- _elements = new Hashtable();
- _attributes = new Hashtable();
- _namespaces = new Hashtable();
+ _elements = new HashMap<>();
+ _attributes = new HashMap<>();
+ _namespaces = new HashMap<>();
_namespaces.put("",new Integer(_nextNSType));
_namesIndex = new Vector(128);
_namespaceIndex = new Vector(32);
- _namespacePrefixes = new Hashtable();
+ _namespacePrefixes = new HashMap<>();
_stylesheet = null;
_parser.init();
//_variableSerial = 1;
@@ -283,6 +338,7 @@
-1, // LEVEL_MULTIPLE
-1 // LEVEL_ANY
};
+ _externalExtensionFunctions.clear();
}
/**
@@ -706,9 +762,9 @@
* DOM attribute types at run-time.
*/
public int registerAttribute(QName name) {
- Integer code = (Integer)_attributes.get(name.toString());
+ Integer code = _attributes.get(name.toString());
if (code == null) {
- code = new Integer(_nextGType++);
+ code = _nextGType++;
_attributes.put(name.toString(), code);
final String uri = name.getNamespace();
final String local = "@"+name.getLocalPart();
@@ -729,9 +785,9 @@
*/
public int registerElement(QName name) {
// Register element (full QName)
- Integer code = (Integer)_elements.get(name.toString());
+ Integer code = _elements.get(name.toString());
if (code == null) {
- _elements.put(name.toString(), code = new Integer(_nextGType++));
+ _elements.put(name.toString(), code = _nextGType++);
_namesIndex.addElement(name.toString());
}
if (name.getLocalPart().equals("*")) {
@@ -747,9 +803,9 @@
public int registerNamespacePrefix(QName name) {
- Integer code = (Integer)_namespacePrefixes.get(name.toString());
+ Integer code = _namespacePrefixes.get(name.toString());
if (code == null) {
- code = new Integer(_nextGType++);
+ code = _nextGType++;
_namespacePrefixes.put(name.toString(), code);
final String uri = name.getNamespace();
if ((uri != null) && (!uri.equals(""))){
@@ -767,9 +823,9 @@
* DOM namespace types at run-time.
*/
public int registerNamespace(String namespaceURI) {
- Integer code = (Integer)_namespaces.get(namespaceURI);
+ Integer code = _namespaces.get(namespaceURI);
if (code == null) {
- code = new Integer(_nextNSType++);
+ code = _nextNSType++;
_namespaces.put(namespaceURI,code);
_namespaceIndex.addElement(namespaceURI);
}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/XslAttribute.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/XslAttribute.java
index 5d86d7e..c99129a 100644
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/XslAttribute.java
+++ b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/XslAttribute.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
*
@@ -23,8 +23,6 @@
package com.sun.org.apache.xalan.internal.xsltc.compiler;
-import java.util.Vector;
-
import com.sun.org.apache.bcel.internal.generic.ALOAD;
import com.sun.org.apache.bcel.internal.generic.ASTORE;
import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
@@ -40,10 +38,10 @@
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Util;
-
import com.sun.org.apache.xml.internal.serializer.ElemDesc;
import com.sun.org.apache.xml.internal.serializer.SerializationHandler;
import com.sun.org.apache.xml.internal.utils.XML11Char;
+import java.util.List;
/**
* @author Jacek Ambroziak
@@ -103,9 +101,9 @@
// Ignore attribute if preceeded by some other type of element
final SyntaxTreeNode parent = getParent();
- final Vector siblings = parent.getContents();
+ final List<SyntaxTreeNode> siblings = parent.getContents();
for (int i = 0; i < parent.elementCount(); i++) {
- SyntaxTreeNode item = (SyntaxTreeNode)siblings.elementAt(i);
+ SyntaxTreeNode item = siblings.get(i);
if (item == this) break;
// These three objects result in one or more attribute output
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/XslElement.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/XslElement.java
index 429cccd..e04bab7 100644
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/XslElement.java
+++ b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/XslElement.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
*
@@ -26,7 +26,6 @@
import com.sun.org.apache.bcel.internal.generic.ALOAD;
import com.sun.org.apache.bcel.internal.generic.ASTORE;
import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
-import com.sun.org.apache.bcel.internal.generic.ICONST;
import com.sun.org.apache.bcel.internal.generic.INVOKESTATIC;
import com.sun.org.apache.bcel.internal.generic.InstructionList;
import com.sun.org.apache.bcel.internal.generic.LocalVariableGen;
@@ -285,8 +284,7 @@
MethodGenerator methodGen) {
final int n = elementCount();
for (int i = 0; i < n; i++) {
- final SyntaxTreeNode item =
- (SyntaxTreeNode)getContents().elementAt(i);
+ final SyntaxTreeNode item = getContents().get(i);
if (_ignore && item instanceof XslAttribute) continue;
item.translate(classGen, methodGen);
}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages.java
index bae5ada..52f9441 100644
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages.java
+++ b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages.java
@@ -599,6 +599,9 @@
{ErrorMsg.JAXP_INVALID_ATTR_ERR,
"TransformerFactory does not recognise attribute ''{0}''."},
+ {ErrorMsg.JAXP_INVALID_ATTR_VALUE_ERR,
+ "Incorrect value specified for ''{0}'' attribute."},
+
/*
* Note to translators: "setResult()" and "startDocument()" are Java
* method names that should not be translated.
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_de.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_de.java
index ed641d4..9da7059 100644
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_de.java
+++ b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_de.java
@@ -597,6 +597,9 @@
{ErrorMsg.JAXP_INVALID_ATTR_ERR,
"TransformerFactory erkennt Attribut \"{0}\" nicht."},
+ {ErrorMsg.JAXP_INVALID_ATTR_VALUE_ERR,
+ "Falscher Wert f\u00FCr Attribut \"{0}\" angegeben."},
+
/*
* Note to translators: "setResult()" and "startDocument()" are Java
* method names that should not be translated.
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_es.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_es.java
index f1c9f16..7b6d1b4 100644
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_es.java
+++ b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_es.java
@@ -597,6 +597,9 @@
{ErrorMsg.JAXP_INVALID_ATTR_ERR,
"TransformerFactory no reconoce el atributo ''{0}''."},
+ {ErrorMsg.JAXP_INVALID_ATTR_VALUE_ERR,
+ "Valor no v\u00E1lido especificado para el atributo ''{0}''."},
+
/*
* Note to translators: "setResult()" and "startDocument()" are Java
* method names that should not be translated.
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_fr.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_fr.java
index 64cf54a..dd3149a 100644
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_fr.java
+++ b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_fr.java
@@ -597,6 +597,9 @@
{ErrorMsg.JAXP_INVALID_ATTR_ERR,
"TransformerFactory ne reconna\u00EEt pas l''attribut ''{0}''."},
+ {ErrorMsg.JAXP_INVALID_ATTR_VALUE_ERR,
+ "La valeur indiqu\u00E9e pour l''attribut ''{0}'' est incorrecte."},
+
/*
* Note to translators: "setResult()" and "startDocument()" are Java
* method names that should not be translated.
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_it.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_it.java
index 8568552..e610ff5 100644
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_it.java
+++ b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_it.java
@@ -597,6 +597,9 @@
{ErrorMsg.JAXP_INVALID_ATTR_ERR,
"TransformerFactory non riconosce l''attributo ''{0}''."},
+ {ErrorMsg.JAXP_INVALID_ATTR_VALUE_ERR,
+ "Valore errato specificato per l''attributo ''{0}''."},
+
/*
* Note to translators: "setResult()" and "startDocument()" are Java
* method names that should not be translated.
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_ja.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_ja.java
index e63c4a6..f27353c 100644
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_ja.java
+++ b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_ja.java
@@ -597,6 +597,9 @@
{ErrorMsg.JAXP_INVALID_ATTR_ERR,
"TransformerFactory\u306F\u5C5E\u6027''{0}''\u3092\u8A8D\u8B58\u3057\u307E\u305B\u3093\u3002"},
+ {ErrorMsg.JAXP_INVALID_ATTR_VALUE_ERR,
+ "''{0}''\u5C5E\u6027\u306B\u6307\u5B9A\u3055\u308C\u305F\u5024\u304C\u6B63\u3057\u304F\u3042\u308A\u307E\u305B\u3093\u3002"},
+
/*
* Note to translators: "setResult()" and "startDocument()" are Java
* method names that should not be translated.
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_ko.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_ko.java
index b104c05..b3cd007 100644
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_ko.java
+++ b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_ko.java
@@ -597,6 +597,9 @@
{ErrorMsg.JAXP_INVALID_ATTR_ERR,
"TransformerFactory\uC5D0\uC11C ''{0}'' \uC18D\uC131\uC744 \uC778\uC2DD\uD558\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4."},
+ {ErrorMsg.JAXP_INVALID_ATTR_VALUE_ERR,
+ "''{0}'' \uC18D\uC131\uC5D0 \uB300\uD574 \uC62C\uBC14\uB974\uC9C0 \uC54A\uC740 \uAC12\uC774 \uC9C0\uC815\uB418\uC5C8\uC2B5\uB2C8\uB2E4."},
+
/*
* Note to translators: "setResult()" and "startDocument()" are Java
* method names that should not be translated.
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_pt_BR.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_pt_BR.java
index 668400f..d6e3530 100644
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_pt_BR.java
+++ b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_pt_BR.java
@@ -597,6 +597,9 @@
{ErrorMsg.JAXP_INVALID_ATTR_ERR,
"TransformerFactory n\u00E3o reconhece o atributo ''{0}''."},
+ {ErrorMsg.JAXP_INVALID_ATTR_VALUE_ERR,
+ "Valor incorreto especificado para o atributo ''{0}''."},
+
/*
* Note to translators: "setResult()" and "startDocument()" are Java
* method names that should not be translated.
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_sv.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_sv.java
index 3ee0a6b..0920f44 100644
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_sv.java
+++ b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_sv.java
@@ -369,7 +369,7 @@
* element of a type that it was not permitted to contain.
*/
{ErrorMsg.ILLEGAL_CHILD_ERR,
- "Ogiltigt underordnat element."},
+ "Otill\u00E5tet underordnat element."},
/*
* Note to translators: The stylesheet tried to create an element with
@@ -597,6 +597,9 @@
{ErrorMsg.JAXP_INVALID_ATTR_ERR,
"TransformerFactory k\u00E4nner inte igen attributet ''{0}''."},
+ {ErrorMsg.JAXP_INVALID_ATTR_VALUE_ERR,
+ "Fel v\u00E4rde har angetts f\u00F6r attributet ''{0}''."},
+
/*
* Note to translators: "setResult()" and "startDocument()" are Java
* method names that should not be translated.
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_zh_CN.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_zh_CN.java
index 36c39ff..cc758e9 100644
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_zh_CN.java
+++ b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_zh_CN.java
@@ -597,6 +597,9 @@
{ErrorMsg.JAXP_INVALID_ATTR_ERR,
"TransformerFactory \u65E0\u6CD5\u8BC6\u522B\u5C5E\u6027 ''{0}''\u3002"},
+ {ErrorMsg.JAXP_INVALID_ATTR_VALUE_ERR,
+ "\u4E3A ''{0}'' \u5C5E\u6027\u6307\u5B9A\u7684\u503C\u4E0D\u6B63\u786E\u3002"},
+
/*
* Note to translators: "setResult()" and "startDocument()" are Java
* method names that should not be translated.
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_zh_TW.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_zh_TW.java
index 7e4891b..2b73cd2 100644
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_zh_TW.java
+++ b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_zh_TW.java
@@ -597,6 +597,9 @@
{ErrorMsg.JAXP_INVALID_ATTR_ERR,
"TransformerFactory \u7121\u6CD5\u8FA8\u8B58\u5C6C\u6027 ''{0}''\u3002"},
+ {ErrorMsg.JAXP_INVALID_ATTR_VALUE_ERR,
+ "\u70BA ''{0}'' \u5C6C\u6027\u6307\u5B9A\u7684\u503C\u4E0D\u6B63\u78BA\u3002"},
+
/*
* Note to translators: "setResult()" and "startDocument()" are Java
* method names that should not be translated.
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMsg.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMsg.java
index 102f354..4192cf2 100644
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMsg.java
+++ b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMsg.java
@@ -117,6 +117,7 @@
public static final String JAXP_NO_SOURCE_ERR = "JAXP_NO_SOURCE_ERR";
public static final String JAXP_COMPILE_ERR = "JAXP_COMPILE_ERR";
public static final String JAXP_INVALID_ATTR_ERR = "JAXP_INVALID_ATTR_ERR";
+ public static final String JAXP_INVALID_ATTR_VALUE_ERR = "JAXP_INVALID_ATTR_VALUE_ERR";
public static final String JAXP_SET_RESULT_ERR = "JAXP_SET_RESULT_ERR";
public static final String JAXP_NO_TRANSLET_ERR = "JAXP_NO_TRANSLET_ERR";
public static final String JAXP_NO_HANDLER_ERR = "JAXP_NO_HANDLER_ERR";
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/MethodGenerator.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/MethodGenerator.java
index 9ba426f..4a3e753 100644
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/MethodGenerator.java
+++ b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/MethodGenerator.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 2001-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,
@@ -23,15 +23,6 @@
package com.sun.org.apache.xalan.internal.xsltc.compiler.util;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
- import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Stack;
-
-
import com.sun.org.apache.bcel.internal.Constants;
import com.sun.org.apache.bcel.internal.classfile.Field;
import com.sun.org.apache.bcel.internal.classfile.Method;
@@ -47,23 +38,23 @@
import com.sun.org.apache.bcel.internal.generic.GETFIELD;
import com.sun.org.apache.bcel.internal.generic.GOTO;
import com.sun.org.apache.bcel.internal.generic.ICONST;
-import com.sun.org.apache.bcel.internal.generic.IfInstruction;
import com.sun.org.apache.bcel.internal.generic.ILOAD;
-import com.sun.org.apache.bcel.internal.generic.IndexedInstruction;
import com.sun.org.apache.bcel.internal.generic.INVOKEINTERFACE;
import com.sun.org.apache.bcel.internal.generic.INVOKESPECIAL;
import com.sun.org.apache.bcel.internal.generic.INVOKESTATIC;
import com.sun.org.apache.bcel.internal.generic.INVOKEVIRTUAL;
import com.sun.org.apache.bcel.internal.generic.ISTORE;
+import com.sun.org.apache.bcel.internal.generic.IfInstruction;
+import com.sun.org.apache.bcel.internal.generic.IndexedInstruction;
import com.sun.org.apache.bcel.internal.generic.Instruction;
import com.sun.org.apache.bcel.internal.generic.InstructionConstants;
import com.sun.org.apache.bcel.internal.generic.InstructionHandle;
import com.sun.org.apache.bcel.internal.generic.InstructionList;
import com.sun.org.apache.bcel.internal.generic.InstructionTargeter;
-import com.sun.org.apache.bcel.internal.generic.LocalVariableGen;
-import com.sun.org.apache.bcel.internal.generic.LocalVariableInstruction;
import com.sun.org.apache.bcel.internal.generic.LLOAD;
import com.sun.org.apache.bcel.internal.generic.LSTORE;
+import com.sun.org.apache.bcel.internal.generic.LocalVariableGen;
+import com.sun.org.apache.bcel.internal.generic.LocalVariableInstruction;
import com.sun.org.apache.bcel.internal.generic.MethodGen;
import com.sun.org.apache.bcel.internal.generic.NEW;
import com.sun.org.apache.bcel.internal.generic.PUTFIELD;
@@ -71,9 +62,14 @@
import com.sun.org.apache.bcel.internal.generic.Select;
import com.sun.org.apache.bcel.internal.generic.TargetLostException;
import com.sun.org.apache.bcel.internal.generic.Type;
-
import com.sun.org.apache.xalan.internal.xsltc.compiler.Pattern;
import com.sun.org.apache.xalan.internal.xsltc.compiler.XSLTC;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Stack;
/**
* @author Jacek Ambroziak
@@ -131,7 +127,7 @@
* times. Note that patterns whose kernels are "*", "node()"
* and "@*" can between shared by test sequences.
*/
- private Hashtable _preCompiled = new Hashtable();
+ private Map<Pattern, InstructionList> _preCompiled = new HashMap<>();
public MethodGenerator(int access_flags, Type return_type,
@@ -715,7 +711,7 @@
* test sequences to avoid compiling patterns more than once.
*/
public InstructionList getInstructionList(Pattern pattern) {
- return (InstructionList) _preCompiled.get(pattern);
+ return _preCompiled.get(pattern);
}
/**
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/MultiHashtable.java b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/MultiHashtable.java
index adaee4f..9ef16a0 100644
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/MultiHashtable.java
+++ b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/MultiHashtable.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 2001-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,
@@ -23,35 +23,72 @@
package com.sun.org.apache.xalan.internal.xsltc.compiler.util;
-import java.util.Hashtable;
-import java.util.Vector;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
/**
* @author Jacek Ambroziak
* @author Santiago Pericas-Geertsen
+ * @param <K>
+ * @param <V>
*/
-public final class MultiHashtable extends Hashtable {
+public final class MultiHashtable<K,V> {
static final long serialVersionUID = -6151608290510033572L;
- public Object put(Object key, Object value) {
- Vector vector = (Vector)get(key);
- if (vector == null)
- super.put(key, vector = new Vector());
- vector.add(value);
- return vector;
+
+ private final Map<K, Set<V>> map = new HashMap<>();
+ private boolean modifiable = true;
+
+ /**
+ * Associates the specified key with a set of values. If the map previously
+ * contained a mapping for the key, the value is added to the set.
+ * @param key key with which the specified value is to be associated
+ * @param value value to be added to a set that is associated with the specified key
+ * @return the set that is associated with the specified key.
+ * @throw UnsupportedOperationException is the MultiHashtable is not modifiable.
+ */
+ public Set<V> put(K key, V value) {
+ if (modifiable) {
+ Set<V> set = map.get(key);
+ if (set == null) {
+ set = new HashSet<>();
+ map.put(key, set);
+ }
+ set.add(value);
+ return set;
+ }
+ throw new UnsupportedOperationException("The MultiHashtable instance is not modifiable.");
}
- public Object maps(Object from, Object to) {
- if (from == null) return null;
- final Vector vector = (Vector) get(from);
- if (vector != null) {
- final int n = vector.size();
- for (int i = 0; i < n; i++) {
- final Object item = vector.elementAt(i);
- if (item.equals(to)) {
- return item;
+ /**
+ * Maps a key to a value in a set that is associated with the specified key.
+ * The mapping is performed by evaluating whether an item in the set equals
+ * the specified value.
+ *
+ * @param key key with which the specified value is to be associated
+ * @param value value in a set that is associated with the specified key
+ * @return the item in the set if a match is found.
+ */
+ public V maps(K key, V value) {
+ if (key == null) return null;
+ final Set<V> set = map.get(key);
+ if (set != null) {
+ for (V v : set) {
+ if (v.equals(value)) {
+ return v;
}
}
}
return null;
}
+
+ /**
+ * Makes the MultiHashtable unmodifiable. This method allows modules to set the table
+ * as "read-only" so that only query operation, that is maps, is allowed. Any attempts
+ * to modify the returned map result in an UnsupportedOperationException.
+ */
+ public void makeUnmodifiable() {
+ modifiable = false;
+ }
}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/dom/AdaptiveResultTreeImpl.java b/src/com/sun/org/apache/xalan/internal/xsltc/dom/AdaptiveResultTreeImpl.java
index 4c2f0c3..fc1b1d9 100644
--- a/src/com/sun/org/apache/xalan/internal/xsltc/dom/AdaptiveResultTreeImpl.java
+++ b/src/com/sun/org/apache/xalan/internal/xsltc/dom/AdaptiveResultTreeImpl.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-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,18 +23,15 @@
package com.sun.org.apache.xalan.internal.xsltc.dom;
import com.sun.org.apache.xalan.internal.xsltc.DOM;
-import com.sun.org.apache.xalan.internal.xsltc.TransletException;
import com.sun.org.apache.xalan.internal.xsltc.StripFilter;
-import com.sun.org.apache.xalan.internal.xsltc.runtime.Hashtable;
+import com.sun.org.apache.xalan.internal.xsltc.TransletException;
import com.sun.org.apache.xalan.internal.xsltc.runtime.BasisLibrary;
-
import com.sun.org.apache.xml.internal.dtm.DTMAxisIterator;
import com.sun.org.apache.xml.internal.dtm.DTMAxisTraverser;
import com.sun.org.apache.xml.internal.dtm.DTMWSFilter;
-import com.sun.org.apache.xml.internal.utils.XMLString;
-
import com.sun.org.apache.xml.internal.serializer.SerializationHandler;
-
+import com.sun.org.apache.xml.internal.utils.XMLString;
+import java.util.Map;
import javax.xml.transform.SourceLocator;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
@@ -556,7 +553,7 @@
}
}
- public Hashtable getElementsWithIDs()
+ public Map<String, Integer> getElementsWithIDs()
{
if (_dom != null) {
return _dom.getElementsWithIDs();
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/dom/DOMAdapter.java b/src/com/sun/org/apache/xalan/internal/xsltc/dom/DOMAdapter.java
index 6dbc54a..a12d9e4 100644
--- a/src/com/sun/org/apache/xalan/internal/xsltc/dom/DOMAdapter.java
+++ b/src/com/sun/org/apache/xalan/internal/xsltc/dom/DOMAdapter.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
*
@@ -27,11 +27,10 @@
import com.sun.org.apache.xalan.internal.xsltc.DOMEnhancedForDTM;
import com.sun.org.apache.xalan.internal.xsltc.StripFilter;
import com.sun.org.apache.xalan.internal.xsltc.TransletException;
-import com.sun.org.apache.xalan.internal.xsltc.runtime.Hashtable;
import com.sun.org.apache.xml.internal.dtm.DTM;
import com.sun.org.apache.xml.internal.dtm.DTMAxisIterator;
import com.sun.org.apache.xml.internal.serializer.SerializationHandler;
-
+import java.util.Map;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
@@ -462,7 +461,7 @@
return _dom.getUnparsedEntityURI(entity);
}
- public Hashtable getElementsWithIDs() {
+ public Map<String, Integer> getElementsWithIDs() {
return _dom.getElementsWithIDs();
}
}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/dom/DOMWSFilter.java b/src/com/sun/org/apache/xalan/internal/xsltc/dom/DOMWSFilter.java
index 92117bf..54fe841 100644
--- a/src/com/sun/org/apache/xalan/internal/xsltc/dom/DOMWSFilter.java
+++ b/src/com/sun/org/apache/xalan/internal/xsltc/dom/DOMWSFilter.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 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
*
@@ -26,9 +26,10 @@
import com.sun.org.apache.xalan.internal.xsltc.DOMEnhancedForDTM;
import com.sun.org.apache.xalan.internal.xsltc.StripFilter;
import com.sun.org.apache.xalan.internal.xsltc.runtime.AbstractTranslet;
-import com.sun.org.apache.xalan.internal.xsltc.runtime.Hashtable;
import com.sun.org.apache.xml.internal.dtm.DTM;
import com.sun.org.apache.xml.internal.dtm.DTMWSFilter;
+import java.util.HashMap;
+import java.util.Map;
/**
* A wrapper class that adapts the
@@ -40,8 +41,8 @@
private AbstractTranslet m_translet;
private StripFilter m_filter;
- // The Hashtable for DTM to mapping array
- private Hashtable m_mappings;
+ // The Map for DTM to mapping array
+ private Map<DTM, short[]> m_mappings;
// Cache the DTM and mapping that are used last time
private DTM m_currentDTM;
@@ -59,7 +60,7 @@
*/
public DOMWSFilter(AbstractTranslet translet) {
m_translet = translet;
- m_mappings = new Hashtable();
+ m_mappings = new HashMap<>();
if (translet instanceof StripFilter) {
m_filter = (StripFilter) translet;
@@ -91,7 +92,7 @@
mapping = m_currentMapping;
}
else {
- mapping = (short[])m_mappings.get(dtm);
+ mapping = m_mappings.get(dtm);
if (mapping == null) {
mapping = mappableDOM.getMapping(
m_translet.getNamesArray(),
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/dom/DocumentCache.java b/src/com/sun/org/apache/xalan/internal/xsltc/dom/DocumentCache.java
index 79f9824..cb9124b 100644
--- a/src/com/sun/org/apache/xalan/internal/xsltc/dom/DocumentCache.java
+++ b/src/com/sun/org/apache/xalan/internal/xsltc/dom/DocumentCache.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
*
@@ -23,20 +23,6 @@
package com.sun.org.apache.xalan.internal.xsltc.dom;
-import java.io.File;
-import java.io.PrintWriter;
-import java.net.URL;
-import java.net.URLConnection;
-import java.net.URLDecoder;
-import java.util.Date;
-import java.util.Hashtable;
-
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.parsers.SAXParser;
-import javax.xml.parsers.SAXParserFactory;
-import javax.xml.transform.TransformerException;
-import javax.xml.transform.sax.SAXSource;
-
import com.sun.org.apache.xalan.internal.xsltc.DOM;
import com.sun.org.apache.xalan.internal.xsltc.DOMCache;
import com.sun.org.apache.xalan.internal.xsltc.DOMEnhancedForDTM;
@@ -45,7 +31,19 @@
import com.sun.org.apache.xalan.internal.xsltc.runtime.BasisLibrary;
import com.sun.org.apache.xalan.internal.xsltc.runtime.Constants;
import com.sun.org.apache.xml.internal.utils.SystemIDResolver;
-
+import java.io.File;
+import java.io.PrintWriter;
+import java.net.URL;
+import java.net.URLConnection;
+import java.net.URLDecoder;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Map;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.parsers.SAXParser;
+import javax.xml.parsers.SAXParserFactory;
+import javax.xml.transform.TransformerException;
+import javax.xml.transform.sax.SAXSource;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
import org.xml.sax.XMLReader;
@@ -56,7 +54,7 @@
public final class DocumentCache implements DOMCache {
private int _size;
- private Hashtable _references;
+ private Map<String, CachedDocument> _references;
private String[] _URIs;
private int _count;
private int _current;
@@ -170,7 +168,7 @@
_count = 0;
_current = 0;
_size = size;
- _references = new Hashtable(_size+2);
+ _references = new HashMap<>(_size+2);
_URIs = new String[_size];
try {
@@ -217,7 +215,7 @@
*
*/
private CachedDocument lookupDocument(String uri) {
- return((CachedDocument)_references.get(uri));
+ return(_references.get(uri));
}
/**
@@ -230,7 +228,7 @@
_current = 0;
}
else {
- // Remove oldest URI from reference Hashtable
+ // Remove oldest URI from reference map
_references.remove(_URIs[_current]);
// Insert our URI in circular buffer
_URIs[_current] = uri;
@@ -243,7 +241,6 @@
*
*/
private synchronized void replaceDocument(String uri, CachedDocument doc) {
- CachedDocument old = (CachedDocument)_references.get(uri);
if (doc == null)
insertDocument(uri, doc);
else
@@ -324,7 +321,7 @@
"<td><center><b>Last modified</b></center></td></tr>");
for (int i=0; i<_count; i++) {
- CachedDocument doc = (CachedDocument)_references.get(_URIs[i]);
+ CachedDocument doc = _references.get(_URIs[i]);
out.print("<tr><td><a href=\""+_URIs[i]+"\">"+
"<font size=-1>"+_URIs[i]+"</font></a></td>");
out.print("<td><center>"+doc.getLatency()+"ms</center></td>");
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/dom/KeyIndex.java b/src/com/sun/org/apache/xalan/internal/xsltc/dom/KeyIndex.java
index b6b3301..5eb17d7 100644
--- a/src/com/sun/org/apache/xalan/internal/xsltc/dom/KeyIndex.java
+++ b/src/com/sun/org/apache/xalan/internal/xsltc/dom/KeyIndex.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 2001-2006 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,18 +23,17 @@
package com.sun.org.apache.xalan.internal.xsltc.dom;
-import java.util.StringTokenizer;
-
import com.sun.org.apache.xalan.internal.xsltc.DOM;
import com.sun.org.apache.xalan.internal.xsltc.DOMEnhancedForDTM;
import com.sun.org.apache.xalan.internal.xsltc.runtime.BasisLibrary;
-import com.sun.org.apache.xalan.internal.xsltc.runtime.Hashtable;
import com.sun.org.apache.xalan.internal.xsltc.util.IntegerArray;
-
import com.sun.org.apache.xml.internal.dtm.Axis;
import com.sun.org.apache.xml.internal.dtm.DTM;
import com.sun.org.apache.xml.internal.dtm.DTMAxisIterator;
import com.sun.org.apache.xml.internal.dtm.ref.DTMAxisIteratorBase;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.StringTokenizer;
/**
* Stores mappings of key values or IDs to DTM nodes.
@@ -49,7 +48,7 @@
* A mapping between values and nodesets for the current document. Used
* only while building keys.
*/
- private Hashtable _index;
+ private Map<String, IntegerArray> _index;
/**
* The document node currently being processed. Used only while building
@@ -60,7 +59,7 @@
/**
* A mapping from a document node to the mapping between values and nodesets
*/
- private Hashtable _rootToIndexMap = new Hashtable();
+ private Map<Integer, Map> _rootToIndexMap = new HashMap<>();
/**
* The node set associated to the current value passed
@@ -91,14 +90,14 @@
* Adds a node to the node list for a given value. Nodes will
* always be added in document order.
*/
- public void add(Object value, int node, int rootNode) {
+ public void add(String value, int node, int rootNode) {
if (_currentDocumentNode != rootNode) {
_currentDocumentNode = rootNode;
- _index = new Hashtable();
- _rootToIndexMap.put(new Integer(rootNode), _index);
+ _index = new HashMap<>();
+ _rootToIndexMap.put(rootNode, _index);
}
- IntegerArray nodes = (IntegerArray) _index.get(value);
+ IntegerArray nodes = _index.get(value);
if (nodes == null) {
nodes = new IntegerArray();
@@ -145,7 +144,7 @@
" \n\t");
while (values.hasMoreElements()) {
final String token = (String) values.nextElement();
- IntegerArray nodes = (IntegerArray) _index.get(token);
+ IntegerArray nodes = _index.get(token);
if (nodes == null && _enhancedDOM != null
&& _enhancedDOM.hasDOMSource()) {
@@ -178,13 +177,13 @@
if (ident != DTM.NULL) {
Integer root = new Integer(_enhancedDOM.getDocument());
- Hashtable index = (Hashtable) _rootToIndexMap.get(root);
+ Map<String, IntegerArray> index = _rootToIndexMap.get(root);
if (index == null) {
- index = new Hashtable();
+ index = new HashMap<>();
_rootToIndexMap.put(root, index);
} else {
- nodes = (IntegerArray) index.get(id);
+ nodes = index.get(id);
}
if (nodes == null) {
@@ -207,7 +206,7 @@
* @deprecated
*/
public void lookupKey(Object value) {
- IntegerArray nodes = (IntegerArray) _index.get(value);
+ IntegerArray nodes = _index.get(value);
_nodes = (nodes != null) ? (IntegerArray) nodes.clone() : null;
_position = 0;
}
@@ -243,8 +242,8 @@
.setStartNode(node).next();
// Get the mapping table for the document containing the context node
- Hashtable index =
- (Hashtable) _rootToIndexMap.get(new Integer(rootHandle));
+ Map<String, IntegerArray> index =
+ _rootToIndexMap.get(rootHandle);
// Split argument to id function into XML whitespace separated tokens
final StringTokenizer values = new StringTokenizer(string, " \n\t");
@@ -254,7 +253,7 @@
IntegerArray nodes = null;
if (index != null) {
- nodes = (IntegerArray) index.get(token);
+ nodes = index.get(token);
}
// If input was from W3C DOM, use DOM's getElementById to do
@@ -294,13 +293,13 @@
.setStartNode(node).next();
// Get the mapping table for the document containing the context node
- Hashtable index =
- (Hashtable) _rootToIndexMap.get(new Integer(rootHandle));
+ Map<String,IntegerArray> index =
+ _rootToIndexMap.get(new Integer(rootHandle));
// Check whether the context node is present in the set of nodes
// returned by the key function
if (index != null) {
- final IntegerArray nodes = (IntegerArray) index.get(value);
+ final IntegerArray nodes = index.get(value);
return (nodes != null && nodes.indexOf(node) >= 0) ? 1 : 0;
}
@@ -689,7 +688,7 @@
IntegerArray result = null;
// Get mapping from key values/IDs to DTM nodes for this document
- Hashtable index = (Hashtable)_rootToIndexMap.get(new Integer(root));
+ Map<String, IntegerArray> index = _rootToIndexMap.get(root);
if (!_isKeyIterator) {
// For id function, tokenize argument as whitespace separated
@@ -703,7 +702,7 @@
// Does the ID map to any node in the document?
if (index != null) {
- nodes = (IntegerArray) index.get(token);
+ nodes = index.get(token);
}
// If input was from W3C DOM, use DOM's getElementById to do
@@ -725,7 +724,7 @@
}
} else if (index != null) {
// For key function, map key value to nodes
- result = (IntegerArray) index.get(keyValue);
+ result = index.get(keyValue);
}
return result;
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/dom/MultiDOM.java b/src/com/sun/org/apache/xalan/internal/xsltc/dom/MultiDOM.java
index 30012c6..66dfdc4 100644
--- a/src/com/sun/org/apache/xalan/internal/xsltc/dom/MultiDOM.java
+++ b/src/com/sun/org/apache/xalan/internal/xsltc/dom/MultiDOM.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
*
@@ -17,26 +17,24 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-/*
- * $Id: MultiDOM.java,v 1.5 2005/09/28 13:48:36 pvedula Exp $
- */
package com.sun.org.apache.xalan.internal.xsltc.dom;
import com.sun.org.apache.xalan.internal.xsltc.DOM;
import com.sun.org.apache.xalan.internal.xsltc.StripFilter;
-import com.sun.org.apache.xml.internal.serializer.SerializationHandler;
import com.sun.org.apache.xalan.internal.xsltc.TransletException;
import com.sun.org.apache.xalan.internal.xsltc.runtime.BasisLibrary;
-import com.sun.org.apache.xalan.internal.xsltc.runtime.Hashtable;
-import com.sun.org.apache.xml.internal.dtm.DTM;
import com.sun.org.apache.xml.internal.dtm.Axis;
+import com.sun.org.apache.xml.internal.dtm.DTM;
import com.sun.org.apache.xml.internal.dtm.DTMAxisIterator;
import com.sun.org.apache.xml.internal.dtm.DTMManager;
import com.sun.org.apache.xml.internal.dtm.ref.DTMAxisIteratorBase;
+import com.sun.org.apache.xml.internal.dtm.ref.DTMAxisIterNodeList;
import com.sun.org.apache.xml.internal.dtm.ref.DTMDefaultBase;
+import com.sun.org.apache.xml.internal.serializer.SerializationHandler;
import com.sun.org.apache.xml.internal.utils.SuballocatedIntVector;
-
+import java.util.HashMap;
+import java.util.Map;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
@@ -56,7 +54,7 @@
private int _free;
private int _size;
- private Hashtable _documents = new Hashtable();
+ private Map<String, Integer> _documents = new HashMap<>();
private final class AxisIterator extends DTMAxisIteratorBase {
// constitutive data
@@ -326,10 +324,10 @@
domNo = domPos;
}
- // Store reference to document (URI) in hashtable
+ // Store reference to document (URI) in the Map
if (indexByURI) {
String uri = adapter.getDocumentURI(0);
- _documents.put(uri, new Integer(domNo));
+ _documents.put(uri, domNo);
}
// If the dom is an AdaptiveResultTreeImpl, we need to create a
@@ -352,7 +350,7 @@
}
public int getDocumentMask(String uri) {
- Integer domIdx = (Integer)_documents.get(uri);
+ Integer domIdx = _documents.get(uri);
if (domIdx == null) {
return(-1);
} else {
@@ -361,7 +359,7 @@
}
public DOM getDOMAdapter(String uri) {
- Integer domIdx = (Integer)_documents.get(uri);
+ Integer domIdx = _documents.get(uri);
if (domIdx == null) {
return(null);
} else {
@@ -567,8 +565,12 @@
}
public NodeList makeNodeList(DTMAxisIterator iter) {
- // TODO: gather nodes from all DOMs ?
- return _main.makeNodeList(iter);
+ int index = iter.next();
+ if (index == DTM.NULL) {
+ return new DTMAxisIterNodeList(null, null);
+ }
+ iter.reset();
+ return _adapters[getDTMId(index)].makeNodeList(iter);
}
public String getLanguage(int node) {
@@ -665,7 +667,7 @@
}
// %HZ% Does this method make any sense here???
- public Hashtable getElementsWithIDs() {
+ public Map<String, Integer> getElementsWithIDs() {
return _main.getElementsWithIDs();
}
}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/dom/SAXImpl.java b/src/com/sun/org/apache/xalan/internal/xsltc/dom/SAXImpl.java
index f74418a..77c56e5 100644
--- a/src/com/sun/org/apache/xalan/internal/xsltc/dom/SAXImpl.java
+++ b/src/com/sun/org/apache/xalan/internal/xsltc/dom/SAXImpl.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
*
@@ -23,40 +23,35 @@
package com.sun.org.apache.xalan.internal.xsltc.dom;
-import java.net.URL;
-import java.net.MalformedURLException;
-import java.util.Enumeration;
-
-import javax.xml.transform.Source;
-import javax.xml.transform.dom.DOMSource;
-
import com.sun.org.apache.xalan.internal.xsltc.DOM;
import com.sun.org.apache.xalan.internal.xsltc.DOMEnhancedForDTM;
import com.sun.org.apache.xalan.internal.xsltc.StripFilter;
import com.sun.org.apache.xalan.internal.xsltc.TransletException;
import com.sun.org.apache.xalan.internal.xsltc.runtime.BasisLibrary;
-import com.sun.org.apache.xalan.internal.xsltc.runtime.Hashtable;
-import com.sun.org.apache.xml.internal.dtm.DTM;
import com.sun.org.apache.xml.internal.dtm.Axis;
+import com.sun.org.apache.xml.internal.dtm.DTM;
import com.sun.org.apache.xml.internal.dtm.DTMAxisIterator;
import com.sun.org.apache.xml.internal.dtm.DTMManager;
import com.sun.org.apache.xml.internal.dtm.DTMWSFilter;
import com.sun.org.apache.xml.internal.dtm.ref.DTMAxisIterNodeList;
import com.sun.org.apache.xml.internal.dtm.ref.DTMDefaultBase;
-import com.sun.org.apache.xml.internal.dtm.ref.EmptyIterator;
import com.sun.org.apache.xml.internal.dtm.ref.DTMNodeProxy;
+import com.sun.org.apache.xml.internal.dtm.ref.EmptyIterator;
import com.sun.org.apache.xml.internal.dtm.ref.sax2dtm.SAX2DTM2;
import com.sun.org.apache.xml.internal.serializer.SerializationHandler;
import com.sun.org.apache.xml.internal.serializer.ToXMLSAXHandler;
-import com.sun.org.apache.xml.internal.utils.XMLStringFactory;
import com.sun.org.apache.xml.internal.utils.SystemIDResolver;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
+import com.sun.org.apache.xml.internal.utils.XMLStringFactory;
+import java.util.HashMap;
+import java.util.Map;
+import javax.xml.transform.Source;
+import javax.xml.transform.dom.DOMSource;
import org.w3c.dom.Document;
import org.w3c.dom.DocumentType;
-import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Entity;
-
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
import org.xml.sax.Attributes;
import org.xml.sax.SAXException;
@@ -119,7 +114,7 @@
private int _namesSize = -1;
// Namespace related stuff
- private Hashtable _nsIndex = new Hashtable();
+ private Map<Integer, Integer> _nsIndex = new HashMap<>();
// The initial size of the text buffer
private int _size = 0;
@@ -134,10 +129,10 @@
// The owner Document when the input source is DOMSource.
private Document _document;
- // The hashtable for org.w3c.dom.Node to node id mapping.
+ // The Map for org.w3c.dom.Node to node id mapping.
// This is only used when the input is a DOMSource and the
// buildIdIndex flag is true.
- private Hashtable _node2Ids = null;
+ private Map<Node, Integer> _node2Ids = null;
// True if the input source is a DOMSource.
private boolean _hasDOMSource = false;
@@ -480,7 +475,7 @@
return 0;
}
int eType = getIdForNamespace(s);
- return ((Integer)_nsIndex.get(new Integer(eType))).intValue();
+ return _nsIndex.get(new Integer(eType));
}
@@ -679,9 +674,9 @@
for (i=0; i<nsLength; i++) {
int eType = getIdForNamespace(namespaces[i]);
- Integer type = (Integer)_nsIndex.get(new Integer(eType));
+ Integer type = _nsIndex.get(eType);
if (type != null) {
- result[type.intValue()] = (short)i;
+ result[type] = (short)i;
}
}
@@ -699,7 +694,7 @@
for (i = 0; i < length; i++) {
int eType = getIdForNamespace(namespaces[i]);
- Integer type = (Integer)_nsIndex.get(new Integer(eType));
+ Integer type = _nsIndex.get(eType);
result[i] = (type == null) ? -1 : type.shortValue();
}
@@ -752,7 +747,7 @@
else {
_document = node.getOwnerDocument();
}
- _node2Ids = new Hashtable();
+ _node2Ids = new HashMap<>();
}
}
@@ -780,8 +775,8 @@
{
Node node = _document.getElementById(idString);
if (node != null) {
- Integer id = (Integer)_node2Ids.get(node);
- return (id != null) ? id.intValue() : DTM.NULL;
+ Integer id = _node2Ids.get(node);
+ return (id != null) ? id : DTM.NULL;
}
else {
return DTM.NULL;
@@ -880,7 +875,7 @@
{
super.startDocument();
- _nsIndex.put(new Integer(0), new Integer(_uriCount++));
+ _nsIndex.put(0, _uriCount++);
definePrefixAndUri(XML_PREFIX, XML_URI);
}
@@ -987,8 +982,8 @@
{
// Check if the URI already exists before pushing on stack
Integer eType = new Integer(getIdForNamespace(uri));
- if ((Integer)_nsIndex.get(eType) == null) {
- _nsIndex.put(eType, new Integer(_uriCount++));
+ if (_nsIndex.get(eType) == null) {
+ _nsIndex.put(eType, _uriCount++);
}
}
@@ -1840,28 +1835,11 @@
}
/**
- * %HZ% Need Javadoc
+ * Return the attributes map.
+ * @return the attributes map.
*/
- public Hashtable getElementsWithIDs() {
- if (m_idAttributes == null) {
- return null;
- }
-
- // Convert a java.util.Hashtable to an xsltc.runtime.Hashtable
- Enumeration idValues = m_idAttributes.keys();
- if (!idValues.hasMoreElements()) {
- return null;
- }
-
- Hashtable idAttrsTable = new Hashtable();
-
- while (idValues.hasMoreElements()) {
- Object idValue = idValues.nextElement();
-
- idAttrsTable.put(idValue, m_idAttributes.get(idValue));
- }
-
- return idAttrsTable;
+ public Map<String, Integer> getElementsWithIDs() {
+ return m_idAttributes;
}
/**
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/dom/SimpleResultTreeImpl.java b/src/com/sun/org/apache/xalan/internal/xsltc/dom/SimpleResultTreeImpl.java
index 6b8b8c3..9d5d07b 100644
--- a/src/com/sun/org/apache/xalan/internal/xsltc/dom/SimpleResultTreeImpl.java
+++ b/src/com/sun/org/apache/xalan/internal/xsltc/dom/SimpleResultTreeImpl.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-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,12 +23,10 @@
package com.sun.org.apache.xalan.internal.xsltc.dom;
import com.sun.org.apache.xalan.internal.xsltc.DOM;
-import com.sun.org.apache.xalan.internal.xsltc.TransletException;
import com.sun.org.apache.xalan.internal.xsltc.StripFilter;
-import com.sun.org.apache.xalan.internal.xsltc.runtime.Hashtable;
-
-import com.sun.org.apache.xml.internal.dtm.DTM;
+import com.sun.org.apache.xalan.internal.xsltc.TransletException;
import com.sun.org.apache.xml.internal.dtm.Axis;
+import com.sun.org.apache.xml.internal.dtm.DTM;
import com.sun.org.apache.xml.internal.dtm.DTMAxisIterator;
import com.sun.org.apache.xml.internal.dtm.DTMAxisTraverser;
import com.sun.org.apache.xml.internal.dtm.DTMManager;
@@ -38,14 +36,12 @@
import com.sun.org.apache.xml.internal.serializer.SerializationHandler;
import com.sun.org.apache.xml.internal.utils.XMLString;
import com.sun.org.apache.xml.internal.utils.XMLStringDefault;
-
+import java.util.Map;
+import javax.xml.transform.SourceLocator;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
-
import org.xml.sax.SAXException;
-import javax.xml.transform.SourceLocator;
-
/**
* This class represents a light-weight DOM model for simple result tree fragment(RTF).
* A simple RTF is an RTF that has only one Text node. The Text node can be produced by a
@@ -608,7 +604,7 @@
return null;
}
- public Hashtable getElementsWithIDs()
+ public Map<String, Integer> getElementsWithIDs()
{
return null;
}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/runtime/AbstractTranslet.java b/src/com/sun/org/apache/xalan/internal/xsltc/runtime/AbstractTranslet.java
index 9eddf5c..fd8e521 100644
--- a/src/com/sun/org/apache/xalan/internal/xsltc/runtime/AbstractTranslet.java
+++ b/src/com/sun/org/apache/xalan/internal/xsltc/runtime/AbstractTranslet.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
*
@@ -18,6 +18,7 @@
* limitations under the License.
*/
/*
+/*
* $Id: AbstractTranslet.java,v 1.6 2006/06/19 19:49:03 spericas Exp $
*/
@@ -25,22 +26,6 @@
import com.sun.org.apache.xalan.internal.XalanConstants;
import com.sun.org.apache.xalan.internal.utils.FactoryImpl;
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.BufferedOutputStream;
-import java.text.DecimalFormat;
-import java.text.DecimalFormatSymbols;
-import java.util.ArrayList;
-import java.util.Enumeration;
-import java.util.Vector;
-import javax.xml.transform.Templates;
-import javax.xml.parsers.DocumentBuilderFactory;
-import org.w3c.dom.Document;
-import org.w3c.dom.DOMImplementation;
-import javax.xml.parsers.ParserConfigurationException;
-
-import com.sun.org.apache.xml.internal.dtm.DTM;
-
import com.sun.org.apache.xalan.internal.xsltc.DOM;
import com.sun.org.apache.xalan.internal.xsltc.DOMCache;
import com.sun.org.apache.xalan.internal.xsltc.DOMEnhancedForDTM;
@@ -49,8 +34,23 @@
import com.sun.org.apache.xalan.internal.xsltc.dom.DOMAdapter;
import com.sun.org.apache.xalan.internal.xsltc.dom.KeyIndex;
import com.sun.org.apache.xalan.internal.xsltc.runtime.output.TransletOutputHandlerFactory;
+import com.sun.org.apache.xml.internal.dtm.DTM;
import com.sun.org.apache.xml.internal.dtm.DTMAxisIterator;
import com.sun.org.apache.xml.internal.serializer.SerializationHandler;
+import java.io.BufferedOutputStream;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.text.DecimalFormat;
+import java.text.DecimalFormatSymbols;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Vector;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.transform.Templates;
+import org.w3c.dom.DOMImplementation;
+import org.w3c.dom.Document;
/**
* @author Jacek Ambroziak
@@ -271,15 +271,15 @@
************************************************************************/
// Contains decimal number formatting symbols used by FormatNumberCall
- public Hashtable _formatSymbols = null;
+ public Map<String, DecimalFormat> _formatSymbols = null;
/**
- * Adds a DecimalFormat object to the _formatSymbols hashtable.
+ * Adds a DecimalFormat object to the _formatSymbols map.
* The entry is created with the input DecimalFormatSymbols.
*/
public void addDecimalFormat(String name, DecimalFormatSymbols symbols) {
- // Instanciate hashtable for formatting symbols if needed
- if (_formatSymbols == null) _formatSymbols = new Hashtable();
+ // Instanciate map for formatting symbols if needed
+ if (_formatSymbols == null) _formatSymbols = new HashMap<>();
// The name cannot be null - use empty string instead
if (name == null) name = EMPTYSTRING;
@@ -293,7 +293,7 @@
}
/**
- * Retrieves a named DecimalFormat object from _formatSymbols hashtable.
+ * Retrieves a named DecimalFormat object from the _formatSymbols map.
*/
public final DecimalFormat getDecimalFormat(String name) {
@@ -301,8 +301,8 @@
// The name cannot be null - use empty string instead
if (name == null) name = EMPTYSTRING;
- DecimalFormat df = (DecimalFormat)_formatSymbols.get(name);
- if (df == null) df = (DecimalFormat)_formatSymbols.get(EMPTYSTRING);
+ DecimalFormat df = _formatSymbols.get(name);
+ if (df == null) df = _formatSymbols.get(EMPTYSTRING);
return df;
}
return(null);
@@ -338,26 +338,19 @@
return;
}
else {
- final Hashtable elementsByID = enhancedDOM.getElementsWithIDs();
+ final Map<String, Integer> elementsByID = enhancedDOM.getElementsWithIDs();
if (elementsByID == null) {
return;
}
- // Given a Hashtable of DTM nodes indexed by ID attribute values,
+ // Given a Map of DTM nodes indexed by ID attribute values,
// loop through the table copying information to a KeyIndex
// for the mapping from ID attribute value to DTM node
- final Enumeration idValues = elementsByID.keys();
boolean hasIDValues = false;
-
- while (idValues.hasMoreElements()) {
- final Object idValue = idValues.nextElement();
- final int element =
- document.getNodeHandle(
- ((Integer)elementsByID.get(idValue))
- .intValue());
-
- buildKeyIndex(ID_INDEX_NAME, element, idValue);
+ for (Map.Entry<String, Integer> entry : elementsByID.entrySet()) {
+ final int element = document.getNodeHandle(entry.getValue());
+ buildKeyIndex(ID_INDEX_NAME, element, entry.getKey());
hasIDValues = true;
}
@@ -425,7 +418,7 @@
************************************************************************/
// Container for all indexes for xsl:key elements
- private Hashtable _keyIndexes = null;
+ private Map<String, KeyIndex> _keyIndexes = null;
private KeyIndex _emptyKeyIndex = null;
private int _indexSize = 0;
private int _currentRootForKeys = 0;
@@ -451,13 +444,8 @@
* @param node is the node handle of the node to insert
* @param value is the value that will look up the node in the given index
*/
- public void buildKeyIndex(String name, int node, Object value) {
- if (_keyIndexes == null) _keyIndexes = new Hashtable();
-
- KeyIndex index = (KeyIndex)_keyIndexes.get(name);
- if (index == null) {
- _keyIndexes.put(name, index = new KeyIndex(_indexSize));
- }
+ public void buildKeyIndex(String name, int node, String value) {
+ KeyIndex index = buildKeyIndexHelper(name);
index.add(value, node, _currentRootForKeys);
}
@@ -467,18 +455,33 @@
* @param dom is the DOM
*/
public void buildKeyIndex(String name, DOM dom) {
- if (_keyIndexes == null) _keyIndexes = new Hashtable();
+ KeyIndex index = buildKeyIndexHelper(name);
+ index.setDom(dom, dom.getDocument());
+ }
- KeyIndex index = (KeyIndex)_keyIndexes.get(name);
+ /**
+ * Return KeyIndex for the buildKeyIndex methods. Note the difference from the
+ * public getKeyIndex method, this method creates a new Map if keyIndexes does
+ * not exist.
+ *
+ * @param name the name of the index (the key or ##id)
+ * @return a KeyIndex.
+ */
+ private KeyIndex buildKeyIndexHelper(String name) {
+ if (_keyIndexes == null) _keyIndexes = new HashMap<>();
+
+ KeyIndex index = _keyIndexes.get(name);
if (index == null) {
_keyIndexes.put(name, index = new KeyIndex(_indexSize));
}
- index.setDom(dom, dom.getDocument());
+ return index;
}
/**
* Returns the index for a given key (or id).
* The index implements our internal iterator interface
+ * @param name the name of the index (the key or ##id)
+ * @return a KeyIndex.
*/
public KeyIndex getKeyIndex(String name) {
// Return an empty key index iterator if none are defined
@@ -489,7 +492,7 @@
}
// Look up the requested key index
- final KeyIndex index = (KeyIndex)_keyIndexes.get(name);
+ final KeyIndex index = _keyIndexes.get(name);
// Return an empty key index iterator if the requested index not found
if (index == null) {
@@ -706,14 +709,14 @@
}
}
- private Hashtable _auxClasses = null;
+ private Map<String, Class<?>> _auxClasses = null;
public void addAuxiliaryClass(Class auxClass) {
- if (_auxClasses == null) _auxClasses = new Hashtable();
+ if (_auxClasses == null) _auxClasses = new HashMap<>();
_auxClasses.put(auxClass.getName(), auxClass);
}
- public void setAuxiliaryClasses(Hashtable auxClasses) {
+ public void setAuxiliaryClasses(Map<String, Class<?>> auxClasses) {
_auxClasses = auxClasses;
}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/runtime/BasisLibrary.java b/src/com/sun/org/apache/xalan/internal/xsltc/runtime/BasisLibrary.java
index 74acd2a..dc3a3ce 100644
--- a/src/com/sun/org/apache/xalan/internal/xsltc/runtime/BasisLibrary.java
+++ b/src/com/sun/org/apache/xalan/internal/xsltc/runtime/BasisLibrary.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 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
*
@@ -24,6 +24,23 @@
package com.sun.org.apache.xalan.internal.xsltc.runtime;
import com.sun.org.apache.xalan.internal.utils.SecuritySupport;
+import com.sun.org.apache.xalan.internal.xsltc.DOM;
+import com.sun.org.apache.xalan.internal.xsltc.Translet;
+import com.sun.org.apache.xalan.internal.xsltc.dom.AbsoluteIterator;
+import com.sun.org.apache.xalan.internal.xsltc.dom.ArrayNodeListIterator;
+import com.sun.org.apache.xalan.internal.xsltc.dom.DOMAdapter;
+import com.sun.org.apache.xalan.internal.xsltc.dom.MultiDOM;
+import com.sun.org.apache.xalan.internal.xsltc.dom.SingletonIterator;
+import com.sun.org.apache.xalan.internal.xsltc.dom.StepIterator;
+import com.sun.org.apache.xml.internal.dtm.Axis;
+import com.sun.org.apache.xml.internal.dtm.DTM;
+import com.sun.org.apache.xml.internal.dtm.DTMAxisIterator;
+import com.sun.org.apache.xml.internal.dtm.DTMManager;
+import com.sun.org.apache.xml.internal.dtm.ref.DTMDefaultBase;
+import com.sun.org.apache.xml.internal.dtm.ref.DTMNodeProxy;
+import com.sun.org.apache.xml.internal.serializer.NamespaceMappings;
+import com.sun.org.apache.xml.internal.serializer.SerializationHandler;
+import com.sun.org.apache.xml.internal.utils.XML11Char;
import java.text.DecimalFormat;
import java.text.DecimalFormatSymbols;
import java.text.FieldPosition;
@@ -32,31 +49,11 @@
import java.util.Locale;
import java.util.ResourceBundle;
import javax.xml.transform.dom.DOMSource;
-
-import com.sun.org.apache.xalan.internal.xsltc.DOM;
-import com.sun.org.apache.xalan.internal.xsltc.Translet;
-import com.sun.org.apache.xalan.internal.xsltc.dom.AbsoluteIterator;
-import com.sun.org.apache.xml.internal.dtm.Axis;
-import com.sun.org.apache.xalan.internal.xsltc.dom.DOMAdapter;
-import com.sun.org.apache.xalan.internal.xsltc.dom.MultiDOM;
-import com.sun.org.apache.xalan.internal.xsltc.dom.SingletonIterator;
-import com.sun.org.apache.xalan.internal.xsltc.dom.StepIterator;
-import com.sun.org.apache.xalan.internal.xsltc.dom.ArrayNodeListIterator;
-import com.sun.org.apache.xml.internal.dtm.DTM;
-import com.sun.org.apache.xml.internal.dtm.DTMAxisIterator;
-import com.sun.org.apache.xml.internal.dtm.DTMManager;
-import com.sun.org.apache.xml.internal.dtm.ref.DTMDefaultBase;
-import com.sun.org.apache.xml.internal.dtm.ref.DTMNodeProxy;
-
-import org.w3c.dom.DOMException;
import org.w3c.dom.Attr;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.NodeList;
import org.xml.sax.SAXException;
-import com.sun.org.apache.xml.internal.serializer.NamespaceMappings;
-import com.sun.org.apache.xml.internal.serializer.SerializationHandler;
-import com.sun.org.apache.xml.internal.utils.XML11Char;
/**
* Standard XSLT functions. All standard functions expect the current node
@@ -270,14 +267,15 @@
if (Double.isNaN(start))
return(EMPTYSTRING);
- final int strlen = value.length();
- int istart = (int)Math.round(start) - 1;
+ final int strlen = getStringLength(value);
+ int istart = (int)Math.round(start) - 1;
if (istart > strlen)
return(EMPTYSTRING);
if (istart < 1)
istart = 0;
try {
+ istart = value.offsetByCodePoints(0, istart);
return value.substring(istart);
} catch (IndexOutOfBoundsException e) {
runTimeError(RUN_TIME_INTERNAL_ERR, "substring()");
@@ -292,28 +290,35 @@
public static String substringF(String value, double start, double length) {
if (Double.isInfinite(start) ||
Double.isNaN(start) ||
- Double.isNaN(length))
+ Double.isNaN(length) ||
+ length < 0)
return(EMPTYSTRING);
- int istart = (int)Math.round(start) - 1;
+ int istart = (int)Math.round(start) - 1;
+ int ilength = (int)Math.round(length);
final int isum;
if (Double.isInfinite(length))
isum = Integer.MAX_VALUE;
else
- isum = istart + (int)Math.round(length);
+ isum = istart + ilength;
- final int strlen = value.length();
+ final int strlen = getStringLength(value);
if (isum < 0 || istart > strlen)
return(EMPTYSTRING);
- if (istart < 0)
+ if (istart < 0) {
+ ilength += istart;
istart = 0;
+ }
try {
- if (isum > strlen)
+ istart = value.offsetByCodePoints(0, istart);
+ if (isum > strlen) {
return value.substring(istart);
- else
- return value.substring(istart, isum);
+ } else {
+ int offset = value.offsetByCodePoints(istart, ilength);
+ return value.substring(istart, offset);
+ }
} catch (IndexOutOfBoundsException e) {
runTimeError(RUN_TIME_INTERNAL_ERR, "substring()");
return null;
@@ -975,7 +980,7 @@
/**
* Utility function: used to format/adjust a double to a string. The
- * DecimalFormat object comes from the 'formatSymbols' hashtable in
+ * DecimalFormat object comes from the 'formatSymbols' map in
* AbstractTranslet.
*/
private static FieldPosition _fieldPosition = new FieldPosition(0);
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_sv.java b/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_sv.java
index 565dac1..2c2b40e 100644
--- a/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_sv.java
+++ b/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_sv.java
@@ -91,14 +91,14 @@
* is a class name. Used for internal errors in the processor.
*/
{BasisLibrary.RUN_TIME_INTERNAL_ERR,
- "Internt k\u00F6rningsfel i ''{0}''"},
+ "Internt exekveringsfel i ''{0}''"},
/*
* Note to translators: <xsl:copy> is a keyword that should not be
* translated.
*/
{BasisLibrary.RUN_TIME_COPY_ERR,
- "K\u00F6rningsfel vid k\u00F6rning av <xsl:copy>."},
+ "Exekveringsexekveringsfel av <xsl:copy>."},
/*
* Note to translators: The substitution text refers to data types.
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/runtime/Hashtable.java b/src/com/sun/org/apache/xalan/internal/xsltc/runtime/Hashtable.java
deleted file mode 100644
index e222e47..0000000
--- a/src/com/sun/org/apache/xalan/internal/xsltc/runtime/Hashtable.java
+++ /dev/null
@@ -1,345 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * 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
- *
- * 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.
- */
-/*
- * $Id: Hashtable.java,v 1.2.4.1 2005/09/06 11:05:18 pvedula Exp $
- */
-
-package com.sun.org.apache.xalan.internal.xsltc.runtime;
-
-import java.util.Enumeration;
-
-/**
- * IMPORTANT NOTE:
- * This code was taken from Sun's Java1.1 JDK java.util.HashTable.java
- * All "synchronized" keywords and some methods we do not need have been
- * all been removed.
- */
-
-/**
- * Object that wraps entries in the hash-table
- * @author Morten Jorgensen
- */
-class HashtableEntry {
- int hash;
- Object key;
- Object value;
- HashtableEntry next;
-
- protected Object clone() {
- HashtableEntry entry = new HashtableEntry();
- entry.hash = hash;
- entry.key = key;
- entry.value = value;
- entry.next = (next != null) ? (HashtableEntry)next.clone() : null;
- return entry;
- }
-}
-
-/**
- * The main hash-table implementation
- */
-public class Hashtable {
-
- private transient HashtableEntry table[]; // hash-table entries
- private transient int count; // number of entries
- private int threshold; // current size of hash-tabke
- private float loadFactor; // load factor
-
- /**
- * Constructs a new, empty hashtable with the specified initial
- * capacity and the specified load factor.
- */
- public Hashtable(int initialCapacity, float loadFactor) {
- if (initialCapacity <= 0) initialCapacity = 11;
- if (loadFactor <= 0.0) loadFactor = 0.75f;
- this.loadFactor = loadFactor;
- table = new HashtableEntry[initialCapacity];
- threshold = (int)(initialCapacity * loadFactor);
- }
-
- /**
- * Constructs a new, empty hashtable with the specified initial capacity
- * and default load factor.
- */
- public Hashtable(int initialCapacity) {
- this(initialCapacity, 0.75f);
- }
-
- /**
- * Constructs a new, empty hashtable with a default capacity and load
- * factor.
- */
- public Hashtable() {
- this(101, 0.75f);
- }
-
- /**
- * Returns the number of keys in this hashtable.
- */
- public int size() {
- return count;
- }
-
- /**
- * Tests if this hashtable maps no keys to values.
- */
- public boolean isEmpty() {
- return count == 0;
- }
-
- /**
- * Returns an enumeration of the keys in this hashtable.
- */
- public Enumeration keys() {
- return new HashtableEnumerator(table, true);
- }
-
- /**
- * Returns an enumeration of the values in this hashtable.
- * Use the Enumeration methods on the returned object to fetch the elements
- * sequentially.
- */
- public Enumeration elements() {
- return new HashtableEnumerator(table, false);
- }
-
- /**
- * Tests if some key maps into the specified value in this hashtable.
- * This operation is more expensive than the <code>containsKey</code>
- * method.
- */
- public boolean contains(Object value) {
-
- if (value == null) throw new NullPointerException();
-
- int i;
- HashtableEntry e;
- HashtableEntry tab[] = table;
-
- for (i = tab.length ; i-- > 0 ;) {
- for (e = tab[i] ; e != null ; e = e.next) {
- if (e.value.equals(value)) {
- return true;
- }
- }
- }
- return false;
- }
-
- /**
- * Tests if the specified object is a key in this hashtable.
- */
- public boolean containsKey(Object key) {
- HashtableEntry e;
- HashtableEntry tab[] = table;
- int hash = key.hashCode();
- int index = (hash & 0x7FFFFFFF) % tab.length;
-
- for (e = tab[index] ; e != null ; e = e.next)
- if ((e.hash == hash) && e.key.equals(key))
- return true;
-
- return false;
- }
-
- /**
- * Returns the value to which the specified key is mapped in this hashtable.
- */
- public Object get(Object key) {
- HashtableEntry e;
- HashtableEntry tab[] = table;
- int hash = key.hashCode();
- int index = (hash & 0x7FFFFFFF) % tab.length;
-
- for (e = tab[index] ; e != null ; e = e.next)
- if ((e.hash == hash) && e.key.equals(key))
- return e.value;
-
- return null;
- }
-
- /**
- * Rehashes the contents of the hashtable into a hashtable with a
- * larger capacity. This method is called automatically when the
- * number of keys in the hashtable exceeds this hashtable's capacity
- * and load factor.
- */
- protected void rehash() {
- HashtableEntry e, old;
- int i, index;
- int oldCapacity = table.length;
- HashtableEntry oldTable[] = table;
-
- int newCapacity = oldCapacity * 2 + 1;
- HashtableEntry newTable[] = new HashtableEntry[newCapacity];
-
- threshold = (int)(newCapacity * loadFactor);
- table = newTable;
-
- for (i = oldCapacity ; i-- > 0 ;) {
- for (old = oldTable[i] ; old != null ; ) {
- e = old;
- old = old.next;
- index = (e.hash & 0x7FFFFFFF) % newCapacity;
- e.next = newTable[index];
- newTable[index] = e;
- }
- }
- }
-
- /**
- * Maps the specified <code>key</code> to the specified
- * <code>value</code> in this hashtable. Neither the key nor the
- * value can be <code>null</code>.
- * <p>
- * The value can be retrieved by calling the <code>get</code> method
- * with a key that is equal to the original key.
- */
- public Object put(Object key, Object value) {
- // Make sure the value is not null
- if (value == null) throw new NullPointerException();
-
- // Makes sure the key is not already in the hashtable.
- HashtableEntry e;
- HashtableEntry tab[] = table;
- int hash = key.hashCode();
- int index = (hash & 0x7FFFFFFF) % tab.length;
-
- for (e = tab[index] ; e != null ; e = e.next) {
- if ((e.hash == hash) && e.key.equals(key)) {
- Object old = e.value;
- e.value = value;
- return old;
- }
- }
-
- // Rehash the table if the threshold is exceeded
- if (count >= threshold) {
- rehash();
- return put(key, value);
- }
-
- // Creates the new entry.
- e = new HashtableEntry();
- e.hash = hash;
- e.key = key;
- e.value = value;
- e.next = tab[index];
- tab[index] = e;
- count++;
- return null;
- }
-
- /**
- * Removes the key (and its corresponding value) from this
- * hashtable. This method does nothing if the key is not in the hashtable.
- */
- public Object remove(Object key) {
- HashtableEntry e, prev;
- HashtableEntry tab[] = table;
- int hash = key.hashCode();
- int index = (hash & 0x7FFFFFFF) % tab.length;
- for (e = tab[index], prev = null ; e != null ; prev = e, e = e.next) {
- if ((e.hash == hash) && e.key.equals(key)) {
- if (prev != null)
- prev.next = e.next;
- else
- tab[index] = e.next;
- count--;
- return e.value;
- }
- }
- return null;
- }
-
- /**
- * Clears this hashtable so that it contains no keys.
- */
- public void clear() {
- HashtableEntry tab[] = table;
- for (int index = tab.length; --index >= 0; )
- tab[index] = null;
- count = 0;
- }
-
- /**
- * Returns a rather long string representation of this hashtable.
- * Handy for debugging - leave it here!!!
- */
- public String toString() {
- int i;
- int max = size() - 1;
- StringBuffer buf = new StringBuffer();
- Enumeration k = keys();
- Enumeration e = elements();
- buf.append("{");
-
- for (i = 0; i <= max; i++) {
- String s1 = k.nextElement().toString();
- String s2 = e.nextElement().toString();
- buf.append(s1).append('=').append(s2);
- if (i < max) buf.append(", ");
- }
- buf.append("}");
- return buf.toString();
- }
-
- /**
- * A hashtable enumerator class. This class should remain opaque
- * to the client. It will use the Enumeration interface.
- */
- class HashtableEnumerator implements Enumeration {
- boolean keys;
- int index;
- HashtableEntry table[];
- HashtableEntry entry;
-
- HashtableEnumerator(HashtableEntry table[], boolean keys) {
- this.table = table;
- this.keys = keys;
- this.index = table.length;
- }
-
- public boolean hasMoreElements() {
- if (entry != null) {
- return true;
- }
- while (index-- > 0) {
- if ((entry = table[index]) != null) {
- return true;
- }
- }
- return false;
- }
-
- public Object nextElement() {
- if (entry == null) {
- while ((index-- > 0) && ((entry = table[index]) == null));
- }
- if (entry != null) {
- HashtableEntry e = entry;
- entry = e.next;
- return keys ? e.key : e.value;
- }
- return null;
- }
- }
-
-}
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/trax/DOM2SAX.java b/src/com/sun/org/apache/xalan/internal/xsltc/trax/DOM2SAX.java
index be29258..0ed9800 100644
--- a/src/com/sun/org/apache/xalan/internal/xsltc/trax/DOM2SAX.java
+++ b/src/com/sun/org/apache/xalan/internal/xsltc/trax/DOM2SAX.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
*
@@ -24,14 +24,15 @@
package com.sun.org.apache.xalan.internal.xsltc.trax;
+import com.sun.org.apache.xalan.internal.xsltc.dom.SAXImpl;
+import com.sun.org.apache.xalan.internal.xsltc.runtime.BasisLibrary;
import java.io.IOException;
-import java.util.Hashtable;
+import java.util.HashMap;
+import java.util.Map;
import java.util.Stack;
import java.util.Vector;
-
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
-
import org.xml.sax.ContentHandler;
import org.xml.sax.DTDHandler;
import org.xml.sax.EntityResolver;
@@ -44,8 +45,6 @@
import org.xml.sax.XMLReader;
import org.xml.sax.ext.LexicalHandler;
import org.xml.sax.helpers.AttributesImpl;
-import com.sun.org.apache.xalan.internal.xsltc.dom.SAXImpl;
-import com.sun.org.apache.xalan.internal.xsltc.runtime.BasisLibrary;
/**
* @author G. Todd Miller
@@ -59,7 +58,7 @@
private ContentHandler _sax = null;
private LexicalHandler _lex = null;
private SAXImpl _saxImpl = null;
- private Hashtable _nsPrefixes = new Hashtable();
+ private Map<String, Stack> _nsPrefixes = new HashMap<>();
public DOM2SAX(Node root) {
_dom = root;
@@ -91,7 +90,7 @@
throws SAXException
{
boolean pushed = true;
- Stack uriStack = (Stack) _nsPrefixes.get(prefix);
+ Stack uriStack = _nsPrefixes.get(prefix);
if (uriStack != null) {
if (uriStack.isEmpty()) {
@@ -124,7 +123,7 @@
private void endPrefixMapping(String prefix)
throws SAXException
{
- final Stack uriStack = (Stack) _nsPrefixes.get(prefix);
+ final Stack uriStack = _nsPrefixes.get(prefix);
if (uriStack != null) {
_sax.endPrefixMapping(prefix);
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/trax/StAXEvent2SAX.java b/src/com/sun/org/apache/xalan/internal/xsltc/trax/StAXEvent2SAX.java
index 88d68ca..62bb90f 100644
--- a/src/com/sun/org/apache/xalan/internal/xsltc/trax/StAXEvent2SAX.java
+++ b/src/com/sun/org/apache/xalan/internal/xsltc/trax/StAXEvent2SAX.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
@@ -75,7 +75,6 @@
private ContentHandler _sax = null;
private LexicalHandler _lex = null;
private SAXImpl _saxImpl = null;
- //private Hashtable _nsPrefixes = new Hashtable();
private String version = null;
private String encoding = null;
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/trax/StAXStream2SAX.java b/src/com/sun/org/apache/xalan/internal/xsltc/trax/StAXStream2SAX.java
index 55274a2..318b4d9 100644
--- a/src/com/sun/org/apache/xalan/internal/xsltc/trax/StAXStream2SAX.java
+++ b/src/com/sun/org/apache/xalan/internal/xsltc/trax/StAXStream2SAX.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,12 +25,12 @@
package com.sun.org.apache.xalan.internal.xsltc.trax;
+import com.sun.org.apache.xalan.internal.xsltc.dom.SAXImpl;
import java.io.IOException;
-import java.util.Hashtable;
-import java.util.Stack;
-import java.util.Vector;
-import java.util.Iterator;
-
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamConstants;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
import org.xml.sax.Attributes;
import org.xml.sax.ContentHandler;
import org.xml.sax.DTDHandler;
@@ -45,22 +45,6 @@
import org.xml.sax.ext.LexicalHandler;
import org.xml.sax.ext.Locator2;
import org.xml.sax.helpers.AttributesImpl;
-import com.sun.org.apache.xalan.internal.xsltc.dom.SAXImpl;
-
-
-
-import javax.xml.namespace.QName;
-import javax.xml.stream.XMLStreamReader;
-import javax.xml.stream.XMLStreamConstants;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.events.Attribute;
-import javax.xml.stream.events.Characters;
-import javax.xml.stream.events.EndElement;
-import javax.xml.stream.events.Namespace;
-import javax.xml.stream.events.ProcessingInstruction;
-import javax.xml.stream.events.StartElement;
-import javax.xml.stream.events.StartDocument;
-import javax.xml.stream.events.XMLEvent;
@@ -80,7 +64,6 @@
private ContentHandler _sax = null;
private LexicalHandler _lex = null;
private SAXImpl _saxImpl = null;
- //private Hashtable _nsPrefixes = new Hashtable();
public StAXStream2SAX(XMLStreamReader staxSrc) {
staxStreamReader = staxSrc;
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/trax/TemplatesImpl.java b/src/com/sun/org/apache/xalan/internal/xsltc/trax/TemplatesImpl.java
index e6d9cc3..e0ee6fb 100644
--- a/src/com/sun/org/apache/xalan/internal/xsltc/trax/TemplatesImpl.java
+++ b/src/com/sun/org/apache/xalan/internal/xsltc/trax/TemplatesImpl.java
@@ -1,15 +1,15 @@
/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
+ * Copyright (c) 2007, 2015, Oracle and/or its affiliates. All rights reserved.
*/
/*
- * Copyright 2001-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,
@@ -24,28 +24,29 @@
package com.sun.org.apache.xalan.internal.xsltc.trax;
import com.sun.org.apache.xalan.internal.XalanConstants;
+import com.sun.org.apache.xalan.internal.utils.ObjectFactory;
+import com.sun.org.apache.xalan.internal.utils.SecuritySupport;
+import com.sun.org.apache.xalan.internal.xsltc.DOM;
+import com.sun.org.apache.xalan.internal.xsltc.Translet;
+import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ErrorMsg;
+import com.sun.org.apache.xalan.internal.xsltc.runtime.AbstractTranslet;
import java.io.IOException;
+import java.io.NotSerializableException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
+import java.io.ObjectStreamField;
import java.io.Serializable;
-import java.util.Properties;
import java.security.AccessController;
import java.security.PrivilegedAction;
-
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Properties;
import javax.xml.XMLConstants;
import javax.xml.transform.Templates;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerConfigurationException;
import javax.xml.transform.URIResolver;
-import com.sun.org.apache.xalan.internal.xsltc.DOM;
-import com.sun.org.apache.xalan.internal.xsltc.Translet;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ErrorMsg;
-import com.sun.org.apache.xalan.internal.xsltc.runtime.AbstractTranslet;
-import com.sun.org.apache.xalan.internal.xsltc.runtime.Hashtable;
-import com.sun.org.apache.xalan.internal.utils.ObjectFactory;
-import com.sun.org.apache.xalan.internal.utils.SecuritySupport;
-
/**
* @author Morten Jorgensen
* @author G. Todd Millerj
@@ -90,7 +91,7 @@
/**
* Contains the list of auxiliary class definitions.
*/
- private Hashtable _auxClasses = null;
+ private transient Map<String, Class<?>> _auxClasses = null;
/**
* Output properties of this translet.
@@ -123,18 +124,60 @@
*/
private transient TransformerFactoryImpl _tfactory = null;
- private boolean _useServicesMechanism;
+ /**
+ * A flag to determine whether the Service Mechanism is used
+ */
+ private transient boolean _useServicesMechanism;
/**
* protocols allowed for external references set by the stylesheet processing instruction, Import and Include element.
*/
- private String _accessExternalStylesheet = XalanConstants.EXTERNAL_ACCESS_DEFAULT;
+ private transient String _accessExternalStylesheet = XalanConstants.EXTERNAL_ACCESS_DEFAULT;
+
+ /**
+ * @serialField _name String The Name of the main class
+ * @serialField _bytecodes byte[][] Class definition
+ * @serialField _class Class[] The translet class definition(s).
+ * @serialField _transletIndex int The index of the main translet class
+ * @serialField _outputProperties Properties Output properties of this translet.
+ * @serialField _indentNumber int Number of spaces to add for output indentation.
+ */
+ private static final ObjectStreamField[] serialPersistentFields =
+ new ObjectStreamField[] {
+ new ObjectStreamField("_name", String.class),
+ new ObjectStreamField("_bytecodes", byte[][].class),
+ new ObjectStreamField("_class", Class[].class),
+ new ObjectStreamField("_transletIndex", int.class),
+ new ObjectStreamField("_outputProperties", Properties.class),
+ new ObjectStreamField("_indentNumber", int.class),
+ };
static final class TransletClassLoader extends ClassLoader {
- TransletClassLoader(ClassLoader parent) {
- super(parent);
+ private final Map<String,Class> _loadedExternalExtensionFunctions;
+
+ TransletClassLoader(ClassLoader parent) {
+ super(parent);
+ _loadedExternalExtensionFunctions = null;
}
+ TransletClassLoader(ClassLoader parent,Map<String, Class> mapEF) {
+ super(parent);
+ _loadedExternalExtensionFunctions = mapEF;
+ }
+
+ public Class<?> loadClass(String name) throws ClassNotFoundException {
+ Class<?> ret = null;
+ // The _loadedExternalExtensionFunctions will be empty when the
+ // SecurityManager is not set and the FSP is turned off
+ if (_loadedExternalExtensionFunctions != null) {
+ ret = _loadedExternalExtensionFunctions.get(name);
+ }
+ if (ret == null) {
+ ret = super.loadClass(name);
+ }
+ return ret;
+ }
+
/**
* Access to final protected superclass member from outer class.
*/
@@ -193,6 +236,7 @@
* if yes then we need to deserialize the URIResolver
* Fix for bugzilla bug 22438
*/
+ @SuppressWarnings("unchecked")
private void readObject(ObjectInputStream is)
throws IOException, ClassNotFoundException
{
@@ -205,7 +249,16 @@
}
}
- is.defaultReadObject();
+ // We have to read serialized fields first.
+ ObjectInputStream.GetField gf = is.readFields();
+ _name = (String)gf.get("_name", null);
+ _bytecodes = (byte[][])gf.get("_bytecodes", null);
+ _class = (Class[])gf.get("_class", null);
+ _transletIndex = gf.get("_transletIndex", -1);
+
+ _outputProperties = (Properties)gf.get("_outputProperties", null);
+ _indentNumber = gf.get("_indentNumber", 0);
+
if (is.readBoolean()) {
_uriResolver = (URIResolver) is.readObject();
}
@@ -221,7 +274,22 @@
*/
private void writeObject(ObjectOutputStream os)
throws IOException, ClassNotFoundException {
- os.defaultWriteObject();
+ if (_auxClasses != null) {
+ //throw with the same message as when Hashtable was used for compatibility.
+ throw new NotSerializableException(
+ "com.sun.org.apache.xalan.internal.xsltc.runtime.Hashtable");
+ }
+
+ // Write serialized fields
+ ObjectOutputStream.PutField pf = os.putFields();
+ pf.put("_name", _name);
+ pf.put("_bytecodes", _bytecodes);
+ pf.put("_class", _class);
+ pf.put("_transletIndex", _transletIndex);
+ pf.put("_outputProperties", _outputProperties);
+ pf.put("_indentNumber", _indentNumber);
+ os.writeFields();
+
if (_uriResolver instanceof Serializable) {
os.writeBoolean(true);
os.writeObject((Serializable) _uriResolver);
@@ -330,7 +398,7 @@
TransletClassLoader loader = (TransletClassLoader)
AccessController.doPrivileged(new PrivilegedAction() {
public Object run() {
- return new TransletClassLoader(ObjectFactory.findClassLoader());
+ return new TransletClassLoader(ObjectFactory.findClassLoader(),_tfactory.getExternalExtensionsMap());
}
});
@@ -339,7 +407,7 @@
_class = new Class[classCount];
if (classCount > 1) {
- _auxClasses = new Hashtable();
+ _auxClasses = new HashMap<>();
}
for (int i = 0; i < classCount; i++) {
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/trax/TransformerFactoryImpl.java b/src/com/sun/org/apache/xalan/internal/xsltc/trax/TransformerFactoryImpl.java
index 46866fd..b37c8f4 100644
--- a/src/com/sun/org/apache/xalan/internal/xsltc/trax/TransformerFactoryImpl.java
+++ b/src/com/sun/org/apache/xalan/internal/xsltc/trax/TransformerFactoryImpl.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 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
*
@@ -27,12 +27,12 @@
import com.sun.org.apache.xalan.internal.utils.FactoryImpl;
import com.sun.org.apache.xalan.internal.utils.FeatureManager;
import com.sun.org.apache.xalan.internal.utils.FeaturePropertyBase;
+import com.sun.org.apache.xalan.internal.utils.FeaturePropertyBase.State;
import com.sun.org.apache.xalan.internal.utils.ObjectFactory;
import com.sun.org.apache.xalan.internal.utils.SecuritySupport;
import com.sun.org.apache.xalan.internal.utils.XMLSecurityManager;
import com.sun.org.apache.xalan.internal.utils.XMLSecurityPropertyManager;
import com.sun.org.apache.xalan.internal.utils.XMLSecurityPropertyManager.Property;
-import com.sun.org.apache.xalan.internal.utils.FeaturePropertyBase.State;
import com.sun.org.apache.xalan.internal.xsltc.compiler.Constants;
import com.sun.org.apache.xalan.internal.xsltc.compiler.SourceLoader;
import com.sun.org.apache.xalan.internal.xsltc.compiler.XSLTC;
@@ -49,7 +49,7 @@
import java.net.MalformedURLException;
import java.net.URL;
import java.util.Enumeration;
-import java.util.Hashtable;
+import java.util.Map;
import java.util.Properties;
import java.util.Vector;
import java.util.zip.ZipEntry;
@@ -57,7 +57,6 @@
import javax.xml.XMLConstants;
import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;
-
import javax.xml.transform.ErrorListener;
import javax.xml.transform.Source;
import javax.xml.transform.Templates;
@@ -73,7 +72,8 @@
import javax.xml.transform.sax.SAXTransformerFactory;
import javax.xml.transform.sax.TemplatesHandler;
import javax.xml.transform.sax.TransformerHandler;
-import javax.xml.transform.stax.*;
+import javax.xml.transform.stax.StAXResult;
+import javax.xml.transform.stax.StAXSource;
import javax.xml.transform.stream.StreamResult;
import javax.xml.transform.stream.StreamSource;
import org.xml.sax.InputSource;
@@ -146,13 +146,13 @@
private String _jarFileName = null;
/**
- * This Hashtable is used to store parameters for locating
+ * This Map is used to store parameters for locating
* <?xml-stylesheet ...?> processing instructions in XML docs.
*/
- private Hashtable _piParams = null;
+ private Map<Source, PIParamWrapper> _piParams = null;
/**
- * The above hashtable stores objects of this class.
+ * The above Map stores objects of this class.
*/
private static class PIParamWrapper {
public String _media = null;
@@ -231,6 +231,13 @@
private final FeatureManager _featureManager;
+ private ClassLoader _extensionClassLoader = null;
+
+ // Unmodifiable view of external extension function from xslt compiler
+ // It will be populated by user-specified extension functions during the
+ // type checking
+ private Map<String, Class> _xsltcExtensionFunctions;
+
/**
* javax.xml.transform.sax.TransformerFactory implementation.
*/
@@ -261,6 +268,12 @@
//Parser's security manager
_xmlSecurityManager = new XMLSecurityManager(true);
+ //Unmodifiable hash map with loaded external extension functions
+ _xsltcExtensionFunctions = null;
+ }
+
+ public Map<String,Class> getExternalExtensionsMap() {
+ return _xsltcExtensionFunctions;
}
/**
@@ -324,6 +337,8 @@
return Boolean.FALSE;
} else if (name.equals(XalanConstants.SECURITY_MANAGER)) {
return _xmlSecurityManager;
+ } else if (name.equals(XalanConstants.JDK_EXTENSION_CLASSLOADER)) {
+ return _extensionClassLoader;
}
/** Check to see if the property is managed by the security manager **/
@@ -439,6 +454,16 @@
return;
}
}
+ else if ( name.equals(XalanConstants.JDK_EXTENSION_CLASSLOADER)) {
+ if (value instanceof ClassLoader) {
+ _extensionClassLoader = (ClassLoader) value;
+ return;
+ } else {
+ final ErrorMsg err
+ = new ErrorMsg(ErrorMsg.JAXP_INVALID_ATTR_VALUE_ERR, "Extension Functions ClassLoader");
+ throw new IllegalArgumentException(err.toString());
+ }
+ }
if (_xmlSecurityManager != null &&
_xmlSecurityManager.setLimit(name, XMLSecurityManager.State.APIPROPERTY, value)) {
@@ -881,7 +906,6 @@
// Reset the per-session attributes to their default values
// after each newTemplates() call.
resetTransientAttributes();
-
return new TemplatesImpl(bytecodes, transletClassName, null, _indentNumber, this);
}
}
@@ -898,8 +922,10 @@
xsltc.setProperty(XMLConstants.ACCESS_EXTERNAL_STYLESHEET, _accessExternalStylesheet);
xsltc.setProperty(XMLConstants.ACCESS_EXTERNAL_DTD, _accessExternalDTD);
xsltc.setProperty(XalanConstants.SECURITY_MANAGER, _xmlSecurityManager);
+ xsltc.setProperty(XalanConstants.JDK_EXTENSION_CLASSLOADER, _extensionClassLoader);
xsltc.init();
-
+ if (!_isNotSecureProcessing)
+ _xsltcExtensionFunctions = xsltc.getExternalExtensionFunctions();
// Set a document loader (for xsl:include/import) if defined
if (_uriResolver != null) {
xsltc.setSourceLoader(this);
@@ -909,7 +935,7 @@
// <?xml-stylesheet ...?> PI in an XML input document
if ((_piParams != null) && (_piParams.get(source) != null)) {
// Get the parameters for this Source object
- PIParamWrapper p = (PIParamWrapper)_piParams.get(source);
+ PIParamWrapper p = _piParams.get(source);
// Pass them on to the compiler (which will pass then to the parser)
if (p != null) {
xsltc.setPIParameters(p._media, p._title, p._charset);
diff --git a/src/com/sun/org/apache/xalan/internal/xsltc/trax/TransformerImpl.java b/src/com/sun/org/apache/xalan/internal/xsltc/trax/TransformerImpl.java
index 6bf365f..2dddac5 100644
--- a/src/com/sun/org/apache/xalan/internal/xsltc/trax/TransformerImpl.java
+++ b/src/com/sun/org/apache/xalan/internal/xsltc/trax/TransformerImpl.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 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
*
@@ -26,6 +26,22 @@
import com.sun.org.apache.xalan.internal.XalanConstants;
import com.sun.org.apache.xalan.internal.utils.FactoryImpl;
import com.sun.org.apache.xalan.internal.utils.XMLSecurityManager;
+import com.sun.org.apache.xalan.internal.xsltc.DOM;
+import com.sun.org.apache.xalan.internal.xsltc.DOMCache;
+import com.sun.org.apache.xalan.internal.xsltc.StripFilter;
+import com.sun.org.apache.xalan.internal.xsltc.Translet;
+import com.sun.org.apache.xalan.internal.xsltc.TransletException;
+import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ErrorMsg;
+import com.sun.org.apache.xalan.internal.xsltc.dom.DOMWSFilter;
+import com.sun.org.apache.xalan.internal.xsltc.dom.SAXImpl;
+import com.sun.org.apache.xalan.internal.xsltc.dom.XSLTCDTMManager;
+import com.sun.org.apache.xalan.internal.xsltc.runtime.AbstractTranslet;
+import com.sun.org.apache.xalan.internal.xsltc.runtime.output.TransletOutputHandlerFactory;
+import com.sun.org.apache.xml.internal.dtm.DTMWSFilter;
+import com.sun.org.apache.xml.internal.serializer.OutputPropertiesFactory;
+import com.sun.org.apache.xml.internal.serializer.SerializationHandler;
+import com.sun.org.apache.xml.internal.utils.SystemIDResolver;
+import com.sun.org.apache.xml.internal.utils.XMLReaderManager;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
@@ -38,11 +54,12 @@
import java.net.URLConnection;
import java.net.UnknownServiceException;
import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.Map;
import java.util.Properties;
import java.util.StringTokenizer;
import java.util.Vector;
-import java.lang.reflect.Constructor;
-
+import javax.xml.XMLConstants;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
@@ -63,29 +80,6 @@
import javax.xml.transform.stax.StAXSource;
import javax.xml.transform.stream.StreamResult;
import javax.xml.transform.stream.StreamSource;
-import javax.xml.XMLConstants;
-
-import com.sun.org.apache.xml.internal.utils.SystemIDResolver;
-
-import com.sun.org.apache.xalan.internal.xsltc.DOM;
-import com.sun.org.apache.xalan.internal.xsltc.DOMCache;
-import com.sun.org.apache.xalan.internal.xsltc.DOMEnhancedForDTM;
-import com.sun.org.apache.xalan.internal.xsltc.StripFilter;
-import com.sun.org.apache.xalan.internal.xsltc.Translet;
-import com.sun.org.apache.xalan.internal.xsltc.TransletException;
-import com.sun.org.apache.xml.internal.serializer.OutputPropertiesFactory;
-import com.sun.org.apache.xml.internal.serializer.SerializationHandler;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ErrorMsg;
-import com.sun.org.apache.xalan.internal.xsltc.dom.DOMWSFilter;
-import com.sun.org.apache.xalan.internal.xsltc.dom.SAXImpl;
-import com.sun.org.apache.xalan.internal.xsltc.dom.XSLTCDTMManager;
-import com.sun.org.apache.xalan.internal.xsltc.runtime.AbstractTranslet;
-import com.sun.org.apache.xalan.internal.xsltc.runtime.Hashtable;
-import com.sun.org.apache.xalan.internal.xsltc.runtime.output.TransletOutputHandlerFactory;
-
-import com.sun.org.apache.xml.internal.dtm.DTMWSFilter;
-import com.sun.org.apache.xml.internal.utils.XMLReaderManager;
-
import org.xml.sax.ContentHandler;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
@@ -217,11 +211,11 @@
private XMLSecurityManager _securityManager;
/**
- * A hashtable to store parameters for the identity transform. These
+ * A map to store parameters for the identity transform. These
* are not needed during the transformation, but we must keep track of
* them to be fully complaint with the JAXP API.
*/
- private Hashtable _parameters = null;
+ private Map<String, Object> _parameters = null;
/**
* This class wraps an ErrorListener into a MessageHandler in order to
@@ -827,31 +821,6 @@
}
/**
- * The translet stores all CDATA sections set in the <xsl:output> element
- * in a Hashtable. This method will re-construct the whitespace separated
- * list of elements given in the <xsl:output> element.
- */
- private String makeCDATAString(Hashtable cdata) {
- // Return a 'null' string if no CDATA section elements were specified
- if (cdata == null) return null;
-
- final StringBuilder result = new StringBuilder();
-
- // Get an enumeration of all the elements in the hashtable
- Enumeration elements = cdata.keys();
- if (elements.hasMoreElements()) {
- result.append((String)elements.nextElement());
- while (elements.hasMoreElements()) {
- String element = (String)elements.nextElement();
- result.append(' ');
- result.append(element);
- }
- }
-
- return(result.toString());
- }
-
- /**
* Implements JAXP's Transformer.getOutputProperties().
* Returns a copy of the output properties for the transformation. This is
* a set of layered properties. The first layer contains properties set by
@@ -1224,7 +1193,7 @@
if (_isIdentity) {
if (_parameters == null) {
- _parameters = new Hashtable();
+ _parameters = new HashMap<>();
}
_parameters.put(name, value);
}
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.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 @@
* @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 {
+ 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.
- */
+ /**
+ * 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 @@
/**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 @@
// 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 @@
} // 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 @@
}
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 @@
* 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 @@
* 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 @@
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 @@
* @since DOM Level 3
*/
public void setTextContent(String textContent)
- throws DOMException {
+ throws DOMException {
// no-op
}
@@ -508,7 +551,7 @@
// 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 @@
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 @@
* 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 @@
* not yet implemented.)
*/
public CDATASection createCDATASection(String data)
- throws DOMException {
+ throws DOMException {
return new CDATASectionImpl(this, data);
}
@@ -615,7 +658,7 @@
* 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 @@
* 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 @@
* 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 @@
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 @@
return errorChecking;
}
-
/**
* DOM Level 3 CR - Experimental. (Was getActualEncoding)
*
@@ -921,8 +962,8 @@
* @since DOM Level 3
*/
public void setXmlStandalone(boolean value)
- throws DOMException {
- standalone = value;
+ throws DOMException {
+ standalone = value;
}
/**
@@ -993,9 +1034,9 @@
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 @@
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 @@
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 @@
* 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 @@
}
/**
- * 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 @@
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 @@
} // 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 @@
* 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 @@
} // 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 @@
// 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 @@
* 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 @@
* 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 @@
// 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 @@
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 @@
// 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 @@
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 @@
newnode = createAttribute(source.getNodeName());
} else {
newnode = createAttributeNS(source.getNamespaceURI(),
- source.getNodeName());
+ source.getNodeName());
}
}
else {
@@ -1663,7 +1696,7 @@
case PROCESSING_INSTRUCTION_NODE: {
newnode = createProcessingInstruction(source.getNodeName(),
- source.getNodeValue());
+ source.getNodeValue());
break;
}
@@ -1682,15 +1715,15 @@
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 @@
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 @@
// 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 @@
}
return newnode;
- } // importNode(Node,boolean,boolean,Hashtable):Node
+ } // importNode(Node,boolean,boolean,Map):Node
/**
* DOM Level 3 WD - Experimental
@@ -1763,7 +1796,7 @@
**/
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 @@
// 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 @@
// Adopting between two dissimilar DOM's is not allowed
return null;
}
- }
+ }
}
switch (node.getNodeType()) {
@@ -1808,12 +1841,13 @@
}
//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 @@
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 @@
}
// 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 @@
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 @@
}
// 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 @@
}
// 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 @@
}
if (identifiers == null) {
- identifiers = new Hashtable();
+ identifiers = new HashMap<>();
}
identifiers.put(idName, element);
@@ -2052,25 +2090,9 @@
} // 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 @@
* @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 @@
* 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 @@
* @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 @@
* 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 @@
* @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 @@
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 @@
* 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 @@
* @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 @@
* @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 @@
* @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 @@
// 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 @@
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 @@
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 @@
// 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 @@
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 @@
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 java.io.Serializable;
-import java.util.Hashtable;
-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 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 org.w3c.dom.Attr;
import org.w3c.dom.DOMException;
import org.w3c.dom.DOMImplementation;
@@ -34,6 +40,7 @@
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 @@
/** 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 @@
filter,
entityReferenceExpansion);
if (iterators == null) {
- iterators = new Vector();
+ iterators = new ArrayList<>();
}
- iterators.addElement(iterator);
+ iterators.add(iterator);
return iterator;
}
@@ -287,7 +309,7 @@
if (nodeIterator == null) return;
if (iterators == null) return;
- iterators.removeElement(nodeIterator);
+ iterators.remove(nodeIterator);
}
//
@@ -298,12 +320,11 @@
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 @@
if (range == null) return;
if (ranges == null) return;
- ranges.removeElement(range);
+ ranges.remove(range);
}
/**
@@ -330,7 +351,7 @@
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 @@
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 @@
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 @@
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 @@
* 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 @@
/**
* 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 @@
* @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 @@
// 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 @@
* @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 @@
// 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 @@
// 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 @@
}
} // 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 @@
* @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 @@
// 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 @@
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 @@
// 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 @@
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 @@
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 @@
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 @@
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 @@
// 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 @@
// 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 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 @@
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 @@
/** 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 @@
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 @@
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 @@
return ownerDocument().getUserData(this, key);
}
- protected Hashtable getUserDataRecord(){
+ protected Map<String, ParentNode.UserDataRecord> getUserDataRecord(){
return ownerDocument().getUserDataRecord(this);
}
@@ -1845,7 +1844,7 @@
* 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 @@
/*
* 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 @@
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 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
*
- * Copyright (c) 1999-2002 The Apache Software Foundation.
- * All rights reserved.
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * 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;
@@ -65,6 +24,8 @@
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 @@
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 @@
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 @@
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 @@
}
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 @@
}
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 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
*
- * Copyright (c) 1999-2003 The Apache Software Foundation.
- * All rights reserved.
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * 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) 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.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 @@
}
// call handler
+ if (empty) {
+ //decrease the markup depth..
+ fMarkupDepth--;
- if (empty) {
+ // check that this element was opened in the same entity
+ if (fMarkupDepth < fEntityStack[fEntityDepth - 1]) {
+ reportFatalError(
+ "ElementEntityMismatch",
+ new Object[] { fCurrentElement.rawname });
+ }
- //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 });
- }
-
+ if (fDocumentHandler != null) {
fDocumentHandler.emptyElement(fElementQName, fAttributes, null);
+ }
- /*if (fBindNamespaces) {
- fNamespaceContext.popContext();
- }*/
- fScanEndElement = true;
+ /*if (fBindNamespaces) {
+ fNamespaceContext.popContext();
+ }*/
+ fScanEndElement = true;
- //pop the element off the stack..
- fElementStack.popElement();
- } else {
+ //pop the element off the stack..
+ fElementStack.popElement();
+ } else {
+ if(dtdGrammarUtil != null) {
+ dtdGrammarUtil.startElement(fElementQName, fAttributes);
+ }
- 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 @@
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 @@
}
// 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 @@
} // 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 @@
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 @@
// AttValue
boolean isVC = !fStandalone && (fSeenExternalDTD || fSeenExternalPE) ;
scanAttributeValue(defaultVal, nonNormalizedDefaultVal, atName,
- fAttributes, 0, isVC);
+ fAttributes, 0, isVC, elName);
}
return defaultType;
@@ -1632,7 +1654,7 @@
XMLString literal2 = fString;
int countChar = 0;
if (fLimitAnalyzer == null ) {
- fLimitAnalyzer = new XMLLimitAnalyzer();
+ fLimitAnalyzer = fEntityManager.fLimitAnalyzer;
}
fLimitAnalyzer.startEntity(entityName);
@@ -1640,9 +1662,7 @@
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 @@
literal = fStringBuffer;
literal2 = fStringBuffer2;
} else {
- if (isPEDecl) {
- checkLimit("%" + entityName, literal);
- }
+ checkEntityLimit(isPEDecl, entityName, literal);
}
value.setValues(literal);
nonNormalizedValue.setValues(literal2);
@@ -2152,35 +2170,49 @@
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 = fEntityManager.fLimitAnalyzer;
}
- 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)});
+ 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 @@
// Constants
//
- protected int fElementAttributeLimit;
+ protected int fElementAttributeLimit, fXMLNameLimit;
/** External subset resolver. **/
protected ExternalSubsetResolver fExternalSubsetResolver;
@@ -425,7 +425,7 @@
*/
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 @@
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 @@
scanAttributeValue(tmpStr, fTempString2,
fAttributeQName.rawname, attributes,
- attIndex, isVC);
+ attIndex, isVC, fCurrentElement.rawname);
// content
int oldLen = attributes.getLength();
@@ -1905,7 +1906,7 @@
//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 @@
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 @@
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 @@
} //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 @@
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 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,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.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 @@
// 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 @@
* 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 @@
/**
* 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 @@
* 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 @@
* 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 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 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 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 @@
/**
* 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 @@
* @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 @@
}
// start the entity
- startEntity(entityName, xmlInputSource, literal, external);
+ startEntity(isGE, entityName, xmlInputSource, literal, external);
} // startEntity(String,boolean)
@@ -1249,7 +1253,7 @@
*/
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 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 @@
* 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 @@
* @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 @@
}
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 @@
// 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 @@
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 @@
// 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.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 @@
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 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 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 @@
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 @@
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 @@
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 @@
} // 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 @@
}
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 @@
}
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.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 @@
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 @@
// caller to specify the location of the error being
// reported. -Ac
- fMessageFormatters = new Hashtable();
+ fMessageFormatters = new HashMap<>();
} // <init>()
@@ -291,7 +250,7 @@
* @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 @@
* @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.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 @@
XMLString tmpStr = getString();
scanAttributeValue(tmpStr, fTempString2,
fAttributeQName.rawname, attributes,
- attrIndex, isVC);
+ attrIndex, isVC, fCurrentElement.rawname);
String value = null;
//fTempString.toString();
@@ -453,7 +454,15 @@
// 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 @@
* @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 @@
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 @@
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 @@
}
} 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 @@
// 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.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 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 @@
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 @@
* @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.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 @@
// 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 @@
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 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 @@
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 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 @@
* @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 @@
* @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 @@
* @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 @@
} // 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 @@
//
/** 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 @@
/** Default constructor. */
public DTDGrammarBucket() {
- fGrammars = new Hashtable();
+ fGrammars = new HashMap<>();
} // <init>()
//
@@ -122,7 +82,7 @@
// 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 @@
*/
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 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 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 @@
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 @@
*/
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 @@
* @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 @@
*/
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 @@
* @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 @@
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 @@
# 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\u00F6