KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > xalan > processor > ProcessorGlobalParamDecl


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: ProcessorGlobalParamDecl.java,v 1.8 2004/02/11 18:15:51 minchau Exp $
18  */

19 package org.apache.xalan.processor;
20
21 import org.apache.xalan.templates.ElemParam;
22 import org.apache.xalan.templates.ElemTemplateElement;
23
24 /**
25  * This class processes parse events for an xsl:param element.
26  * @see <a HREF="http://www.w3.org/TR/xslt#dtd">XSLT DTD</a>
27  * @see <a HREF="http://www.w3.org/TR/xslt#top-level-variables">top-level-variables in XSLT Specification</a>
28  */

29 class ProcessorGlobalParamDecl extends ProcessorTemplateElem
30 {
31
32   /**
33    * Append the current template element to the current
34    * template element, and then push it onto the current template
35    * element stack.
36    *
37    * @param handler non-null reference to current StylesheetHandler that is constructing the Templates.
38    * @param elem The non-null reference to the ElemParam element.
39    *
40    * @throws org.xml.sax.SAXException Any SAX exception, possibly
41    * wrapping another exception.
42    */

43   protected void appendAndPush(
44           StylesheetHandler handler, ElemTemplateElement elem)
45             throws org.xml.sax.SAXException JavaDoc
46   {
47
48     // Just push, but don't append.
49
handler.pushElemTemplateElement(elem);
50   }
51
52   /**
53    * Receive notification of the end of an element.
54    *
55    * @param name The element type name.
56    * @param attributes The specified or defaulted attributes.
57    *
58    * @param handler non-null reference to current StylesheetHandler that is constructing the Templates.
59    * @param uri The Namespace URI, or an empty string.
60    * @param localName The local name (without prefix), or empty string if not namespace processing.
61    * @param rawName The qualified name (with prefix).
62    */

63   public void endElement(
64           StylesheetHandler handler, String JavaDoc uri, String JavaDoc localName, String JavaDoc rawName)
65             throws org.xml.sax.SAXException JavaDoc
66   {
67
68     ElemParam v = (ElemParam) handler.getElemTemplateElement();
69
70     handler.getStylesheet().appendChild(v);
71     handler.getStylesheet().setParam(v);
72     super.endElement(handler, uri, localName, rawName);
73   }
74 }
75
Popular Tags