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: ProcessorTemplate.java 468640 2006-10-28 06:53:53Z minchau $
20 */
21package org.apache.xalan.processor;
22
23import org.apache.xalan.templates.ElemTemplate;
24import org.apache.xalan.templates.ElemTemplateElement;
25
26/**
27 * TransformerFactory for xsl:template markup.
28 */
29class ProcessorTemplate extends ProcessorTemplateElem
30{
31    static final long serialVersionUID = -8457812845473603860L;
32
33  /**
34   * Append the current template element to the current
35   * template element, and then push it onto the current template
36   * element stack.
37   *
38   * @param handler non-null reference to current StylesheetHandler that is constructing the Templates.
39   * @param elem Must be a non-null reference to a {@link org.apache.xalan.templates.ElemTemplate} object.
40   *
41   * @throws org.xml.sax.SAXException Any SAX exception, possibly
42   *            wrapping another exception.
43   */
44  protected void appendAndPush(
45          StylesheetHandler handler, ElemTemplateElement elem)
46            throws org.xml.sax.SAXException
47  {
48
49    super.appendAndPush(handler, elem);
50    elem.setDOMBackPointer(handler.getOriginatingNode());
51    handler.getStylesheet().setTemplate((ElemTemplate) elem);
52  }
53}
54