KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > xalan > templates > Constants


1 /*
2  * Copyright 1999-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: Constants.java,v 1.21 2004/02/16 20:32:32 minchau Exp $
18  */

19 package org.apache.xalan.templates;
20
21
22 /**
23  * Primary constants used in the TransformerImpl classes.
24  * @xsl.usage advanced
25  */

26 public class Constants extends org.apache.xml.utils.Constants
27 {
28
29   /**
30    * IDs for XSL element types. These are associated
31    * with the string literals in the TransformerImpl class.
32    * Don't change the numbers. NOTE THAT THESE ARE NOT IN
33    * ALPHABETICAL ORDER!
34    * (It's a pity Java doesn't have a real Enumerated Mnemonic
35    * datatype... or a C-like preprocessor in lieu thereof which
36    * could be used to generate and maintain synch between these lists.)
37    */

38   public static final int ELEMNAME_UNDEFINED = -1, ELEMNAME_WITHPARAM = 2,
39                           ELEMNAME_ADDATTRIBUTE = 4, ELEMNAME_ANCHOR = 22,
40
41   // ELEMNAME_ANCHOR_PATTERN = 23,
42
ELEMNAME_APPLY_TEMPLATES = 50, ELEMNAME_USE = 34, ELEMNAME_CHILDREN = 6,
43                                  ELEMNAME_CHOOSE = 37, ELEMNAME_COMMENT = 59, // my own
44
ELEMNAME_CONSTRUCT = 7, // my own
45
ELEMNAME_CONTENTS = 8, ELEMNAME_COPY = 9,
46                                  ELEMNAME_COPY_OF = 74,
47                                  ELEMNAME_DECIMALFORMAT = 83,
48                                  ELEMNAME_DEFINEATTRIBUTESET = 40,
49
50   // ELEMNAME_DEFINECONSTANT = 29,
51
// ELEMNAME_DEFINEMACRO = 10,
52
ELEMNAME_DEFINESCRIPT = 11, ELEMNAME_DISPLAYIF = 12, // my own
53
ELEMNAME_EMPTY = 14, ELEMNAME_EVAL = 15,
54                               ELEMNAME_EXPECTEDCHILDREN = 16,
55                               ELEMNAME_EXTENSION = 54,
56                               ELEMNAME_EXTENSIONHANDLER = 63,
57                               ELEMNAME_FOREACH = 28, ELEMNAME_KEY = 31,
58                               ELEMNAME_IF = 36, ELEMNAME_IMPORT = 26,
59                               ELEMNAME_INCLUDE = 27,
60                               ELEMNAME_CALLTEMPLATE = 17,
61                               ELEMNAME_PARAMVARIABLE = 41,
62                               ELEMNAME_NUMBER = 35, ELEMNAME_NSALIAS = 84,
63                               ELEMNAME_OTHERWISE = 39, ELEMNAME_PI = 58,
64                               ELEMNAME_PRESERVESPACE = 33,
65                               ELEMNAME_REMOVEATTRIBUTE = 5,
66                               ELEMNAME_TEMPLATE = 19, ELEMNAME_SORT = 64,
67                               ELEMNAME_STRIPSPACE = 32,
68                               ELEMNAME_STYLESHEET = 25, ELEMNAME_TEXT = 42,
69                               ELEMNAME_VALUEOF = 30, ELEMNAME_WHEN = 38,
70
71   // Pattern by example support
72
ELEMNAME_ROOT = 44, ELEMNAME_ANY = 45, ELEMNAME_ELEMENT = 46,
73                       ELEMNAME_TARGETELEMENT = 47, ELEMNAME_ATTRIBUTE = 48,
74                       ELEMNAME_TARGETATTRIBUTE = 49, ELEMNAME_URL = 52, // my own
75
ELEMNAME_CALL = 55, // my own
76

77   // ELEMNAME_WITHPARAM = 56,
78
ELEMNAME_FALLBACK = 57, // my own
79
ELEMNAME_TARGETPI = 60, // my own
80
ELEMNAME_TARGETCOMMENT = 61, // my own
81
ELEMNAME_TARGETTEXT = 62, // my own
82
ELEMNAME_CSSSTYLECONVERSION = 65, // my own
83
ELEMNAME_COUNTER = 66, ELEMNAME_COUNTERS = 67,
84   ELEMNAME_COUNTERINCREMENT = 68, ELEMNAME_COUNTERRESET = 69,
85   ELEMNAME_COUNTERSCOPE = 71, ELEMNAME_APPLY_IMPORTS = 72,
86   ELEMNAME_VARIABLE = 73, ELEMNAME_MESSAGE = 75, ELEMNAME_LOCALE = 76,
87   ELEMNAME_LITERALRESULT = 77, ELEMNAME_TEXTLITERALRESULT = 78,
88   ELEMNAME_EXTENSIONCALL = 79, ELEMNAME_EXTENSIONDECL = 85,
89   ELEMNAME_EXTENSIONSCRIPT = 86, ELEMNAME_OUTPUT = 80,
90   ELEMNAME_COMPONENT = 81, ELEMNAME_SCRIPT = 82;
91
92   // Next free number: 90 (88 and 89 used for EXSLT elements);
93

94   /**
95    * Literals for XSL element names. Note that there are more
96    * names than IDs, because some names map to the same ID.
97    */

98   public static final String JavaDoc
99       ELEMNAME_ANCHOR_STRING = "anchor",
100       ELEMNAME_ANY_STRING = "any", // pattern-by-example support
101
ELEMNAME_APPLY_IMPORTS_STRING = "apply-imports",
102       ELEMNAME_APPLY_TEMPLATES_STRING = "apply-templates",
103       ELEMNAME_ARG_STRING = "arg",
104       ELEMNAME_ATTRIBUTESET_STRING = "attribute-set",
105       ELEMNAME_ATTRIBUTE_STRING = "attribute", // pattern-by-example support
106
ELEMNAME_CALLTEMPLATEARG_STRING = "invoke-arg",
107       ELEMNAME_CALLTEMPLATE_STRING = "call-template",
108       ELEMNAME_CALL_STRING = "call",
109       ELEMNAME_CHILDREN_STRING = "children",
110       ELEMNAME_CHOOSE_STRING = "choose",
111       ELEMNAME_COMMENT_STRING = "comment",
112       ELEMNAME_COMPONENT_STRING = "component",
113       ELEMNAME_CONSTRUCT_STRING = "construct", // my own
114
ELEMNAME_CONTENTS_STRING = "contents",
115       ELEMNAME_COPY_OF_STRING ="copy-of",
116       ELEMNAME_COPY_STRING = "copy",
117       ELEMNAME_COUNTERINCREMENT_STRING = "counter-increment",
118       ELEMNAME_COUNTERRESET_STRING = "counter-reset",
119       ELEMNAME_COUNTERSCOPE_STRING = "counter-scope",
120       ELEMNAME_COUNTERS_STRING = "counters",
121       ELEMNAME_COUNTER_STRING = "counter",
122       ELEMNAME_CSSSTYLECONVERSION_STRING = "css-style-conversion",
123       ELEMNAME_DECIMALFORMAT_STRING = "decimal-format",
124       ELEMNAME_DISPLAYIF_STRING = "display-if", // my own
125
ELEMNAME_ELEMENT_STRING = "element", // pattern-by-example support
126
ELEMNAME_EMPTY_STRING = "empty",
127       ELEMNAME_EVAL_STRING = "eval",
128       ELEMNAME_EXPECTEDCHILDREN_STRING = "expectedchildren",
129       ELEMNAME_EXTENSIONHANDLER_STRING = "code-dispatcher",
130       ELEMNAME_EXTENSION_STRING = "functions",
131       ELEMNAME_FALLBACK_STRING = "fallback",
132       ELEMNAME_FOREACH_STRING = "for-each",
133       ELEMNAME_IF_STRING = "if",
134       ELEMNAME_IMPORT_STRING = "import",
135       ELEMNAME_INCLUDE_STRING = "include",
136       ELEMNAME_KEY_STRING = "key",
137       ELEMNAME_LOCALE_STRING = "locale",
138       ELEMNAME_MESSAGE_STRING = "message",
139       ELEMNAME_NSALIAS_STRING = "namespace-alias",
140       ELEMNAME_NUMBER_STRING = "number",
141       ELEMNAME_OTHERWISE_STRING = "otherwise",
142       ELEMNAME_OUTPUT_STRING = "output",
143       ELEMNAME_PARAMVARIABLE_STRING = "param",
144       ELEMNAME_PI_OLD_STRING = "pi",
145       ELEMNAME_PI_STRING = "processing-instruction",
146       ELEMNAME_PRESERVESPACE_STRING = "preserve-space",
147       ELEMNAME_ROOT_STRING = "root", // pattern-by-example support
148
ELEMNAME_SCRIPT_STRING = "script",
149       ELEMNAME_SORT_STRING = "sort",
150       ELEMNAME_STRIPSPACE_STRING = "strip-space",
151       ELEMNAME_STYLESHEET_STRING = "stylesheet",
152       ELEMNAME_TARGETATTRIBUTE_STRING = "target-attribute", // pattern-by-example support
153
ELEMNAME_TARGETCOMMENT_STRING = "target-comment",
154       ELEMNAME_TARGETELEMENT_STRING = "target-element", // pattern-by-example support
155
ELEMNAME_TARGETPI_STRING = "target-pi",
156       ELEMNAME_TARGETTEXT_STRING = "target-text",
157       ELEMNAME_TEMPLATE_STRING = "template",
158       ELEMNAME_TEXT_STRING = "text",
159       ELEMNAME_TRANSFORM_STRING = "transform",
160       ELEMNAME_URL_STRING = "uri", // pattern-by-example support
161
ELEMNAME_USE_STRING = "use",
162       ELEMNAME_VALUEOF_STRING = "value-of",
163       ELEMNAME_VARIABLE_STRING = "variable",
164       ELEMNAME_WHEN_STRING = "when",
165       ELEMNAME_WITHPARAM_STRING = "with-param";
166   
167   /**
168    * Literals for EXSLT function elements.
169    */

170   public static final String JavaDoc
171     EXSLT_ELEMNAME_FUNCTION_STRING = "function",
172     EXSLT_ELEMNAME_FUNCRESULT_STRING = "result";
173   public static final int
174     EXSLT_ELEMNAME_FUNCTION = 88,
175     EXSLT_ELEMNAME_FUNCRESULT = 89;
176   
177   
178   /**
179    * Literals for XSL attribute names. Note that there may be more
180    * names than IDs, because some names may map to the same ID.
181    */

182   public static final String JavaDoc
183       ATTRNAME_AMOUNT = "amount",
184       ATTRNAME_ANCESTOR = "ancestor",
185       ATTRNAME_ARCHIVE = "archive",
186       ATTRNAME_ATTRIBUTE = "attribute",
187       ATTRNAME_ATTRIBUTE_SET = "attribute-set",
188       ATTRNAME_CASEORDER = "case-order",
189       ATTRNAME_CLASS = "class",
190       ATTRNAME_CLASSID = "classid",
191       ATTRNAME_CODEBASE = "codebase",
192       ATTRNAME_CODETYPE = "type",
193       ATTRNAME_CONDITION = "condition",
194       ATTRNAME_COPYTYPE = "copy-type",
195       ATTRNAME_COUNT = "count",
196       ATTRNAME_DATATYPE = "data-type",
197       ATTRNAME_DECIMALSEPARATOR = "decimal-separator",
198       ATTRNAME_DEFAULT = "default",
199       ATTRNAME_DEFAULTSPACE = "default-space",
200       ATTRNAME_DEPTH = "with-children",
201       ATTRNAME_DIGIT = "digit",
202       ATTRNAME_DIGITGROUPSEP = "digit-group-sep",
203       ATTRNAME_DISABLE_OUTPUT_ESCAPING = "disable-output-escaping",
204       ATTRNAME_ELEMENT = "element",
205       ATTRNAME_ELEMENTS = "elements",
206       ATTRNAME_EXCLUDE_RESULT_PREFIXES ="exclude-result-prefixes",
207       ATTRNAME_EXPR = "expr",
208       ATTRNAME_EXTENSIONELEMENTPREFIXES = "extension-element-prefixes",
209       ATTRNAME_FORMAT = "format",
210       ATTRNAME_FROM = "from",
211       ATTRNAME_GROUPINGSEPARATOR = "grouping-separator",
212       ATTRNAME_GROUPINGSIZE = "grouping-size",
213       ATTRNAME_HREF = "href",
214       ATTRNAME_ID = "id",
215       ATTRNAME_IMPORTANCE = "importance",
216       ATTRNAME_INDENTRESULT = "indent-result",
217       ATTRNAME_INFINITY = "infinity",
218       ATTRNAME_LANG = "lang",
219       ATTRNAME_LETTERVALUE = "letter-value",
220       ATTRNAME_LEVEL = "level",
221       ATTRNAME_MATCH = "match",
222       ATTRNAME_METHOD = "calls",
223       ATTRNAME_MINUSSIGN = "minus-sign",
224       ATTRNAME_MODE = "mode",
225       ATTRNAME_NAME = "name",
226       ATTRNAME_NAMESPACE = "namespace",
227       ATTRNAME_NAN = "NaN",
228       ATTRNAME_NDIGITSPERGROUP = "n-digits-per-group",
229       ATTRNAME_NS = "ns",
230       ATTRNAME_ONLY = "only",
231       ATTRNAME_ORDER = "order",
232       ATTRNAME_OUTPUT_CDATA_SECTION_ELEMENTS = "cdata-section-elements",
233       ATTRNAME_OUTPUT_DOCTYPE_PUBLIC = "doctype-public",
234       ATTRNAME_OUTPUT_DOCTYPE_SYSTEM = "doctype-system",
235       ATTRNAME_OUTPUT_ENCODING = "encoding",
236       ATTRNAME_OUTPUT_INDENT = "indent",
237       ATTRNAME_OUTPUT_MEDIATYPE = "media-type",
238       ATTRNAME_OUTPUT_METHOD = "method", // qname,
239
ATTRNAME_OUTPUT_OMITXMLDECL = "omit-xml-declaration",
240       ATTRNAME_OUTPUT_STANDALONE = "standalone",
241       ATTRNAME_OUTPUT_VERSION = "version",
242       ATTRNAME_PATTERNSEPARATOR = "pattern-separator",
243       ATTRNAME_PERCENT = "percent",
244       ATTRNAME_PERMILLE = "per-mille",
245       ATTRNAME_PRIORITY = "priority",
246       ATTRNAME_REFID = "refID",
247       ATTRNAME_RESULTNS = "result-ns",
248       ATTRNAME_RESULT_PREFIX = "result-prefix",
249       ATTRNAME_SELECT = "select",
250       ATTRNAME_SEQUENCESRC = "sequence-src",
251       ATTRNAME_STYLE = "style",
252       ATTRNAME_STYLESHEET_PREFIX = "stylesheet-prefix",
253       ATTRNAME_TERMINATE = "terminate",
254       ATTRNAME_TEST = "test",
255       ATTRNAME_TOSTRING = "to-string",
256       ATTRNAME_TYPE = "type",
257       ATTRNAME_USE = "use",
258       ATTRNAME_USEATTRIBUTESETS = "use-attribute-sets",
259       ATTRNAME_VALUE = "value",
260       ATTRNAME_VERSION = "version",
261       ATTRNAME_XMLNS = "xmlns:", // namespace declaration prefix -- NOT an attribute by itself
262
ATTRNAME_XMLNSDEF = "xmlns", // default namespace
263
ATTRNAME_XMLSPACE = "xml:space",
264       ATTRNAME_ZERODIGIT = "zero-digit";
265
266   /** IDs for XSL attribute types. These are associated
267    * with the string literals in the TransformerImpl class.
268    * Don't change the numbers. NOTE THAT THESE ARE NOT IN
269    * ALPHABETICAL ORDER!
270    */

271   public static final int TATTRNAME_OUTPUT_METHOD = 1, TATTRNAME_AMOUNT = 2,
272                           TATTRNAME_ANCESTOR = 3, TATTRNAME_ARCHIVE = 4,
273                           TATTRNAME_ATTRIBUTE = 5,
274                           TATTRNAME_ATTRIBUTE_SET = 6,
275                           TATTRNAME_CASEORDER = 7, TATTRNAME_CLASS = 8,
276                           TATTRNAME_CLASSID = 9, TATTRNAME_CODEBASE = 10,
277                           TATTRNAME_CODETYPE = 11, TATTRNAME_CONDITION = 12,
278                           TATTRNAME_COPYTYPE = 13, TATTRNAME_COUNT = 14,
279                           TATTRNAME_DATATYPE = 15, TATTRNAME_DEFAULT = 16,
280                           TATTRNAME_DEFAULTSPACE = 17, TATTRNAME_DEPTH = 18,
281                           TATTRNAME_DIGITGROUPSEP = 19,
282                           TATTRNAME_DISABLE_OUTPUT_ESCAPING = 20,
283                           TATTRNAME_ELEMENT = 21, TATTRNAME_ELEMENTS = 22,
284                           TATTRNAME_EXPR = 23,
285                           TATTRNAME_EXTENSIONELEMENTPREFIXES = 24,
286                           TATTRNAME_FORMAT = 25, TATTRNAME_FROM = 26,
287                           TATTRNAME_GROUPINGSEPARATOR = 27,
288                           TATTRNAME_GROUPINGSIZE = 28, TATTRNAME_HREF = 29,
289                           TATTRNAME_ID = 30, TATTRNAME_IMPORTANCE = 31,
290                           TATTRNAME_INDENTRESULT = 32, TATTRNAME_LANG = 33,
291                           TATTRNAME_LETTERVALUE = 34, TATTRNAME_LEVEL = 35,
292                           TATTRNAME_MATCH = 36, TATTRNAME_METHOD = 37,
293                           TATTRNAME_MODE = 38, TATTRNAME_NAME = 39,
294                           TATTRNAME_NAMESPACE = 40,
295                           TATTRNAME_NDIGITSPERGROUP = 41, TATTRNAME_NS = 42,
296                           TATTRNAME_ONLY = 43, TATTRNAME_ORDER = 44,
297                           TATTRNAME_OUTPUT_CDATA_SECTION_ELEMENTS = 45,
298                           TATTRNAME_OUTPUT_DOCTYPE_PUBLIC = 46,
299                           TATTRNAME_OUTPUT_DOCTYPE_SYSTEM = 47,
300                           TATTRNAME_OUTPUT_ENCODING = 48,
301                           TATTRNAME_OUTPUT_INDENT = 49,
302                           TATTRNAME_OUTPUT_MEDIATYPE = 50,
303                           TATTRNAME_OUTPUT_STANDALONE = 51,
304                           TATTRNAME_OUTPUT_VERSION = 52,
305                           TATTRNAME_OUTPUT_OMITXMLDECL = 53,
306                           TATTRNAME_PRIORITY = 54, TATTRNAME_REFID = 55,
307                           TATTRNAME_RESULTNS = 56, TATTRNAME_SELECT = 57,
308                           TATTRNAME_SEQUENCESRC = 58, TATTRNAME_STYLE = 59,
309                           TATTRNAME_TEST = 60, TATTRNAME_TOSTRING = 61,
310                           TATTRNAME_TYPE = 62, TATTRNAME_USE = 63,
311                           TATTRNAME_USEATTRIBUTESETS = 64,
312                           TATTRNAME_VALUE = 65, TATTRNAME_XMLNSDEF = 66,
313                           TATTRNAME_XMLNS = 67, TATTRNAME_XMLSPACE = 68,
314                           TATTRNAME_EXCLUDE_RESULT_PREFIXES = 69;
315
316   /** Mnemonics for the possible values of the xsl:output element's
317    * method= attribute:
318    * <ul>
319    * <li>ATTRVAL_OUTPUT_METHOD_XML = Use an XML formatter to
320    * produce the output document (basic XSLT operation).</li>
321    * <li>ATTRVAL_OUTPUT_METHOD_HTML: Use an HTML formatter to
322    * produce the output document. When generating HTML documents,
323    * this may yield better results; it does things like escaping
324    * characters in href attributes.</li>
325    * </li>ATTRVAL_OUTPUT_METHOD_TEXT: Use a Text formatter to
326    * produce the output document. Generally the right choice if your
327    * stylesheet wants to take over _all_ the details of formatting,
328    * most often when producing something that isn't an XML or HTML
329    * document.</li>
330    * </ul>
331    * */

332   public static final String JavaDoc ATTRVAL_OUTPUT_METHOD_HTML = "html",
333                              ATTRVAL_OUTPUT_METHOD_XML = "xml",
334                              ATTRVAL_OUTPUT_METHOD_TEXT = "text";
335
336   
337   /* For space-att*/
338   public static final int ATTRVAL_PRESERVE = 1, ATTRVAL_STRIP = 2;
339
340   
341   /** For indent-result */
342   public static final boolean ATTRVAL_YES = true, ATTRVAL_NO = false;
343
344   
345   /** For letter-value attribute (part of conversion attributes). */
346   public static final String JavaDoc ATTRVAL_ALPHABETIC = "alphabetic",
347                              ATTRVAL_OTHER = "other",
348                              ATTRVAL_TRADITIONAL = "traditional";
349
350   
351   /** For level attribute in xsl:number. */
352   public static final String JavaDoc ATTRVAL_SINGLE = "single",
353                              ATTRVAL_MULTI = "multiple", ATTRVAL_ANY = "any";
354
355   
356   /** For Stylesheet-prefix and result-prefix in xsl:namespace-alias */
357   public static final String JavaDoc ATTRVAL_DEFAULT_PREFIX = "#default";
358
359  /** Integer equivalents for above */
360   public static final int NUMBERLETTER_ALPHABETIC = 1, NUMBERLETTER_TRADITIONAL = 2;
361   
362   /** Integer equivelents for above */
363   public static final int NUMBERLEVEL_SINGLE = 1, NUMBERLEVEL_MULTI = 2,
364                           NUMBERLEVEL_ANY = 3, MAX_MULTI_COUNTING_DEPTH = 32;
365
366   
367   /** some stuff for my patterns-by-example */
368   public static final String JavaDoc ATTRVAL_THIS = ".", ATTRVAL_PARENT = "..",
369                              ATTRVAL_ANCESTOR = "ancestor", ATTRVAL_ID = "id";
370
371   
372   /** Stuff for sorting */
373   public static final String JavaDoc ATTRVAL_DATATYPE_TEXT = "text",
374                              ATTRVAL_DATATYPE_NUMBER = "number",
375                              ATTRVAL_ORDER_ASCENDING = "ascending",
376                              ATTRVAL_ORDER_DESCENDING = "descending",
377                              ATTRVAL_CASEORDER_UPPER = "upper-first",
378                              ATTRVAL_CASEORDER_LOWER = "lower-first";
379
380  /** Integer equivelents for DATATYPE attribute */
381   public static final int SORTDATATYPE_TEXT = 1, SORTDATATYPE_NUMBER = 2;
382
383   /** Integer equivelents for ORDER attribute */
384   public static final int SORTORDER_ASCENDING = 1, SORTORDER_DESCENDING = 2;
385   
386   /** Integer equivelents for CASE-ORDER attribute */
387   public static final int SORTCASEORDER_UPPERFIRST = 1, SORTCASEORDER_LOWERFIRST = 2;
388   
389   /** some stuff for Decimal-format */
390   public static final String JavaDoc ATTRVAL_INFINITY = "Infinity",
391                              ATTRVAL_NAN = "NaN",
392                              DEFAULT_DECIMAL_FORMAT = "#default";
393
394   
395   /** temp dummy */
396   public static final String JavaDoc ATTRNAME_XXXX = "XXXX";
397 }
398
Popular Tags