aspose file tools
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
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Reply 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: 12271
    
    1
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


Java Resources at www.wbrogden.com
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Blank line before XML declaration (xslt)
 
Similar Threads
RSS feeds invalid?
XSLT -- RSS-feeds causing date-formatting problem...
RSS feed available for the Saloon
Need to understand how RSS reader works.
RSS feed to SCJP forum