Wednesday, March 10, 2010

Chome and XSLT

I've built a web portal for my own use that integrates search engines, categorized favorite links and custom styled RSS feeds into a single page. It's a hodgepodge of ASP, VBScript and JavaScript with an XML as the backend and jQuery/UI to liven things up.

Initially working with FireFox as my default browser, everything was working fine until I decided to install Chrome. That when I got the error message: Extra content at end of document.


This gave me quite a headache until I traced it to the XSL processing in my JavaScript. I didn't quite understand what was causing the problem until I realized that Chrome didn't like what I was doing inside my {xsl:template}.

It turns out Chrome expects a only single child node (or document if you like) inside an xsl template and was complaining about anything coming after it. So you can't have this: (sorry about the curly braces, it seems blogger doesn't play nicely with code tags)

{xsl:template match="/rdf:RDF|/rss"}
{img src="...."}{/img}
{div}
...
{/div}
{xsl:template}

To fix this problem, all I did was wrap everything in another div.

{xsl:template match="/rdf:RDF|/rss"}
{div}
{img src="...."}
{div}
...
{/div}
{/div}
{xsl:template}

... et voila ...




11 comments:

Anonymous said...

Unquestionably believe that which you said. Your favorite justification seemed to be on
the net the easiest thing to be aware of. I say to you,
I certainly get irked while people think about worries that they plainly do not know about.
You managed to hit the nail upon the top and also defined out the whole thing without
having side-effects , people could take a signal.
Will likely be back to get more. Thanks

Also visit my web page ... the photo

Anonymous said...

Hey there! This is my first visit to your blog! We are a team
of volunteers and starting a new initiative in a community in the same niche.
Your blog provided us beneficial information to work on.
You have done a marvellous job!

My web page - a directory containing nubile actresses for the photography industry

Anonymous said...

Fabulous, what a weblog it is! This website presents
useful facts to us, keep it up.

Also visit my blog post: visit website
My site :: porn tube

Anonymous said...

Great blog here! Also your web site rather a lot up fast!
What web host are you the use of? Can I am getting your affiliate hyperlink for your host?
I want my site loaded up as quickly as yours lol

my web blog ... the porn photo

Anonymous said...

I got this web site from my friend who told
me on the topic of this web site and now this time I am browsing this web page
and reading very informative articles or reviews at this time.


my web site; mouse click the up coming webpage - www.iopescocosi.com

Anonymous said...

Thanks for sharing your thoughts about honey 2 imdb.

Regards

Also visit my website :: http://nudebabepic.com/index.php?own=2493503

Anonymous said...

Hello there, just became alert to your blog through Google,
and found that it is truly informative. I'm going to watch out for brussels. I will appreciate if you continue this in future. A lot of people will be benefited from your writing. Cheers!

my weblog; visit website

Anonymous said...

Greetings from Carolina! I'm bored to tears at work so I decided to browse your website on my iphone during lunch break. I really like the knowledge you provide here and can't wait to
take a look when I get home. I'm surprised at how fast your blog loaded on my mobile .. I'm
not even using WIFI, just 3G .. Anyhow, very good
blog!

Take a look at my web site http://pornharvest.com/index.php?m=2084225

Anonymous said...

With havin so much content do you ever run into any issues of plagorism
or copyright infringement? My site has a lot of completely unique content I've either created myself or outsourced but it looks like a lot of it is popping it up all over the web without my permission. Do you know any techniques to help stop content from being ripped off? I'd certainly appreciate it.


Also visit my homepage ... see More

Anonymous said...

Greetings from Los angeles! I'm bored at work so I decided to check out your website on my iphone during lunch break. I really like the information you provide here and can't wait to take a look when I
get home. I'm amazed at how quick your blog loaded on my cell phone .. I'm not
even using WIFI, just 3G .. Anyhow, wonderful site!

Feel free to visit my webpage visit

Anonymous said...

Hey! I know this is somewhat off-topic but I needed to ask.
Does running a well-established blog like yours
require a massive amount work? I am completely new to writing a blog but I do
write in my diary daily. I'd like to start a blog so I will be able to share my personal experience and feelings online. Please let me know if you have any suggestions or tips for brand new aspiring blog owners. Thankyou!

Feel free to visit my web-site :: visit