File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes XML and Related Technologies and the fly likes Blank line before XML declaration (xslt) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "Blank line before XML declaration (xslt)" Watch "Blank line before XML declaration (xslt)" New topic

Blank line before XML declaration (xslt)

Rob Stan

Joined: Jan 20, 2011
Posts: 7
I have an RSS feed reader in xslt that looks a lot like this one

The problem is the actual feed. If the prolog of the feed is a blank line
the the reader just does not work.
This seems to be a well known problem.

Is there any work around in xslt or possible with the help of some java script?

William Brogden
Author and all-around good cowpoke

Joined: Mar 22, 2000
Posts: 13037
I'm not sure where JavaScript would fit in this problem.

If this was my problem in Java I would consider two solutions:

1. for a small input stream - read the whole thing into a byte[] and create a new input stream that starts in the right place to pass to the transformer.
2. for a big input stream - write a InputStream extension class that skips to the valid start when initialized.


I agree. Here's the link:
subject: Blank line before XML declaration (xslt)
It's not a secret anymore!