Hi

Thanks for your response, here are some more details:

Platform: Solaris
Xalan Version: 1.9
Xerces Version: 1.6
Compiler: SUNWspro6.2

Tried a couple of things:

instead of using the char* inputMessage, I tried reading the data direct from file

i.e via:

            XSLTInputSource msgToTransform("test.xml");

This worked OK. I also tried writing out the contents of the char* inputMessage to a file, then using the XSLTInputSource with the new filename in it's constructor and it also worked fine.  

However, this code is going to be sensitive to performance.  I obtain the char* inputMessage from a database and would prefer not to have to write to a file before doing the transformation.  Any suggestions of a more efficient technique?

Thanks again
Chris





David Bertoni <[EMAIL PROTECTED]>

04/11/2005 23:41
Please respond to xalan-c-users

       
        To:        [email protected]
        cc:        
        Subject:        Re: Problems with XSLTInputSource



[EMAIL PROTECTED] wrote:
>
> Hi
>
> I am quite new to Xalan and XSLT and Im having a few problems trying to
> transform an XML message using a simple XSLT file.
>
> I have a char* inputMessage that contains the xml to be transformed.  I
> am using an isstrstream to populate the XSLTInputSource.  I am also
> using the compileStylesheet method, which is returning without error.  I
> get the following error when I try the transformation:
>
> Fatal Error.Occurred at unknown file , line 1 , column 2. Expected an
> element name
>
> Ive tried stripping down the input msg to just a couple of tags, but
> still get the same error msg.
>
> Any help or pointers would be much appreciated.
>

I would help to know the compiler and platform you're using.  Also,
please verify that if you create a file that contains the bytes you are
tyring to parse, you can use an ifstream to read the document.

That error message is from the parser, and it indicates the parser
thinks the bytes in the stream are not a well-formed XML document.

Dave


Reply via email to