wood burning stoves 2.0
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
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "XSLT Transformation in jav" Watch "XSLT Transformation in jav" New topic

XSLT Transformation in jav

vinay kumar
Ranch Hand

Joined: Sep 23, 2006
Posts: 31

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.

William Brogden
Author and all-around good cowpoke

Joined: Mar 22, 2000
Posts: 13037
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.

[ 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..

I agree. Here's the link: http://aspose.com/file-tools
subject: XSLT Transformation in jav
It's not a secret anymore!