This week's book giveaway is in the Cloud/Virtualizaton forum.
We're giving away four copies of Mesos in Action and have Roger Ignazio on-line!
See this thread for details.
Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Blank line before XML declaration (xslt)

 
Rob Stan
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13061
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic