vgritsenko    2002/06/19 21:28:10

  Modified:    src/java/org/apache/cocoon/components/xscript Tag:
                        cocoon_2_0_3_branch XScriptObjectInlineXML.java
  Log:
  Must create InputSource with reader to avoid char to byte conversion and 
errors in it
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.4.2.2   +17 -1     
xml-cocoon2/src/java/org/apache/cocoon/components/xscript/XScriptObjectInlineXML.java
  
  Index: XScriptObjectInlineXML.java
  ===================================================================
  RCS file: 
/home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/xscript/XScriptObjectInlineXML.java,v
  retrieving revision 1.4.2.1
  retrieving revision 1.4.2.2
  diff -u -r1.4.2.1 -r1.4.2.2
  --- XScriptObjectInlineXML.java       14 Apr 2002 04:06:19 -0000      1.4.2.1
  +++ XScriptObjectInlineXML.java       20 Jun 2002 04:28:10 -0000      1.4.2.2
  @@ -68,6 +68,7 @@
    * An <code>XScriptObject</code> created from an inline XML fragment.
    *
    * @author <a href="mailto:[EMAIL PROTECTED]">Ovidiu Predescu</a>
  + * @author <a href="mailto:[EMAIL PROTECTED]">Vadim Gritsenko</a>
    * @version CVS $Id$
    * @since July 7, 2001
    */
  @@ -102,9 +103,19 @@
     public InputStream getInputStream()
       throws ProcessingException, IOException
     {
  +    // FIXME(VG): This method should never be used because it
  +    // incorrectly converts characters into bytes.
       return new StringBufferInputStream(stringBuffer.toString());
     }
   
  +  public InputSource getInputSource()
  +    throws ProcessingException, IOException
  +  {
  +    InputSource is = new InputSource(new 
StringReader(stringBuffer.toString()));
  +    is.setSystemId(getSystemId());
  +    return is;
  +  }
  +
     public ContentHandler getContentHandler()
     {
       return streamHandler;
  @@ -123,6 +134,11 @@
     public long getContentLength()
     {
       return stringBuffer.length();
  +  }
  +
  +  public String getContent()
  +  {
  +    return stringBuffer.toString();
     }
   
     public String getSystemId()
  
  
  

----------------------------------------------------------------------
In case of troubles, e-mail:     [EMAIL PROTECTED]
To unsubscribe, e-mail:          [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to