summaryrefslogtreecommitdiff
path: root/gnu/xml/transform/WhenNode.java
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/xml/transform/WhenNode.java')
-rw-r--r--gnu/xml/transform/WhenNode.java31
1 files changed, 22 insertions, 9 deletions
diff --git a/gnu/xml/transform/WhenNode.java b/gnu/xml/transform/WhenNode.java
index f2204660a..231f2693b 100644
--- a/gnu/xml/transform/WhenNode.java
+++ b/gnu/xml/transform/WhenNode.java
@@ -15,8 +15,8 @@ General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
-Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-02111-1307 USA.
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
Linking this library statically or dynamically with other modules is
making a combined work based on this library. Thus, the terms and
@@ -53,19 +53,23 @@ final class WhenNode
final Expr test;
- WhenNode(TemplateNode children, TemplateNode next, Expr test)
+ WhenNode(Expr test)
{
- super(children, next);
this.test = test;
}
TemplateNode clone(Stylesheet stylesheet)
{
- return new WhenNode((children == null) ? null :
- children.clone(stylesheet),
- (next == null) ? null :
- next.clone(stylesheet),
- test.clone(stylesheet));
+ TemplateNode ret = new WhenNode(test.clone(stylesheet));
+ if (children != null)
+ {
+ ret.children = children.clone(stylesheet);
+ }
+ if (next != null)
+ {
+ ret.next = next.clone(stylesheet);
+ }
+ return ret;
}
void doApply(Stylesheet stylesheet, QName mode,
@@ -97,6 +101,15 @@ final class WhenNode
}
}
+ public boolean references(QName var)
+ {
+ if (test != null && test.references(var))
+ {
+ return true;
+ }
+ return super.references(var);
+ }
+
public String toString()
{
StringBuffer buf = new StringBuffer(getClass().getName());