forrest-svn mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thors...@apache.org
Subject svn commit: r699253 - /forrest/trunk/whiteboard/dispatcher/java/org/apache/forrest/dispatcher/impl/XMLStructurer.java
Date Fri, 26 Sep 2008 10:00:31 GMT
Author: thorsten
Date: Fri Sep 26 03:00:30 2008
New Revision: 699253

URL: http://svn.apache.org/viewvc?rev=699253&view=rev
Log:
Preventing to create an empty root element

Modified:
    forrest/trunk/whiteboard/dispatcher/java/org/apache/forrest/dispatcher/impl/XMLStructurer.java

Modified: forrest/trunk/whiteboard/dispatcher/java/org/apache/forrest/dispatcher/impl/XMLStructurer.java
URL: http://svn.apache.org/viewvc/forrest/trunk/whiteboard/dispatcher/java/org/apache/forrest/dispatcher/impl/XMLStructurer.java?rev=699253&r1=699252&r2=699253&view=diff
==============================================================================
--- forrest/trunk/whiteboard/dispatcher/java/org/apache/forrest/dispatcher/impl/XMLStructurer.java
(original)
+++ forrest/trunk/whiteboard/dispatcher/java/org/apache/forrest/dispatcher/impl/XMLStructurer.java
Fri Sep 26 03:00:30 2008
@@ -184,14 +184,19 @@
         injectResult(writer, element);
         closingPaths(writer, split);
       } else {
-        StartElement start = getEventFactory().createStartElement("", "",
-            replaceFirst);
-        writer.add((XMLEvent) start);
+        if(replaceFirst!=null && !replaceFirst.equals("")){
+          StartElement start = getEventFactory().createStartElement("", "",
+              replaceFirst);
+          writer.add((XMLEvent) start);
+        }
 
         injectResult(writer, element);
-        EndElement end = getEventFactory().createEndElement("", "",
-            replaceFirst);
-        writer.add((XMLEvent) end);
+ if(replaceFirst!=null && !replaceFirst.equals("")){
+   EndElement end = getEventFactory().createEndElement("", "",
+       replaceFirst);
+   writer.add((XMLEvent) end);
+        }
+        
       }
 
     }



Mime
View raw message