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
10 * http://www.apache.org/licenses/LICENSE-2.0
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.
19 * $Id: WhiteSpaceInfo.java 468643 2006-10-28 06:56:03Z minchau $
21 package org.apache.xalan.templates;
23 import org.apache.xpath.XPath;
26 * This is used as a special "fake" template that can be
27 * handled by the TemplateList to do pattern matching
30 public class WhiteSpaceInfo extends ElemTemplate
32 static final long serialVersionUID = 6389208261999943836L;
34 /** Flag indicating whether whitespaces should be stripped.
36 private boolean m_shouldStripSpace;
39 * Return true if this element specifies that the node that
40 * matches the match pattern should be stripped, otherwise
41 * the space should be preserved.
43 * @return value of m_shouldStripSpace flag
45 public boolean getShouldStripSpace()
47 return m_shouldStripSpace;
51 * Constructor WhiteSpaceInfo
52 * @param thisSheet The current stylesheet
54 public WhiteSpaceInfo(Stylesheet thisSheet)
56 setStylesheet(thisSheet);
61 * Constructor WhiteSpaceInfo
64 * @param matchPattern Match pattern
65 * @param shouldStripSpace Flag indicating whether or not
66 * to strip whitespaces
67 * @param thisSheet The current stylesheet
69 public WhiteSpaceInfo(XPath matchPattern, boolean shouldStripSpace, Stylesheet thisSheet)
72 m_shouldStripSpace = shouldStripSpace;
74 setMatch(matchPattern);
76 setStylesheet(thisSheet);
80 * This function is called to recompose() all of the WhiteSpaceInfo elements.
82 public void recompose(StylesheetRoot root)
84 root.recomposeWhiteSpaceInfo(this);