Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

XSLT Transformation in jav

 
vinay kumar
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13061
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ooh.. I had some text before xml declaration.

Thanks william.. It is working now..

vinay.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic