aspose file tools*
The moose likes XML and Related Technologies and the fly likes XSLT Transformation in jav Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "XSLT Transformation in jav" Watch "XSLT Transformation in jav" New topic
Author

XSLT Transformation in jav

vinay kumar
Ranch Hand

Joined: Sep 23, 2006
Posts: 31
Hi,

I am transforming an xml using xsl in java. Getting 'ERROR: Content is not allowed in prolog.' Here is the code. xml and xsl are two string variables which read from corresponding xml and xsl files.


Please help.

thanks,
vinay
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12806
    
    5
Content not allowed in prolog usually means the document does not start with <?xml etc.

Now for the real question - why in the world are you doing this convoluted business of reading with a Reader, building a String, and turning the String into a byte stream and then into a StreamSource.

You can turn a BufferedReader directly into an InputSource.

Bill
[ October 15, 2006: Message edited by: William Brogden ]
vinay kumar
Ranch Hand

Joined: Sep 23, 2006
Posts: 31
Ooh.. I had some text before xml declaration.

Thanks william.. It is working now..

vinay.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: XSLT Transformation in jav