cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lgaw...@apache.org
Subject svn commit: r267470 - in /cocoon/blocks/template/trunk: java/org/apache/cocoon/template/instruction/Out.java test/org/apache/cocoon/template/jxtg/jxOut-output.xml test/org/apache/cocoon/template/jxtg/jxOut.xml
Date Sat, 03 Sep 2005 15:00:00 GMT
Author: lgawron
Date: Sat Sep  3 07:59:13 2005
New Revision: 267470

URL: http://svn.apache.org/viewcvs?rev=267470&view=rev
Log:
love this jUnit thing :)

Modified:
    cocoon/blocks/template/trunk/java/org/apache/cocoon/template/instruction/Out.java
    cocoon/blocks/template/trunk/test/org/apache/cocoon/template/jxtg/jxOut-output.xml
    cocoon/blocks/template/trunk/test/org/apache/cocoon/template/jxtg/jxOut.xml

Modified: cocoon/blocks/template/trunk/java/org/apache/cocoon/template/instruction/Out.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/template/trunk/java/org/apache/cocoon/template/instruction/Out.java?rev=267470&r1=267469&r2=267470&view=diff
==============================================================================
--- cocoon/blocks/template/trunk/java/org/apache/cocoon/template/instruction/Out.java (original)
+++ cocoon/blocks/template/trunk/java/org/apache/cocoon/template/instruction/Out.java Sat
Sep  3 07:59:13 2005
@@ -77,10 +77,11 @@
         try {
             val = this.compiledExpression.getNode(expressionContext);
             
+            boolean stripRoot = BooleanUtils.toBoolean(this.stripRoot);
             //TODO: LG, I do not see a good way to do this.
             if (BooleanUtils.isTrue(this.xmlize)) {
                 if (val instanceof Node || val instanceof Node[] || val instanceof XMLizable)
-                    Invoker.executeNode(consumer, val);
+                    Invoker.executeNode(consumer, val, stripRoot);
                 else {
                     ServiceManager serviceManager = executionContext.getServiceManager();
                     SAXParser parser = null;
@@ -88,14 +89,14 @@
                         parser = (SAXParser) serviceManager.lookup(SAXParser.ROLE);
                         InputSource source = new InputSource(new ByteArrayInputStream(val.toString().getBytes()));
                         IncludeXMLConsumer includeConsumer = new IncludeXMLConsumer(consumer);
-                        includeConsumer.setIgnoreRootElement(BooleanUtils.isTrue(this.stripRoot));
+                        includeConsumer.setIgnoreRootElement(stripRoot);
                         parser.parse(source, includeConsumer);
                     } finally {
                         serviceManager.release(parser);
                     }
                 }
             } else
-                Invoker.executeNode(consumer, val);
+                Invoker.executeNode(consumer, val, stripRoot);
         } catch (Exception e) {
             throw new SAXParseException(e.getMessage(), getLocation(), e);
         }

Modified: cocoon/blocks/template/trunk/test/org/apache/cocoon/template/jxtg/jxOut-output.xml
URL: http://svn.apache.org/viewcvs/cocoon/blocks/template/trunk/test/org/apache/cocoon/template/jxtg/jxOut-output.xml?rev=267470&r1=267469&r2=267470&view=diff
==============================================================================
--- cocoon/blocks/template/trunk/test/org/apache/cocoon/template/jxtg/jxOut-output.xml (original)
+++ cocoon/blocks/template/trunk/test/org/apache/cocoon/template/jxtg/jxOut-output.xml Sat
Sep  3 07:59:13 2005
@@ -10,4 +10,8 @@
 			<p>content2</p>
 		</root>
 	</document>
+	<document-noroot>
+		<p>content</p>
+		<p>content2</p>
+	</document-noroot>
 </root>

Modified: cocoon/blocks/template/trunk/test/org/apache/cocoon/template/jxtg/jxOut.xml
URL: http://svn.apache.org/viewcvs/cocoon/blocks/template/trunk/test/org/apache/cocoon/template/jxtg/jxOut.xml?rev=267470&r1=267469&r2=267470&view=diff
==============================================================================
--- cocoon/blocks/template/trunk/test/org/apache/cocoon/template/jxtg/jxOut.xml (original)
+++ cocoon/blocks/template/trunk/test/org/apache/cocoon/template/jxtg/jxOut.xml Sat Sep  3
07:59:13 2005
@@ -5,4 +5,5 @@
 	<xmlized><jx:out value="${xml}" xmlize="true"/></xmlized>
 	<xmlized-noroot><jx:out value="${xml}" xmlize="true" strip-root="true"/></xmlized-noroot>
 	<document><jx:out value="${document}"/></document>
+	<document-noroot><jx:out value="${document}" strip-root="true"/></document-noroot>
 </root>



Mime
View raw message