1 /* 2 * Licensed to the Apache Software Foundation (ASF) under one 3 * or more contributor license agreements. See the NOTICE file 4 * distributed with this work for additional information 5 * regarding copyright ownership. The ASF licenses this file 6 * to you under the Apache License, Version 2.0 (the "License"); 7 * you may not use this file except in compliance with the License. 8 * You may obtain a copy of the License at 9 * 10 * http://www.apache.org/licenses/LICENSE-2.0 11 * 12 * Unless required by applicable law or agreed to in writing, software 13 * distributed under the License is distributed on an "AS IS" BASIS, 14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 * See the License for the specific language governing permissions and 16 * limitations under the License. 17 */ 18 /* 19 * $Id: XPATHErrorResources.java 468655 2006-10-28 07:12:06Z minchau $ 20 */ 21 package org.apache.xpath.res; 22 23 import java.util.ListResourceBundle; 24 import java.util.Locale; 25 import java.util.MissingResourceException; 26 import java.util.ResourceBundle; 27 28 /** 29 * Set up error messages. 30 * We build a two dimensional array of message keys and 31 * message strings. In order to add a new message here, 32 * you need to first add a Static string constant for the 33 * Key and update the contents array with Key, Value pair 34 * Also you need to update the count of messages(MAX_CODE)or 35 * the count of warnings(MAX_WARNING) [ Information purpose only] 36 * @xsl.usage advanced 37 */ 38 public class XPATHErrorResources extends ListResourceBundle 39 { 40 41 /* 42 * General notes to translators: 43 * 44 * This file contains error and warning messages related to XPath Error 45 * Handling. 46 * 47 * 1) Xalan (or more properly, Xalan-interpretive) and XSLTC are names of 48 * components. 49 * XSLT is an acronym for "XML Stylesheet Language: Transformations". 50 * XSLTC is an acronym for XSLT Compiler. 51 * 52 * 2) A stylesheet is a description of how to transform an input XML document 53 * into a resultant XML document (or HTML document or text). The 54 * stylesheet itself is described in the form of an XML document. 55 * 56 * 3) A template is a component of a stylesheet that is used to match a 57 * particular portion of an input document and specifies the form of the 58 * corresponding portion of the output document. 59 * 60 * 4) An element is a mark-up tag in an XML document; an attribute is a 61 * modifier on the tag. For example, in <elem attr='val' attr2='val2'> 62 * "elem" is an element name, "attr" and "attr2" are attribute names with 63 * the values "val" and "val2", respectively. 64 * 65 * 5) A namespace declaration is a special attribute that is used to associate 66 * a prefix with a URI (the namespace). The meanings of element names and 67 * attribute names that use that prefix are defined with respect to that 68 * namespace. 69 * 70 * 6) "Translet" is an invented term that describes the class file that 71 * results from compiling an XML stylesheet into a Java class. 72 * 73 * 7) XPath is a specification that describes a notation for identifying 74 * nodes in a tree-structured representation of an XML document. An 75 * instance of that notation is referred to as an XPath expression. 76 * 77 * 8) The context node is the node in the document with respect to which an 78 * XPath expression is being evaluated. 79 * 80 * 9) An iterator is an object that traverses nodes in the tree, one at a time. 81 * 82 * 10) NCName is an XML term used to describe a name that does not contain a 83 * colon (a "no-colon name"). 84 * 85 * 11) QName is an XML term meaning "qualified name". 86 */ 87 88 /* 89 * static variables 90 */ 91 public static final String ERROR0000 = "ERROR0000"; 92 public static final String ER_CURRENT_NOT_ALLOWED_IN_MATCH = 93 "ER_CURRENT_NOT_ALLOWED_IN_MATCH"; 94 public static final String ER_CURRENT_TAKES_NO_ARGS = 95 "ER_CURRENT_TAKES_NO_ARGS"; 96 public static final String ER_DOCUMENT_REPLACED = "ER_DOCUMENT_REPLACED"; 97 public static final String ER_CONTEXT_HAS_NO_OWNERDOC = 98 "ER_CONTEXT_HAS_NO_OWNERDOC"; 99 public static final String ER_LOCALNAME_HAS_TOO_MANY_ARGS = 100 "ER_LOCALNAME_HAS_TOO_MANY_ARGS"; 101 public static final String ER_NAMESPACEURI_HAS_TOO_MANY_ARGS = 102 "ER_NAMESPACEURI_HAS_TOO_MANY_ARGS"; 103 public static final String ER_NORMALIZESPACE_HAS_TOO_MANY_ARGS = 104 "ER_NORMALIZESPACE_HAS_TOO_MANY_ARGS"; 105 public static final String ER_NUMBER_HAS_TOO_MANY_ARGS = 106 "ER_NUMBER_HAS_TOO_MANY_ARGS"; 107 public static final String ER_NAME_HAS_TOO_MANY_ARGS = 108 "ER_NAME_HAS_TOO_MANY_ARGS"; 109 public static final String ER_STRING_HAS_TOO_MANY_ARGS = 110 "ER_STRING_HAS_TOO_MANY_ARGS"; 111 public static final String ER_STRINGLENGTH_HAS_TOO_MANY_ARGS = 112 "ER_STRINGLENGTH_HAS_TOO_MANY_ARGS"; 113 public static final String ER_TRANSLATE_TAKES_3_ARGS = 114 "ER_TRANSLATE_TAKES_3_ARGS"; 115 public static final String ER_UNPARSEDENTITYURI_TAKES_1_ARG = 116 "ER_UNPARSEDENTITYURI_TAKES_1_ARG"; 117 public static final String ER_NAMESPACEAXIS_NOT_IMPLEMENTED = 118 "ER_NAMESPACEAXIS_NOT_IMPLEMENTED"; 119 public static final String ER_UNKNOWN_AXIS = "ER_UNKNOWN_AXIS"; 120 public static final String ER_UNKNOWN_MATCH_OPERATION = 121 "ER_UNKNOWN_MATCH_OPERATION"; 122 public static final String ER_INCORRECT_ARG_LENGTH ="ER_INCORRECT_ARG_LENGTH"; 123 public static final String ER_CANT_CONVERT_TO_NUMBER = 124 "ER_CANT_CONVERT_TO_NUMBER"; 125 public static final String ER_CANT_CONVERT_XPATHRESULTTYPE_TO_NUMBER = 126 "ER_CANT_CONVERT_XPATHRESULTTYPE_TO_NUMBER"; 127 public static final String ER_CANT_CONVERT_TO_NODELIST = 128 "ER_CANT_CONVERT_TO_NODELIST"; 129 public static final String ER_CANT_CONVERT_TO_MUTABLENODELIST = 130 "ER_CANT_CONVERT_TO_MUTABLENODELIST"; 131 public static final String ER_CANT_CONVERT_TO_TYPE ="ER_CANT_CONVERT_TO_TYPE"; 132 public static final String ER_EXPECTED_MATCH_PATTERN = 133 "ER_EXPECTED_MATCH_PATTERN"; 134 public static final String ER_COULDNOT_GET_VAR_NAMED = 135 "ER_COULDNOT_GET_VAR_NAMED"; 136 public static final String ER_UNKNOWN_OPCODE = "ER_UNKNOWN_OPCODE"; 137 public static final String ER_EXTRA_ILLEGAL_TOKENS ="ER_EXTRA_ILLEGAL_TOKENS"; 138 public static final String ER_EXPECTED_DOUBLE_QUOTE = 139 "ER_EXPECTED_DOUBLE_QUOTE"; 140 public static final String ER_EXPECTED_SINGLE_QUOTE = 141 "ER_EXPECTED_SINGLE_QUOTE"; 142 public static final String ER_EMPTY_EXPRESSION = "ER_EMPTY_EXPRESSION"; 143 public static final String ER_EXPECTED_BUT_FOUND = "ER_EXPECTED_BUT_FOUND"; 144 public static final String ER_INCORRECT_PROGRAMMER_ASSERTION = 145 "ER_INCORRECT_PROGRAMMER_ASSERTION"; 146 public static final String ER_BOOLEAN_ARG_NO_LONGER_OPTIONAL = 147 "ER_BOOLEAN_ARG_NO_LONGER_OPTIONAL"; 148 public static final String ER_FOUND_COMMA_BUT_NO_PRECEDING_ARG = 149 "ER_FOUND_COMMA_BUT_NO_PRECEDING_ARG"; 150 public static final String ER_FOUND_COMMA_BUT_NO_FOLLOWING_ARG = 151 "ER_FOUND_COMMA_BUT_NO_FOLLOWING_ARG"; 152 public static final String ER_PREDICATE_ILLEGAL_SYNTAX = 153 "ER_PREDICATE_ILLEGAL_SYNTAX"; 154 public static final String ER_ILLEGAL_AXIS_NAME = "ER_ILLEGAL_AXIS_NAME"; 155 public static final String ER_UNKNOWN_NODETYPE = "ER_UNKNOWN_NODETYPE"; 156 public static final String ER_PATTERN_LITERAL_NEEDS_BE_QUOTED = 157 "ER_PATTERN_LITERAL_NEEDS_BE_QUOTED"; 158 public static final String ER_COULDNOT_BE_FORMATTED_TO_NUMBER = 159 "ER_COULDNOT_BE_FORMATTED_TO_NUMBER"; 160 public static final String ER_COULDNOT_CREATE_XMLPROCESSORLIAISON = 161 "ER_COULDNOT_CREATE_XMLPROCESSORLIAISON"; 162 public static final String ER_DIDNOT_FIND_XPATH_SELECT_EXP = 163 "ER_DIDNOT_FIND_XPATH_SELECT_EXP"; 164 public static final String ER_COULDNOT_FIND_ENDOP_AFTER_OPLOCATIONPATH = 165 "ER_COULDNOT_FIND_ENDOP_AFTER_OPLOCATIONPATH"; 166 public static final String ER_ERROR_OCCURED = "ER_ERROR_OCCURED"; 167 public static final String ER_ILLEGAL_VARIABLE_REFERENCE = 168 "ER_ILLEGAL_VARIABLE_REFERENCE"; 169 public static final String ER_AXES_NOT_ALLOWED = "ER_AXES_NOT_ALLOWED"; 170 public static final String ER_KEY_HAS_TOO_MANY_ARGS = 171 "ER_KEY_HAS_TOO_MANY_ARGS"; 172 public static final String ER_COUNT_TAKES_1_ARG = "ER_COUNT_TAKES_1_ARG"; 173 public static final String ER_COULDNOT_FIND_FUNCTION = 174 "ER_COULDNOT_FIND_FUNCTION"; 175 public static final String ER_UNSUPPORTED_ENCODING ="ER_UNSUPPORTED_ENCODING"; 176 public static final String ER_PROBLEM_IN_DTM_NEXTSIBLING = 177 "ER_PROBLEM_IN_DTM_NEXTSIBLING"; 178 public static final String ER_CANNOT_WRITE_TO_EMPTYNODELISTIMPL = 179 "ER_CANNOT_WRITE_TO_EMPTYNODELISTIMPL"; 180 public static final String ER_SETDOMFACTORY_NOT_SUPPORTED = 181 "ER_SETDOMFACTORY_NOT_SUPPORTED"; 182 public static final String ER_PREFIX_MUST_RESOLVE = "ER_PREFIX_MUST_RESOLVE"; 183 public static final String ER_PARSE_NOT_SUPPORTED = "ER_PARSE_NOT_SUPPORTED"; 184 public static final String ER_SAX_API_NOT_HANDLED = "ER_SAX_API_NOT_HANDLED"; 185 public static final String ER_IGNORABLE_WHITESPACE_NOT_HANDLED = 186 "ER_IGNORABLE_WHITESPACE_NOT_HANDLED"; 187 public static final String ER_DTM_CANNOT_HANDLE_NODES = 188 "ER_DTM_CANNOT_HANDLE_NODES"; 189 public static final String ER_XERCES_CANNOT_HANDLE_NODES = 190 "ER_XERCES_CANNOT_HANDLE_NODES"; 191 public static final String ER_XERCES_PARSE_ERROR_DETAILS = 192 "ER_XERCES_PARSE_ERROR_DETAILS"; 193 public static final String ER_XERCES_PARSE_ERROR = "ER_XERCES_PARSE_ERROR"; 194 public static final String ER_INVALID_UTF16_SURROGATE = 195 "ER_INVALID_UTF16_SURROGATE"; 196 public static final String ER_OIERROR = "ER_OIERROR"; 197 public static final String ER_CANNOT_CREATE_URL = "ER_CANNOT_CREATE_URL"; 198 public static final String ER_XPATH_READOBJECT = "ER_XPATH_READOBJECT"; 199 public static final String ER_FUNCTION_TOKEN_NOT_FOUND = 200 "ER_FUNCTION_TOKEN_NOT_FOUND"; 201 public static final String ER_CANNOT_DEAL_XPATH_TYPE = 202 "ER_CANNOT_DEAL_XPATH_TYPE"; 203 public static final String ER_NODESET_NOT_MUTABLE = "ER_NODESET_NOT_MUTABLE"; 204 public static final String ER_NODESETDTM_NOT_MUTABLE = 205 "ER_NODESETDTM_NOT_MUTABLE"; 206 /** Variable not resolvable: */ 207 public static final String ER_VAR_NOT_RESOLVABLE = "ER_VAR_NOT_RESOLVABLE"; 208 /** Null error handler */ 209 public static final String ER_NULL_ERROR_HANDLER = "ER_NULL_ERROR_HANDLER"; 210 /** Programmer's assertion: unknown opcode */ 211 public static final String ER_PROG_ASSERT_UNKNOWN_OPCODE = 212 "ER_PROG_ASSERT_UNKNOWN_OPCODE"; 213 /** 0 or 1 */ 214 public static final String ER_ZERO_OR_ONE = "ER_ZERO_OR_ONE"; 215 /** rtf() not supported by XRTreeFragSelectWrapper */ 216 public static final String ER_RTF_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER = 217 "ER_RTF_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER"; 218 /** asNodeIterator() not supported by XRTreeFragSelectWrapper */ 219 public static final String ER_ASNODEITERATOR_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER = "ER_ASNODEITERATOR_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER"; 220 /** fsb() not supported for XStringForChars */ 221 public static final String ER_FSB_NOT_SUPPORTED_XSTRINGFORCHARS = 222 "ER_FSB_NOT_SUPPORTED_XSTRINGFORCHARS"; 223 /** Could not find variable with the name of */ 224 public static final String ER_COULD_NOT_FIND_VAR = "ER_COULD_NOT_FIND_VAR"; 225 /** XStringForChars can not take a string for an argument */ 226 public static final String ER_XSTRINGFORCHARS_CANNOT_TAKE_STRING = 227 "ER_XSTRINGFORCHARS_CANNOT_TAKE_STRING"; 228 /** The FastStringBuffer argument can not be null */ 229 public static final String ER_FASTSTRINGBUFFER_CANNOT_BE_NULL = 230 "ER_FASTSTRINGBUFFER_CANNOT_BE_NULL"; 231 /** 2 or 3 */ 232 public static final String ER_TWO_OR_THREE = "ER_TWO_OR_THREE"; 233 /** Variable accessed before it is bound! */ 234 public static final String ER_VARIABLE_ACCESSED_BEFORE_BIND = 235 "ER_VARIABLE_ACCESSED_BEFORE_BIND"; 236 /** XStringForFSB can not take a string for an argument! */ 237 public static final String ER_FSB_CANNOT_TAKE_STRING = 238 "ER_FSB_CANNOT_TAKE_STRING"; 239 /** Error! Setting the root of a walker to null! */ 240 public static final String ER_SETTING_WALKER_ROOT_TO_NULL = 241 "ER_SETTING_WALKER_ROOT_TO_NULL"; 242 /** This NodeSetDTM can not iterate to a previous node! */ 243 public static final String ER_NODESETDTM_CANNOT_ITERATE = 244 "ER_NODESETDTM_CANNOT_ITERATE"; 245 /** This NodeSet can not iterate to a previous node! */ 246 public static final String ER_NODESET_CANNOT_ITERATE = 247 "ER_NODESET_CANNOT_ITERATE"; 248 /** This NodeSetDTM can not do indexing or counting functions! */ 249 public static final String ER_NODESETDTM_CANNOT_INDEX = 250 "ER_NODESETDTM_CANNOT_INDEX"; 251 /** This NodeSet can not do indexing or counting functions! */ 252 public static final String ER_NODESET_CANNOT_INDEX = 253 "ER_NODESET_CANNOT_INDEX"; 254 /** Can not call setShouldCacheNodes after nextNode has been called! */ 255 public static final String ER_CANNOT_CALL_SETSHOULDCACHENODE = 256 "ER_CANNOT_CALL_SETSHOULDCACHENODE"; 257 /** {0} only allows {1} arguments */ 258 public static final String ER_ONLY_ALLOWS = "ER_ONLY_ALLOWS"; 259 /** Programmer's assertion in getNextStepPos: unknown stepType: {0} */ 260 public static final String ER_UNKNOWN_STEP = "ER_UNKNOWN_STEP"; 261 /** Problem with RelativeLocationPath */ 262 public static final String ER_EXPECTED_REL_LOC_PATH = 263 "ER_EXPECTED_REL_LOC_PATH"; 264 /** Problem with LocationPath */ 265 public static final String ER_EXPECTED_LOC_PATH = "ER_EXPECTED_LOC_PATH"; 266 public static final String ER_EXPECTED_LOC_PATH_AT_END_EXPR = 267 "ER_EXPECTED_LOC_PATH_AT_END_EXPR"; 268 /** Problem with Step */ 269 public static final String ER_EXPECTED_LOC_STEP = "ER_EXPECTED_LOC_STEP"; 270 /** Problem with NodeTest */ 271 public static final String ER_EXPECTED_NODE_TEST = "ER_EXPECTED_NODE_TEST"; 272 /** Expected step pattern */ 273 public static final String ER_EXPECTED_STEP_PATTERN = 274 "ER_EXPECTED_STEP_PATTERN"; 275 /** Expected relative path pattern */ 276 public static final String ER_EXPECTED_REL_PATH_PATTERN = 277 "ER_EXPECTED_REL_PATH_PATTERN"; 278 /** ER_CANT_CONVERT_XPATHRESULTTYPE_TO_BOOLEAN */ 279 public static final String ER_CANT_CONVERT_TO_BOOLEAN = 280 "ER_CANT_CONVERT_TO_BOOLEAN"; 281 /** Field ER_CANT_CONVERT_TO_SINGLENODE */ 282 public static final String ER_CANT_CONVERT_TO_SINGLENODE = 283 "ER_CANT_CONVERT_TO_SINGLENODE"; 284 /** Field ER_CANT_GET_SNAPSHOT_LENGTH */ 285 public static final String ER_CANT_GET_SNAPSHOT_LENGTH = 286 "ER_CANT_GET_SNAPSHOT_LENGTH"; 287 /** Field ER_NON_ITERATOR_TYPE */ 288 public static final String ER_NON_ITERATOR_TYPE = "ER_NON_ITERATOR_TYPE"; 289 /** Field ER_DOC_MUTATED */ 290 public static final String ER_DOC_MUTATED = "ER_DOC_MUTATED"; 291 public static final String ER_INVALID_XPATH_TYPE = "ER_INVALID_XPATH_TYPE"; 292 public static final String ER_EMPTY_XPATH_RESULT = "ER_EMPTY_XPATH_RESULT"; 293 public static final String ER_INCOMPATIBLE_TYPES = "ER_INCOMPATIBLE_TYPES"; 294 public static final String ER_NULL_RESOLVER = "ER_NULL_RESOLVER"; 295 public static final String ER_CANT_CONVERT_TO_STRING = 296 "ER_CANT_CONVERT_TO_STRING"; 297 public static final String ER_NON_SNAPSHOT_TYPE = "ER_NON_SNAPSHOT_TYPE"; 298 public static final String ER_WRONG_DOCUMENT = "ER_WRONG_DOCUMENT"; 299 /* Note to translators: The XPath expression cannot be evaluated with respect 300 * to this type of node. 301 */ 302 /** Field ER_WRONG_NODETYPE */ 303 public static final String ER_WRONG_NODETYPE = "ER_WRONG_NODETYPE"; 304 public static final String ER_XPATH_ERROR = "ER_XPATH_ERROR"; 305 306 //BEGIN: Keys needed for exception messages of JAXP 1.3 XPath API implementation 307 public static final String ER_EXTENSION_FUNCTION_CANNOT_BE_INVOKED = "ER_EXTENSION_FUNCTION_CANNOT_BE_INVOKED"; 308 public static final String ER_RESOLVE_VARIABLE_RETURNS_NULL = "ER_RESOLVE_VARIABLE_RETURNS_NULL"; 309 public static final String ER_UNSUPPORTED_RETURN_TYPE = "ER_UNSUPPORTED_RETURN_TYPE"; 310 public static final String ER_SOURCE_RETURN_TYPE_CANNOT_BE_NULL = "ER_SOURCE_RETURN_TYPE_CANNOT_BE_NULL"; 311 public static final String ER_ARG_CANNOT_BE_NULL = "ER_ARG_CANNOT_BE_NULL"; 312 313 public static final String ER_OBJECT_MODEL_NULL = "ER_OBJECT_MODEL_NULL"; 314 public static final String ER_OBJECT_MODEL_EMPTY = "ER_OBJECT_MODEL_EMPTY"; 315 public static final String ER_FEATURE_NAME_NULL = "ER_FEATURE_NAME_NULL"; 316 public static final String ER_FEATURE_UNKNOWN = "ER_FEATURE_UNKNOWN"; 317 public static final String ER_GETTING_NULL_FEATURE = "ER_GETTING_NULL_FEATURE"; 318 public static final String ER_GETTING_UNKNOWN_FEATURE = "ER_GETTING_UNKNOWN_FEATURE"; 319 public static final String ER_NULL_XPATH_FUNCTION_RESOLVER = "ER_NULL_XPATH_FUNCTION_RESOLVER"; 320 public static final String ER_NULL_XPATH_VARIABLE_RESOLVER = "ER_NULL_XPATH_VARIABLE_RESOLVER"; 321 //END: Keys needed for exception messages of JAXP 1.3 XPath API implementation 322 323 public static final String WG_LOCALE_NAME_NOT_HANDLED = 324 "WG_LOCALE_NAME_NOT_HANDLED"; 325 public static final String WG_PROPERTY_NOT_SUPPORTED = 326 "WG_PROPERTY_NOT_SUPPORTED"; 327 public static final String WG_DONT_DO_ANYTHING_WITH_NS = 328 "WG_DONT_DO_ANYTHING_WITH_NS"; 329 public static final String WG_SECURITY_EXCEPTION = "WG_SECURITY_EXCEPTION"; 330 public static final String WG_QUO_NO_LONGER_DEFINED = 331 "WG_QUO_NO_LONGER_DEFINED"; 332 public static final String WG_NEED_DERIVED_OBJECT_TO_IMPLEMENT_NODETEST = 333 "WG_NEED_DERIVED_OBJECT_TO_IMPLEMENT_NODETEST"; 334 public static final String WG_FUNCTION_TOKEN_NOT_FOUND = 335 "WG_FUNCTION_TOKEN_NOT_FOUND"; 336 public static final String WG_COULDNOT_FIND_FUNCTION = 337 "WG_COULDNOT_FIND_FUNCTION"; 338 public static final String WG_CANNOT_MAKE_URL_FROM ="WG_CANNOT_MAKE_URL_FROM"; 339 public static final String WG_EXPAND_ENTITIES_NOT_SUPPORTED = 340 "WG_EXPAND_ENTITIES_NOT_SUPPORTED"; 341 public static final String WG_ILLEGAL_VARIABLE_REFERENCE = 342 "WG_ILLEGAL_VARIABLE_REFERENCE"; 343 public static final String WG_UNSUPPORTED_ENCODING ="WG_UNSUPPORTED_ENCODING"; 344 345 /** detach() not supported by XRTreeFragSelectWrapper */ 346 public static final String ER_DETACH_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER = 347 "ER_DETACH_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER"; 348 /** num() not supported by XRTreeFragSelectWrapper */ 349 public static final String ER_NUM_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER = 350 "ER_NUM_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER"; 351 /** xstr() not supported by XRTreeFragSelectWrapper */ 352 public static final String ER_XSTR_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER = 353 "ER_XSTR_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER"; 354 /** str() not supported by XRTreeFragSelectWrapper */ 355 public static final String ER_STR_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER = 356 "ER_STR_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER"; 357 358 // Error messages... 359 360 361 /** 362 * Get the association list. 363 * 364 * @return The association list. 365 */ getContents()366 public Object[][] getContents() 367 { 368 return new Object[][]{ 369 370 { "ERROR0000" , "{0}" }, 371 372 { ER_CURRENT_NOT_ALLOWED_IN_MATCH, "The current() function is not allowed in a match pattern!" }, 373 374 { ER_CURRENT_TAKES_NO_ARGS, "The current() function does not accept arguments!" }, 375 376 { ER_DOCUMENT_REPLACED, 377 "document() function implementation has been replaced by org.apache.xalan.xslt.FuncDocument!"}, 378 379 { ER_CONTEXT_HAS_NO_OWNERDOC, 380 "context does not have an owner document!"}, 381 382 { ER_LOCALNAME_HAS_TOO_MANY_ARGS, 383 "local-name() has too many arguments."}, 384 385 { ER_NAMESPACEURI_HAS_TOO_MANY_ARGS, 386 "namespace-uri() has too many arguments."}, 387 388 { ER_NORMALIZESPACE_HAS_TOO_MANY_ARGS, 389 "normalize-space() has too many arguments."}, 390 391 { ER_NUMBER_HAS_TOO_MANY_ARGS, 392 "number() has too many arguments."}, 393 394 { ER_NAME_HAS_TOO_MANY_ARGS, 395 "name() has too many arguments."}, 396 397 { ER_STRING_HAS_TOO_MANY_ARGS, 398 "string() has too many arguments."}, 399 400 { ER_STRINGLENGTH_HAS_TOO_MANY_ARGS, 401 "string-length() has too many arguments."}, 402 403 { ER_TRANSLATE_TAKES_3_ARGS, 404 "The translate() function takes three arguments!"}, 405 406 { ER_UNPARSEDENTITYURI_TAKES_1_ARG, 407 "The unparsed-entity-uri function should take one argument!"}, 408 409 { ER_NAMESPACEAXIS_NOT_IMPLEMENTED, 410 "namespace axis not implemented yet!"}, 411 412 { ER_UNKNOWN_AXIS, 413 "unknown axis: {0}"}, 414 415 { ER_UNKNOWN_MATCH_OPERATION, 416 "unknown match operation!"}, 417 418 { ER_INCORRECT_ARG_LENGTH, 419 "Arg length of processing-instruction() node test is incorrect!"}, 420 421 { ER_CANT_CONVERT_TO_NUMBER, 422 "Can not convert {0} to a number"}, 423 424 { ER_CANT_CONVERT_TO_NODELIST, 425 "Can not convert {0} to a NodeList!"}, 426 427 { ER_CANT_CONVERT_TO_MUTABLENODELIST, 428 "Can not convert {0} to a NodeSetDTM!"}, 429 430 { ER_CANT_CONVERT_TO_TYPE, 431 "Can not convert {0} to a type#{1}"}, 432 433 { ER_EXPECTED_MATCH_PATTERN, 434 "Expected match pattern in getMatchScore!"}, 435 436 { ER_COULDNOT_GET_VAR_NAMED, 437 "Could not get variable named {0}"}, 438 439 { ER_UNKNOWN_OPCODE, 440 "ERROR! Unknown op code: {0}"}, 441 442 { ER_EXTRA_ILLEGAL_TOKENS, 443 "Extra illegal tokens: {0}"}, 444 445 { ER_EXPECTED_DOUBLE_QUOTE, 446 "misquoted literal... expected double quote!"}, 447 448 { ER_EXPECTED_SINGLE_QUOTE, 449 "misquoted literal... expected single quote!"}, 450 451 { ER_EMPTY_EXPRESSION, 452 "Empty expression!"}, 453 454 { ER_EXPECTED_BUT_FOUND, 455 "Expected {0}, but found: {1}"}, 456 457 { ER_INCORRECT_PROGRAMMER_ASSERTION, 458 "Programmer assertion is incorrect! - {0}"}, 459 460 { ER_BOOLEAN_ARG_NO_LONGER_OPTIONAL, 461 "boolean(...) argument is no longer optional with 19990709 XPath draft."}, 462 463 { ER_FOUND_COMMA_BUT_NO_PRECEDING_ARG, 464 "Found ',' but no preceding argument!"}, 465 466 { ER_FOUND_COMMA_BUT_NO_FOLLOWING_ARG, 467 "Found ',' but no following argument!"}, 468 469 { ER_PREDICATE_ILLEGAL_SYNTAX, 470 "'..[predicate]' or '.[predicate]' is illegal syntax. Use 'self::node()[predicate]' instead."}, 471 472 { ER_ILLEGAL_AXIS_NAME, 473 "illegal axis name: {0}"}, 474 475 { ER_UNKNOWN_NODETYPE, 476 "Unknown nodetype: {0}"}, 477 478 { ER_PATTERN_LITERAL_NEEDS_BE_QUOTED, 479 "Pattern literal ({0}) needs to be quoted!"}, 480 481 { ER_COULDNOT_BE_FORMATTED_TO_NUMBER, 482 "{0} could not be formatted to a number!"}, 483 484 { ER_COULDNOT_CREATE_XMLPROCESSORLIAISON, 485 "Could not create XML TransformerFactory Liaison: {0}"}, 486 487 { ER_DIDNOT_FIND_XPATH_SELECT_EXP, 488 "Error! Did not find xpath select expression (-select)."}, 489 490 { ER_COULDNOT_FIND_ENDOP_AFTER_OPLOCATIONPATH, 491 "ERROR! Could not find ENDOP after OP_LOCATIONPATH"}, 492 493 { ER_ERROR_OCCURED, 494 "Error occured!"}, 495 496 { ER_ILLEGAL_VARIABLE_REFERENCE, 497 "VariableReference given for variable out of context or without definition! Name = {0}"}, 498 499 { ER_AXES_NOT_ALLOWED, 500 "Only child:: and attribute:: axes are allowed in match patterns! Offending axes = {0}"}, 501 502 { ER_KEY_HAS_TOO_MANY_ARGS, 503 "key() has an incorrect number of arguments."}, 504 505 { ER_COUNT_TAKES_1_ARG, 506 "The count function should take one argument!"}, 507 508 { ER_COULDNOT_FIND_FUNCTION, 509 "Could not find function: {0}"}, 510 511 { ER_UNSUPPORTED_ENCODING, 512 "Unsupported encoding: {0}"}, 513 514 { ER_PROBLEM_IN_DTM_NEXTSIBLING, 515 "Problem occured in DTM in getNextSibling... trying to recover"}, 516 517 { ER_CANNOT_WRITE_TO_EMPTYNODELISTIMPL, 518 "Programmer error: EmptyNodeList can not be written to."}, 519 520 { ER_SETDOMFACTORY_NOT_SUPPORTED, 521 "setDOMFactory is not supported by XPathContext!"}, 522 523 { ER_PREFIX_MUST_RESOLVE, 524 "Prefix must resolve to a namespace: {0}"}, 525 526 { ER_PARSE_NOT_SUPPORTED, 527 "parse (InputSource source) not supported in XPathContext! Can not open {0}"}, 528 529 { ER_SAX_API_NOT_HANDLED, 530 "SAX API characters(char ch[]... not handled by the DTM!"}, 531 532 { ER_IGNORABLE_WHITESPACE_NOT_HANDLED, 533 "ignorableWhitespace(char ch[]... not handled by the DTM!"}, 534 535 { ER_DTM_CANNOT_HANDLE_NODES, 536 "DTMLiaison can not handle nodes of type {0}"}, 537 538 { ER_XERCES_CANNOT_HANDLE_NODES, 539 "DOM2Helper can not handle nodes of type {0}"}, 540 541 { ER_XERCES_PARSE_ERROR_DETAILS, 542 "DOM2Helper.parse error: SystemID - {0} line - {1}"}, 543 544 { ER_XERCES_PARSE_ERROR, 545 "DOM2Helper.parse error"}, 546 547 { ER_INVALID_UTF16_SURROGATE, 548 "Invalid UTF-16 surrogate detected: {0} ?"}, 549 550 { ER_OIERROR, 551 "IO error"}, 552 553 { ER_CANNOT_CREATE_URL, 554 "Cannot create url for: {0}"}, 555 556 { ER_XPATH_READOBJECT, 557 "In XPath.readObject: {0}"}, 558 559 { ER_FUNCTION_TOKEN_NOT_FOUND, 560 "function token not found."}, 561 562 { ER_CANNOT_DEAL_XPATH_TYPE, 563 "Can not deal with XPath type: {0}"}, 564 565 { ER_NODESET_NOT_MUTABLE, 566 "This NodeSet is not mutable"}, 567 568 { ER_NODESETDTM_NOT_MUTABLE, 569 "This NodeSetDTM is not mutable"}, 570 571 { ER_VAR_NOT_RESOLVABLE, 572 "Variable not resolvable: {0}"}, 573 574 { ER_NULL_ERROR_HANDLER, 575 "Null error handler"}, 576 577 { ER_PROG_ASSERT_UNKNOWN_OPCODE, 578 "Programmer''s assertion: unknown opcode: {0}"}, 579 580 { ER_ZERO_OR_ONE, 581 "0 or 1"}, 582 583 { ER_RTF_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER, 584 "rtf() not supported by XRTreeFragSelectWrapper"}, 585 586 { ER_RTF_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER, 587 "asNodeIterator() not supported by XRTreeFragSelectWrapper"}, 588 589 /** detach() not supported by XRTreeFragSelectWrapper */ 590 { ER_DETACH_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER, 591 "detach() not supported by XRTreeFragSelectWrapper"}, 592 593 /** num() not supported by XRTreeFragSelectWrapper */ 594 { ER_NUM_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER, 595 "num() not supported by XRTreeFragSelectWrapper"}, 596 597 /** xstr() not supported by XRTreeFragSelectWrapper */ 598 { ER_XSTR_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER, 599 "xstr() not supported by XRTreeFragSelectWrapper"}, 600 601 /** str() not supported by XRTreeFragSelectWrapper */ 602 { ER_STR_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER, 603 "str() not supported by XRTreeFragSelectWrapper"}, 604 605 { ER_FSB_NOT_SUPPORTED_XSTRINGFORCHARS, 606 "fsb() not supported for XStringForChars"}, 607 608 { ER_COULD_NOT_FIND_VAR, 609 "Could not find variable with the name of {0}"}, 610 611 { ER_XSTRINGFORCHARS_CANNOT_TAKE_STRING, 612 "XStringForChars can not take a string for an argument"}, 613 614 { ER_FASTSTRINGBUFFER_CANNOT_BE_NULL, 615 "The FastStringBuffer argument can not be null"}, 616 617 { ER_TWO_OR_THREE, 618 "2 or 3"}, 619 620 { ER_VARIABLE_ACCESSED_BEFORE_BIND, 621 "Variable accessed before it is bound!"}, 622 623 { ER_FSB_CANNOT_TAKE_STRING, 624 "XStringForFSB can not take a string for an argument!"}, 625 626 { ER_SETTING_WALKER_ROOT_TO_NULL, 627 "\n !!!! Error! Setting the root of a walker to null!!!"}, 628 629 { ER_NODESETDTM_CANNOT_ITERATE, 630 "This NodeSetDTM can not iterate to a previous node!"}, 631 632 { ER_NODESET_CANNOT_ITERATE, 633 "This NodeSet can not iterate to a previous node!"}, 634 635 { ER_NODESETDTM_CANNOT_INDEX, 636 "This NodeSetDTM can not do indexing or counting functions!"}, 637 638 { ER_NODESET_CANNOT_INDEX, 639 "This NodeSet can not do indexing or counting functions!"}, 640 641 { ER_CANNOT_CALL_SETSHOULDCACHENODE, 642 "Can not call setShouldCacheNodes after nextNode has been called!"}, 643 644 { ER_ONLY_ALLOWS, 645 "{0} only allows {1} arguments"}, 646 647 { ER_UNKNOWN_STEP, 648 "Programmer''s assertion in getNextStepPos: unknown stepType: {0}"}, 649 650 //Note to translators: A relative location path is a form of XPath expression. 651 // The message indicates that such an expression was expected following the 652 // characters '/' or '//', but was not found. 653 { ER_EXPECTED_REL_LOC_PATH, 654 "A relative location path was expected following the '/' or '//' token."}, 655 656 // Note to translators: A location path is a form of XPath expression. 657 // The message indicates that syntactically such an expression was expected,but 658 // the characters specified by the substitution text were encountered instead. 659 { ER_EXPECTED_LOC_PATH, 660 "A location path was expected, but the following token was encountered\u003a {0}"}, 661 662 // Note to translators: A location path is a form of XPath expression. 663 // The message indicates that syntactically such a subexpression was expected, 664 // but no more characters were found in the expression. 665 { ER_EXPECTED_LOC_PATH_AT_END_EXPR, 666 "A location path was expected, but the end of the XPath expression was found instead."}, 667 668 // Note to translators: A location step is part of an XPath expression. 669 // The message indicates that syntactically such an expression was expected 670 // following the specified characters. 671 { ER_EXPECTED_LOC_STEP, 672 "A location step was expected following the '/' or '//' token."}, 673 674 // Note to translators: A node test is part of an XPath expression that is 675 // used to test for particular kinds of nodes. In this case, a node test that 676 // consists of an NCName followed by a colon and an asterisk or that consists 677 // of a QName was expected, but was not found. 678 { ER_EXPECTED_NODE_TEST, 679 "A node test that matches either NCName:* or QName was expected."}, 680 681 // Note to translators: A step pattern is part of an XPath expression. 682 // The message indicates that syntactically such an expression was expected, 683 // but the specified character was found in the expression instead. 684 { ER_EXPECTED_STEP_PATTERN, 685 "A step pattern was expected, but '/' was encountered."}, 686 687 // Note to translators: A relative path pattern is part of an XPath expression. 688 // The message indicates that syntactically such an expression was expected, 689 // but was not found. 690 { ER_EXPECTED_REL_PATH_PATTERN, 691 "A relative path pattern was expected."}, 692 693 // Note to translators: The substitution text is the name of a data type. The 694 // message indicates that a value of a particular type could not be converted 695 // to a value of type boolean. 696 { ER_CANT_CONVERT_TO_BOOLEAN, 697 "The XPathResult of XPath expression ''{0}'' has an XPathResultType of {1} which cannot be converted to a boolean."}, 698 699 // Note to translators: Do not translate ANY_UNORDERED_NODE_TYPE and 700 // FIRST_ORDERED_NODE_TYPE. 701 { ER_CANT_CONVERT_TO_SINGLENODE, 702 "The XPathResult of XPath expression ''{0}'' has an XPathResultType of {1} which cannot be converted to a single node. The method getSingleNodeValue applies only to types ANY_UNORDERED_NODE_TYPE and FIRST_ORDERED_NODE_TYPE."}, 703 704 // Note to translators: Do not translate UNORDERED_NODE_SNAPSHOT_TYPE and 705 // ORDERED_NODE_SNAPSHOT_TYPE. 706 { ER_CANT_GET_SNAPSHOT_LENGTH, 707 "The method getSnapshotLength cannot be called on the XPathResult of XPath expression ''{0}'' because its XPathResultType is {1}. This method applies only to types UNORDERED_NODE_SNAPSHOT_TYPE and ORDERED_NODE_SNAPSHOT_TYPE."}, 708 709 { ER_NON_ITERATOR_TYPE, 710 "The method iterateNext cannot be called on the XPathResult of XPath expression ''{0}'' because its XPathResultType is {1}. This method applies only to types UNORDERED_NODE_ITERATOR_TYPE and ORDERED_NODE_ITERATOR_TYPE."}, 711 712 // Note to translators: This message indicates that the document being operated 713 // upon changed, so the iterator object that was being used to traverse the 714 // document has now become invalid. 715 { ER_DOC_MUTATED, 716 "Document mutated since result was returned. Iterator is invalid."}, 717 718 { ER_INVALID_XPATH_TYPE, 719 "Invalid XPath type argument: {0}"}, 720 721 { ER_EMPTY_XPATH_RESULT, 722 "Empty XPath result object"}, 723 724 { ER_INCOMPATIBLE_TYPES, 725 "The XPathResult of XPath expression ''{0}'' has an XPathResultType of {1} which cannot be coerced into the specified XPathResultType of {2}."}, 726 727 { ER_NULL_RESOLVER, 728 "Unable to resolve prefix with null prefix resolver."}, 729 730 // Note to translators: The substitution text is the name of a data type. The 731 // message indicates that a value of a particular type could not be converted 732 // to a value of type string. 733 { ER_CANT_CONVERT_TO_STRING, 734 "The XPathResult of XPath expression ''{0}'' has an XPathResultType of {1} which cannot be converted to a string."}, 735 736 // Note to translators: Do not translate snapshotItem, 737 // UNORDERED_NODE_SNAPSHOT_TYPE and ORDERED_NODE_SNAPSHOT_TYPE. 738 { ER_NON_SNAPSHOT_TYPE, 739 "The method snapshotItem cannot be called on the XPathResult of XPath expression ''{0}'' because its XPathResultType is {1}. This method applies only to types UNORDERED_NODE_SNAPSHOT_TYPE and ORDERED_NODE_SNAPSHOT_TYPE."}, 740 741 // Note to translators: XPathEvaluator is a Java interface name. An 742 // XPathEvaluator is created with respect to a particular XML document, and in 743 // this case the expression represented by this object was being evaluated with 744 // respect to a context node from a different document. 745 { ER_WRONG_DOCUMENT, 746 "Context node does not belong to the document that is bound to this XPathEvaluator."}, 747 748 // Note to translators: The XPath expression cannot be evaluated with respect 749 // to this type of node. 750 { ER_WRONG_NODETYPE, 751 "The context node type is not supported."}, 752 753 { ER_XPATH_ERROR, 754 "Unknown error in XPath."}, 755 756 { ER_CANT_CONVERT_XPATHRESULTTYPE_TO_NUMBER, 757 "The XPathResult of XPath expression ''{0}'' has an XPathResultType of {1} which cannot be converted to a number"}, 758 759 //BEGIN: Definitions of error keys used in exception messages of JAXP 1.3 XPath API implementation 760 761 /** Field ER_EXTENSION_FUNCTION_CANNOT_BE_INVOKED */ 762 763 { ER_EXTENSION_FUNCTION_CANNOT_BE_INVOKED, 764 "Extension function: ''{0}'' can not be invoked when the XMLConstants.FEATURE_SECURE_PROCESSING feature is set to true."}, 765 766 /** Field ER_RESOLVE_VARIABLE_RETURNS_NULL */ 767 768 { ER_RESOLVE_VARIABLE_RETURNS_NULL, 769 "resolveVariable for variable {0} returning null"}, 770 771 /** Field ER_UNSUPPORTED_RETURN_TYPE */ 772 773 { ER_UNSUPPORTED_RETURN_TYPE, 774 "UnSupported Return Type : {0}"}, 775 776 /** Field ER_SOURCE_RETURN_TYPE_CANNOT_BE_NULL */ 777 778 { ER_SOURCE_RETURN_TYPE_CANNOT_BE_NULL, 779 "Source and/or Return Type can not be null"}, 780 781 /** Field ER_SOURCE_RETURN_TYPE_CANNOT_BE_NULL */ 782 783 { ER_SOURCE_RETURN_TYPE_CANNOT_BE_NULL, 784 "Source and/or Return Type can not be null"}, 785 786 /** Field ER_ARG_CANNOT_BE_NULL */ 787 788 { ER_ARG_CANNOT_BE_NULL, 789 "{0} argument can not be null"}, 790 791 /** Field ER_OBJECT_MODEL_NULL */ 792 793 { ER_OBJECT_MODEL_NULL, 794 "{0}#isObjectModelSupported( String objectModel ) cannot be called with objectModel == null"}, 795 796 /** Field ER_OBJECT_MODEL_EMPTY */ 797 798 { ER_OBJECT_MODEL_EMPTY, 799 "{0}#isObjectModelSupported( String objectModel ) cannot be called with objectModel == \"\""}, 800 801 /** Field ER_OBJECT_MODEL_EMPTY */ 802 803 { ER_FEATURE_NAME_NULL, 804 "Trying to set a feature with a null name: {0}#setFeature( null, {1})"}, 805 806 /** Field ER_FEATURE_UNKNOWN */ 807 808 { ER_FEATURE_UNKNOWN, 809 "Trying to set the unknown feature \"{0}\":{1}#setFeature({0},{2})"}, 810 811 /** Field ER_GETTING_NULL_FEATURE */ 812 813 { ER_GETTING_NULL_FEATURE, 814 "Trying to get a feature with a null name: {0}#getFeature(null)"}, 815 816 /** Field ER_GETTING_NULL_FEATURE */ 817 818 { ER_GETTING_UNKNOWN_FEATURE, 819 "Trying to get the unknown feature \"{0}\":{1}#getFeature({0})"}, 820 821 /** Field ER_NULL_XPATH_FUNCTION_RESOLVER */ 822 823 { ER_NULL_XPATH_FUNCTION_RESOLVER, 824 "Attempting to set a null XPathFunctionResolver:{0}#setXPathFunctionResolver(null)"}, 825 826 /** Field ER_NULL_XPATH_VARIABLE_RESOLVER */ 827 828 { ER_NULL_XPATH_VARIABLE_RESOLVER, 829 "Attempting to set a null XPathVariableResolver:{0}#setXPathVariableResolver(null)"}, 830 831 //END: Definitions of error keys used in exception messages of JAXP 1.3 XPath API implementation 832 833 // Warnings... 834 835 { WG_LOCALE_NAME_NOT_HANDLED, 836 "locale name in the format-number function not yet handled!"}, 837 838 { WG_PROPERTY_NOT_SUPPORTED, 839 "XSL Property not supported: {0}"}, 840 841 { WG_DONT_DO_ANYTHING_WITH_NS, 842 "Do not currently do anything with namespace {0} in property: {1}"}, 843 844 { WG_SECURITY_EXCEPTION, 845 "SecurityException when trying to access XSL system property: {0}"}, 846 847 { WG_QUO_NO_LONGER_DEFINED, 848 "Old syntax: quo(...) is no longer defined in XPath."}, 849 850 { WG_NEED_DERIVED_OBJECT_TO_IMPLEMENT_NODETEST, 851 "XPath needs a derived object to implement nodeTest!"}, 852 853 { WG_FUNCTION_TOKEN_NOT_FOUND, 854 "function token not found."}, 855 856 { WG_COULDNOT_FIND_FUNCTION, 857 "Could not find function: {0}"}, 858 859 { WG_CANNOT_MAKE_URL_FROM, 860 "Can not make URL from: {0}"}, 861 862 { WG_EXPAND_ENTITIES_NOT_SUPPORTED, 863 "-E option not supported for DTM parser"}, 864 865 { WG_ILLEGAL_VARIABLE_REFERENCE, 866 "VariableReference given for variable out of context or without definition! Name = {0}"}, 867 868 { WG_UNSUPPORTED_ENCODING, 869 "Unsupported encoding: {0}"}, 870 871 872 873 // Other miscellaneous text used inside the code... 874 { "ui_language", "en"}, 875 { "help_language", "en"}, 876 { "language", "en"}, 877 { "BAD_CODE", "Parameter to createMessage was out of bounds"}, 878 { "FORMAT_FAILED", "Exception thrown during messageFormat call"}, 879 { "version", ">>>>>>> Xalan Version "}, 880 { "version2", "<<<<<<<"}, 881 { "yes", "yes"}, 882 { "line", "Line #"}, 883 { "column", "Column #"}, 884 { "xsldone", "XSLProcessor: done"}, 885 { "xpath_option", "xpath options: "}, 886 { "optionIN", " [-in inputXMLURL]"}, 887 { "optionSelect", " [-select xpath expression]"}, 888 { "optionMatch", " [-match match pattern (for match diagnostics)]"}, 889 { "optionAnyExpr", "Or just an xpath expression will do a diagnostic dump"}, 890 { "noParsermsg1", "XSL Process was not successful."}, 891 { "noParsermsg2", "** Could not find parser **"}, 892 { "noParsermsg3", "Please check your classpath."}, 893 { "noParsermsg4", "If you don't have IBM's XML Parser for Java, you can download it from"}, 894 { "noParsermsg5", "IBM's AlphaWorks: http://www.alphaworks.ibm.com/formula/xml"}, 895 { "gtone", ">1" }, 896 { "zero", "0" }, 897 { "one", "1" }, 898 { "two" , "2" }, 899 { "three", "3" } 900 901 }; 902 } 903 904 905 // ================= INFRASTRUCTURE ====================== 906 907 /** Field BAD_CODE */ 908 public static final String BAD_CODE = "BAD_CODE"; 909 910 /** Field FORMAT_FAILED */ 911 public static final String FORMAT_FAILED = "FORMAT_FAILED"; 912 913 /** Field ERROR_RESOURCES */ 914 public static final String ERROR_RESOURCES = 915 "org.apache.xpath.res.XPATHErrorResources"; 916 917 /** Field ERROR_STRING */ 918 public static final String ERROR_STRING = "#error"; 919 920 /** Field ERROR_HEADER */ 921 public static final String ERROR_HEADER = "Error: "; 922 923 /** Field WARNING_HEADER */ 924 public static final String WARNING_HEADER = "Warning: "; 925 926 /** Field XSL_HEADER */ 927 public static final String XSL_HEADER = "XSL "; 928 929 /** Field XML_HEADER */ 930 public static final String XML_HEADER = "XML "; 931 932 /** Field QUERY_HEADER */ 933 public static final String QUERY_HEADER = "PATTERN "; 934 935 936 /** 937 * Return a named ResourceBundle for a particular locale. This method mimics the behavior 938 * of ResourceBundle.getBundle(). 939 * 940 * @param className Name of local-specific subclass. 941 * @return the ResourceBundle 942 * @throws MissingResourceException 943 */ loadResourceBundle(String className)944 public static final XPATHErrorResources loadResourceBundle(String className) 945 throws MissingResourceException 946 { 947 948 Locale locale = Locale.getDefault(); 949 String suffix = getResourceSuffix(locale); 950 951 try 952 { 953 954 // first try with the given locale 955 return (XPATHErrorResources) ResourceBundle.getBundle(className 956 + suffix, locale); 957 } 958 catch (MissingResourceException e) 959 { 960 try // try to fall back to en_US if we can't load 961 { 962 963 // Since we can't find the localized property file, 964 // fall back to en_US. 965 return (XPATHErrorResources) ResourceBundle.getBundle(className, 966 new Locale("en", "US")); 967 } 968 catch (MissingResourceException e2) 969 { 970 971 // Now we are really in trouble. 972 // very bad, definitely very bad...not going to get very far 973 throw new MissingResourceException( 974 "Could not load any resource bundles.", className, ""); 975 } 976 } 977 } 978 979 /** 980 * Return the resource file suffic for the indicated locale 981 * For most locales, this will be based the language code. However 982 * for Chinese, we do distinguish between Taiwan and PRC 983 * 984 * @param locale the locale 985 * @return an String suffix which canbe appended to a resource name 986 */ getResourceSuffix(Locale locale)987 private static final String getResourceSuffix(Locale locale) 988 { 989 990 String suffix = "_" + locale.getLanguage(); 991 String country = locale.getCountry(); 992 993 if (country.equals("TW")) 994 suffix += "_" + country; 995 996 return suffix; 997 } 998 999 } 1000