It's not a secret anymore!*
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
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "Blank line before XML declaration (xslt)" Watch "Blank line before XML declaration (xslt)" New topic
Author

Blank line before XML declaration (xslt)

Rob Stan
Greenhorn

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

http://snipplr.com/view/19024/simple-xslt-rss-reader/

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.

http://validator.w3.org/feed/docs/error/WPBlankLine.html

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

Thanks
William Brogden
Author and all-around good cowpoke
Rancher

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

Bill

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Blank line before XML declaration (xslt)