DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=3805>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=3805

XalanTransformer::transform() doesn't work on Xalan 1.2 and it did on Xalan 1.1

[EMAIL PROTECTED] changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED



------- Additional Comments From [EMAIL PROTECTED]  2001-11-21 13:42 -------
This is fixed in the latest CVS code.  See the class 
XercesDOMWrapperParsedSource in XalanTransformer.  The only limitation is that 
you will not be able to start the transformation from the first child.  I'm not 
sure why you would want to do this, but we can't really support it.  Here's a 
code snippet for how it would work:

int
ExecTransform(
    const char         *xslFileName,
    const DOM_Document &XMLDoc,
    char               *pResultHTML,
    int                SizeResultHTML )
{
   if (XMLDoc.getFirstChild().isNull() == true)
      return -99;

   int theResult = 0;

   XalanTransformer::initialize();

   {
      XercesParserLiaison  liaison;
      XercesDOMSupport     support;

      const XercesDOMWrapperParsedSource  xmlSource(XMLDoc, liaison, support);

      const XSLTInputSource  stylesheetSource( xslFileName );

      ostrstream        mi_strout( pResultHTML, SizeResultHTML );

      const XSLTResultTarget  outputTarget( &mi_strout );

      XalanTransformer theXalanTransformer;

      theResult = theXalanTransformer.transform(xmlSource, stylesheetSource, 
outputTarget );

      if ( theResult != 0 )
         {
         fprintf( stderr, "XSLT: ERROR %d during transform:\n", theResult );
         fprintf( stderr, "%s\n", theXalanTransformer.getLastError() );
         theResult = -99;
         }
   }

   XalanTransformer::terminate();
   return theResult;
}

Reply via email to