You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Bill Keese <bi...@tech.beacon-it.co.jp> on 2003/05/22 07:34:52 UTC

[jelly] threads & xmlOutput

By default, the <thread> tag creates it's own XMLOutput object, writing to
System.out, rather than using the caller's XMLOutput object.  (The XMLOutput
argument to doTag() is ignored.)  I think the default should be to use the
caller's XMLOutput object.

For example, the following program has two XMLOutput objects, both writing
to System.out, but due to buffering inside the XMLOutput class, the output
gets garbled:

Code:
  <hello>
      <threads:thread var="myThread">
           <world/>
      </threads:thread>
       <threads:join thread="${myThread}"/>
   </hello>

Output:
   <world><world/><hello></hello>

Output I want:
  <hello>
      <world></world>
  </hello>

Of course, anytime you have multiple objects writing to the same xmlOutput
stream, you need to be careful, and do synchronization, in order to make
sure that you produce a valid XML document.

Comments?

Also, is there any way to get access to the current xmlOutput stream?  Then
I could workaround by doing something like
     <threads:thread var="myThread" xmlOutput="${getCurrentXMLOutput()}">

But I can't find a function like that.

Bill


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org