1. /*
  2. * Copyright 2001-2004 The Apache Software Foundation.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. /*
  17. * $Id: ErrorMessages.java,v 1.10 2004/02/24 03:55:48 zongaro Exp $
  18. */
  19. package com.sun.org.apache.xalan.internal.xsltc.runtime;
  20. import java.util.ListResourceBundle;
  21. /**
  22. * @author Morten Jorgensen
  23. */
  24. public class ErrorMessages extends ListResourceBundle {
  25. /*
  26. * XSLTC run-time error messages.
  27. *
  28. * General notes to translators and definitions:
  29. *
  30. * 1) XSLTC is the name of the product. It is an acronym for XML Stylesheet:
  31. * Transformations Compiler
  32. *
  33. * 2) A stylesheet is a description of how to transform an input XML document
  34. * into a resultant output XML document (or HTML document or text)
  35. *
  36. * 3) An axis is a particular "dimension" in a tree representation of an XML
  37. * document; the nodes in the tree are divided along different axes.
  38. * Traversing the "child" axis, for instance, means that the program
  39. * would visit each child of a particular node; traversing the "descendant"
  40. * axis means that the program would visit the child nodes of a particular
  41. * node, their children, and so on until the leaf nodes of the tree are
  42. * reached.
  43. *
  44. * 4) An iterator is an object that traverses nodes in a tree along a
  45. * particular axis, one at a time.
  46. *
  47. * 5) An element is a mark-up tag in an XML document; an attribute is a
  48. * modifier on the tag. For example, in <elem attr='val' attr2='val2'>
  49. * "elem" is an element name, "attr" and "attr2" are attribute names with
  50. * the values "val" and "val2", respectively.
  51. *
  52. * 6) A namespace declaration is a special attribute that is used to associate
  53. * a prefix with a URI (the namespace). The meanings of element names and
  54. * attribute names that use that prefix are defined with respect to that
  55. * namespace.
  56. *
  57. * 7) DOM is an acronym for Document Object Model. It is a tree
  58. * representation of an XML document.
  59. *
  60. * SAX is an acronym for the Simple API for XML processing. It is an API
  61. * used inform an XML processor (in this case XSLTC) of the structure and
  62. * content of an XML document.
  63. *
  64. * Input to the stylesheet processor can come from an XML parser in the
  65. * form of a DOM tree or through the SAX API.
  66. *
  67. * 8) DTD is a document type declaration. It is a way of specifying the
  68. * grammar for an XML file, the names and types of elements, attributes,
  69. * etc.
  70. *
  71. * 9) Translet is an invented term that refers to the class file that contains
  72. * the compiled form of a stylesheet.
  73. */
  74. // These message should be read from a locale-specific resource bundle
  75. private static final Object[][] m_errorMessages = {
  76. /*
  77. * Note to translators: the substitution text in the following message
  78. * is a class name. Used for internal errors in the processor.
  79. */
  80. {BasisLibrary.RUN_TIME_INTERNAL_ERR,
  81. "Run-time internal error in ''{0}''"},
  82. /*
  83. * Note to translators: <xsl:copy> is a keyword that should not be
  84. * translated.
  85. */
  86. {BasisLibrary.RUN_TIME_COPY_ERR,
  87. "Run-time error when executing <xsl:copy>."},
  88. /*
  89. * Note to translators: The substitution text refers to data types.
  90. * The message is displayed if a value in a particular context needs to
  91. * be converted to type {1}, but that's not possible for a value of type
  92. * {0}.
  93. */
  94. {BasisLibrary.DATA_CONVERSION_ERR,
  95. "Invalid conversion from ''{0}'' to ''{1}''."},
  96. /*
  97. * Note to translators: This message is displayed if the function named
  98. * by the substitution text is not a function that is supported. XSLTC
  99. * is the acronym naming the product.
  100. */
  101. {BasisLibrary.EXTERNAL_FUNC_ERR,
  102. "External function ''{0}'' not supported by XSLTC."},
  103. /*
  104. * Note to translators: This message is displayed if two values are
  105. * compared for equality, but the data type of one of the values is
  106. * unknown.
  107. */
  108. {BasisLibrary.EQUALITY_EXPR_ERR,
  109. "Unknown argument type in equality expression."},
  110. /*
  111. * Note to translators: The substitution text for {0} will be a data
  112. * type; the substitution text for {1} will be the name of a function.
  113. * This is displayed if an argument of the particular data type is not
  114. * permitted for a call to this function.
  115. */
  116. {BasisLibrary.INVALID_ARGUMENT_ERR,
  117. "Invalid argument type ''{0}'' in call to ''{1}''"},
  118. /*
  119. * Note to translators: There is way of specifying a format for a
  120. * number using a pattern; the processor was unable to format the
  121. * particular value using the specified pattern.
  122. */
  123. {BasisLibrary.FORMAT_NUMBER_ERR,
  124. "Attempting to format number ''{0}'' using pattern ''{1}''."},
  125. /*
  126. * Note to translators: The following represents an internal error
  127. * situation in XSLTC. The processor was unable to create a copy of an
  128. * iterator. (See definition of iterator above.)
  129. */
  130. {BasisLibrary.ITERATOR_CLONE_ERR,
  131. "Cannot clone iterator ''{0}''."},
  132. /*
  133. * Note to translators: The following represents an internal error
  134. * situation in XSLTC. The processor attempted to create an iterator
  135. * for a particular axis (see definition above) that it does not
  136. * support.
  137. */
  138. {BasisLibrary.AXIS_SUPPORT_ERR,
  139. "Iterator for axis ''{0}'' not supported."},
  140. /*
  141. * Note to translators: The following represents an internal error
  142. * situation in XSLTC. The processor attempted to create an iterator
  143. * for a particular axis (see definition above) that it does not
  144. * support.
  145. */
  146. {BasisLibrary.TYPED_AXIS_SUPPORT_ERR,
  147. "Iterator for typed axis ''{0}'' not supported."},
  148. /*
  149. * Note to translators: This message is reported if the stylesheet
  150. * being processed attempted to construct an XML document with an
  151. * attribute in a place other than on an element. The substitution text
  152. * specifies the name of the attribute.
  153. */
  154. {BasisLibrary.STRAY_ATTRIBUTE_ERR,
  155. "Attribute ''{0}'' outside of element."},
  156. /*
  157. * Note to translators: As with the preceding message, a namespace
  158. * declaration has the form of an attribute and is only permitted to
  159. * appear on an element. The substitution text {0} is the namespace
  160. * prefix and {1} is the URI that was being used in the erroneous
  161. * namespace declaration.
  162. */
  163. {BasisLibrary.STRAY_NAMESPACE_ERR,
  164. "Namespace declaration ''{0}''=''{1}'' outside of element."},
  165. /*
  166. * Note to translators: The stylesheet contained a reference to a
  167. * namespace prefix that was undefined. The value of the substitution
  168. * text is the name of the prefix.
  169. */
  170. {BasisLibrary.NAMESPACE_PREFIX_ERR,
  171. "Namespace for prefix ''{0}'' has not been declared."},
  172. /*
  173. * Note to translators: The following represents an internal error.
  174. * DOMAdapter is a Java class in XSLTC.
  175. */
  176. {BasisLibrary.DOM_ADAPTER_INIT_ERR,
  177. "DOMAdapter created using wrong type of source DOM."},
  178. /*
  179. * Note to translators: The following message indicates that the XML
  180. * parser that is providing input to XSLTC cannot be used because it
  181. * does not describe to XSLTC the structure of the input XML document's
  182. * DTD.
  183. */
  184. {BasisLibrary.PARSER_DTD_SUPPORT_ERR,
  185. "The SAX parser you are using does not handle DTD declaration events."},
  186. /*
  187. * Note to translators: The following message indicates that the XML
  188. * parser that is providing input to XSLTC cannot be used because it
  189. * does not distinguish between ordinary XML attributes and namespace
  190. * declarations.
  191. */
  192. {BasisLibrary.NAMESPACES_SUPPORT_ERR,
  193. "The SAX parser you are using does not have support for XML Namespaces."},
  194. /*
  195. * Note to translators: The substitution text is the URI that was in
  196. * error.
  197. */
  198. {BasisLibrary.CANT_RESOLVE_RELATIVE_URI_ERR,
  199. "Could not resolve the URI reference ''{0}''."},
  200. /*
  201. * Note to translators: The stylesheet contained an element that was
  202. * not recognized as part of the XSL syntax. The substitution text
  203. * gives the element name.
  204. */
  205. {BasisLibrary.UNSUPPORTED_XSL_ERR,
  206. "Unsupported XSL element ''{0}''"},
  207. /*
  208. * Note to translators: The stylesheet referred to an extension to the
  209. * XSL syntax and indicated that it was defined by XSLTC, but XSLTC does
  210. * not recognize the particular extension named. The substitution text
  211. * gives the extension name.
  212. */
  213. {BasisLibrary.UNSUPPORTED_EXT_ERR,
  214. "Unrecognized XSLTC extension ''{0}''"},
  215. /*
  216. * Note to translators: This error message is produced if the translet
  217. * class was compiled using a newer version of XSLTC and deployed for
  218. * execution with an older version of XSLTC. The substitution text is
  219. * the name of the translet class.
  220. */
  221. {BasisLibrary.UNKNOWN_TRANSLET_VERSION_ERR,
  222. "The specified translet, ''{0}'', was created using a version of XSLTC more recent than the version of the XSLTC run-time that is in use. You must recompile the stylesheet or use a more recent version of XSLTC to run this translet."},
  223. /*
  224. * Note to translators: An attribute whose effective value is required
  225. * to be a "QName" had a value that was incorrect.
  226. * 'QName' is an XML syntactic term that must not be translated. The
  227. * substitution text contains the actual value of the attribute.
  228. */
  229. {BasisLibrary.INVALID_QNAME_ERR,
  230. "An attribute whose value must be a QName had the value ''{0}''"},
  231. /*
  232. * Note to translators: An attribute whose effective value is required
  233. * to be a "NCName" had a value that was incorrect.
  234. * 'NCName' is an XML syntactic term that must not be translated. The
  235. * substitution text contains the actual value of the attribute.
  236. */
  237. {BasisLibrary.INVALID_NCNAME_ERR,
  238. "An attribute whose value must be an NCName had the value ''{0}''"},
  239. };
  240. public Object[][] getContents() {
  241. return m_errorMessages;
  242. }
  243. }