001 /*
002 * Licensed to the Apache Software Foundation (ASF) under one
003 * or more contributor license agreements. See the NOTICE file
004 * distributed with this work for additional information
005 * regarding copyright ownership. The ASF licenses this file
006 * to you under the Apache License, Version 2.0 (the "License");
007 * you may not use this file except in compliance with the License.
008 * You may obtain a copy of the License at
009 *
010 * http://www.apache.org/licenses/LICENSE-2.0
011 *
012 * Unless required by applicable law or agreed to in writing, software
013 * distributed under the License is distributed on an "AS IS" BASIS,
014 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
015 * See the License for the specific language governing permissions and
016 * limitations under the License.
017 */
018 /*
019 * $Id: ProcessorTemplate.java 468640 2006-10-28 06:53:53Z minchau $
020 */
021 package org.apache.xalan.processor;
022
023 import org.apache.xalan.templates.ElemTemplate;
024 import org.apache.xalan.templates.ElemTemplateElement;
025
026 /**
027 * TransformerFactory for xsl:template markup.
028 */
029 class ProcessorTemplate extends ProcessorTemplateElem
030 {
031 static final long serialVersionUID = -8457812845473603860L;
032
033 /**
034 * Append the current template element to the current
035 * template element, and then push it onto the current template
036 * element stack.
037 *
038 * @param handler non-null reference to current StylesheetHandler that is constructing the Templates.
039 * @param elem Must be a non-null reference to a {@link org.apache.xalan.templates.ElemTemplate} object.
040 *
041 * @throws org.xml.sax.SAXException Any SAX exception, possibly
042 * wrapping another exception.
043 */
044 protected void appendAndPush(
045 StylesheetHandler handler, ElemTemplateElement elem)
046 throws org.xml.sax.SAXException
047 {
048
049 super.appendAndPush(handler, elem);
050 elem.setDOMBackPointer(handler.getOriginatingNode());
051 handler.getStylesheet().setTemplate((ElemTemplate) elem);
052 }
053 }