diff options
| author | Mark Wielaard <mark@gcc.gnu.org> | 2006-01-17 18:09:40 +0000 |
|---|---|---|
| committer | Mark Wielaard <mark@gcc.gnu.org> | 2006-01-17 18:09:40 +0000 |
| commit | 2127637945ea6b763966398130e0770fa993c860 (patch) | |
| tree | c976ca91e3ef0bda3b34b37c0195145638d8d08e /libjava/classpath/gnu/xml/transform/ValueOfNode.java | |
| parent | bcb36c3e02e3bd2843aad1b9888513dfb5d6e337 (diff) | |
Imported GNU Classpath 0.20
Imported GNU Classpath 0.20
* Makefile.am (AM_CPPFLAGS): Add classpath/include.
* java/nio/charset/spi/CharsetProvider.java: New override file.
* java/security/Security.java: Likewise.
* sources.am: Regenerated.
* Makefile.in: Likewise.
From-SVN: r109831
Diffstat (limited to 'libjava/classpath/gnu/xml/transform/ValueOfNode.java')
| -rw-r--r-- | libjava/classpath/gnu/xml/transform/ValueOfNode.java | 56 |
1 files changed, 17 insertions, 39 deletions
diff --git a/libjava/classpath/gnu/xml/transform/ValueOfNode.java b/libjava/classpath/gnu/xml/transform/ValueOfNode.java index 430598a94b3..24c229ea3b3 100644 --- a/libjava/classpath/gnu/xml/transform/ValueOfNode.java +++ b/libjava/classpath/gnu/xml/transform/ValueOfNode.java @@ -1,5 +1,5 @@ /* ValueOfNode.java -- - Copyright (C) 2004 Free Software Foundation, Inc. + Copyright (C) 2004,2006 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -69,26 +69,18 @@ final class ValueOfNode TemplateNode ret = new ValueOfNode(select.clone(stylesheet), disableOutputEscaping); if (children != null) - { - ret.children = children.clone(stylesheet); - } + ret.children = children.clone(stylesheet); if (next != null) - { - ret.next = next.clone(stylesheet); - } + ret.next = next.clone(stylesheet); return ret; } void doApply(Stylesheet stylesheet, QName mode, - Node context, int pos, int len, - Node parent, Node nextSibling) + Node context, int pos, int len, + Node parent, Node nextSibling) throws TransformerException { Object ret = select.evaluate(context, pos, len); - /*if (stylesheet.debug) - { - System.err.println("value-of: " + select + " -> " + ret); - }*/ String value; if (ret instanceof Collection) { @@ -100,47 +92,35 @@ final class ValueOfNode } value = buf.toString(); } + else if (ret == null) + value = ""; else - { - value = Expr._string(context, ret); - } + value = Expr._string(context, ret); if (stylesheet.debug) - { - System.err.println("value-of: "+context+" "+ select + " -> "+ value); - } + System.err.println("value-of: "+context+" "+ select + " -> "+ value); if (value != null && value.length() > 0) { Document doc = (parent instanceof Document) ? (Document) parent : parent.getOwnerDocument(); Text textNode = doc.createTextNode(value); if (disableOutputEscaping) - { - textNode.setUserData("disable-output-escaping", "yes", stylesheet); - } + textNode.setUserData("disable-output-escaping", "yes", stylesheet); if (nextSibling != null) - { - parent.insertBefore(textNode, nextSibling); - } + parent.insertBefore(textNode, nextSibling); else - { - parent.appendChild(textNode); - } + parent.appendChild(textNode); } // value-of doesn't process children if (next != null) - { - next.apply(stylesheet, mode, - context, pos, len, - parent, nextSibling); - } + next.apply(stylesheet, mode, + context, pos, len, + parent, nextSibling); } public boolean references(QName var) { if (select != null && select.references(var)) - { - return true; - } + return true; return super.references(var); } @@ -151,9 +131,7 @@ final class ValueOfNode buf.append("select="); buf.append(select); if (disableOutputEscaping) - { - buf.append(",disableOutputEscaping"); - } + buf.append(",disableOutputEscaping"); buf.append(']'); return buf.toString(); } |
