<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.0.1" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
	<title>Comments on: OPML to HTML via JavaScript</title>
	<link>http://www.phpied.com/opml-to-html-via-javascript/</link>
	<description>Stoyan's blog about (x)html, ajax, bookmarklets, browsers, css, firebug, javascript, json, mdb2, mysql, pear, performance, php, phpbb, tools, yslow, yui, writing, music,... life and everything.</description>
	<pubDate>Sat, 17 May 2008 07:07:46 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.0.1</generator>

	<item>
		<title>by: phpied.com &#187; Blog Archive &#187; Personal news update Nov/06</title>
		<link>http://www.phpied.com/opml-to-html-via-javascript/#comment-28050</link>
		<pubDate>Thu, 02 Nov 2006 16:46:17 +0000</pubDate>
		<guid>http://www.phpied.com/opml-to-html-via-javascript/#comment-28050</guid>
					<description>[...] I think that's about it for SAP. Otherwise, as usual, I get easily excited by different things, so I've been doing this and that, here and there, on my own terms, relaxing, without any deadlines preasure. [...]</description>
		<content:encoded><![CDATA[<p>[&#8230;] I think that's about it for SAP. Otherwise, as usual, I get easily excited by different things, so I've been doing this and that, here and there, on my own terms, relaxing, without any deadlines preasure. [&#8230;]
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Stoyan</title>
		<link>http://www.phpied.com/opml-to-html-via-javascript/#comment-18467</link>
		<pubDate>Thu, 12 Oct 2006 19:04:12 +0000</pubDate>
		<guid>http://www.phpied.com/opml-to-html-via-javascript/#comment-18467</guid>
					<description>Thanks Gonzo for sharrng this! I must admit, the thought of using XSLT did cross my mind, I mean that's what it's made for - translating documents. Actually this would have been a by-the-book example of why XSLT is useful. I find it however just a bit harder to implement and in my case I needed a quick/dirty solution. My solution is maybe shorter than what the XSL sheet alone would've been.

Thanks again fo sharing the code.

BTW, have you looked at G's &lt;a href=&quot;http://goog-ajaxslt.sourceforge.net/&quot; rel=&quot;nofollow&quot;&gt;ajaxslt&lt;/a&gt; library? It should probably work in Opera too.

BBTW, are you the same Gonzo from the Math High School in Sofia? You had that cool 12-string guitar? ;) Drop me an email - ssttoo at gmail</description>
		<content:encoded><![CDATA[<p>Thanks Gonzo for sharrng this! I must admit, the thought of using XSLT did cross my mind, I mean that's what it's made for - translating documents. Actually this would have been a by-the-book example of why XSLT is useful. I find it however just a bit harder to implement and in my case I needed a quick/dirty solution. My solution is maybe shorter than what the XSL sheet alone would've been.</p>
<p>Thanks again fo sharing the code.</p>
<p>BTW, have you looked at G's <a href="http://goog-ajaxslt.sourceforge.net/" rel="nofollow">ajaxslt</a> library? It should probably work in Opera too.</p>
<p>BBTW, are you the same Gonzo from the Math High School in Sofia? You had that cool 12-string guitar? <img src='http://www.phpied.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  Drop me an email - ssttoo at gmail
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Amy Stephen</title>
		<link>http://www.phpied.com/opml-to-html-via-javascript/#comment-16546</link>
		<pubDate>Fri, 06 Oct 2006 16:39:38 +0000</pubDate>
		<guid>http://www.phpied.com/opml-to-html-via-javascript/#comment-16546</guid>
					<description>Wow! lol! OK. I gotta learn this stuff - it's way to marvelously geeky to not jump in and partake! You are very motivating!

Thanks Stoyan - you are the coolest and the sweetest, too!

Amy :)</description>
		<content:encoded><![CDATA[<p>Wow! lol! OK. I gotta learn this stuff - it's way to marvelously geeky to not jump in and partake! You are very motivating!</p>
<p>Thanks Stoyan - you are the coolest and the sweetest, too!</p>
<p>Amy <img src='http://www.phpied.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Gonzo</title>
		<link>http://www.phpied.com/opml-to-html-via-javascript/#comment-16445</link>
		<pubDate>Fri, 06 Oct 2006 07:55:45 +0000</pubDate>
		<guid>http://www.phpied.com/opml-to-html-via-javascript/#comment-16445</guid>
					<description>Hi, Stoyan, I've been reading your blog for a while, cool! 
While working on this, did you consider using XSLT? 'Cause I,ve been doing the same thing (converting XML to HTML in the browser) with XSLT and it's quite simple. The only problem is that Opera does not support it.
The code:

/**
* Transform XML document into HTML string 
*
* @param xslStylesheet DOM object, containing the XSL transformation definition
* @param xmlData DOM object, containing the XML to be transformed
*/
function applyXSL(xslStylesheet,xmlData) {
	var output;
	if (browser=='ie'){
		// IE stuff
		objSrcTree = new ActiveXObject(Microsoft.XMLDOM);
		objSrcTree.async = false;
		objSrcTree.load(xmlData);
		
		objXSLT=new ActiveXObject(Msxml2.FreeThreadedDOMDocument.5.0);
		objXSLT.async = false;
		objXSLT.load(xslStylesheet);
		
		objCache = new ActiveXObject(Msxml2.XSLTemplate.5.0);
		objCache.stylesheet = objXSLT;
		
		var objXSLTProc = objCache.createProcessor();
		objXSLTProc.input = objSrcTree;
		
		objXSLTProc.transform();
		output=objXSLTProc.output
	}
	else{
		// Mozilla
		var processor = new XSLTProcessor();
		processor.importStylesheet(xslStylesheet);
		
		var newDocument = processor.transformToDocument(xmlData);
		var serializer = new XMLSerializer();
		output = serializer.serializeToString(newDocument);
	}
	return output;
}

This function expects you have previously done some browser detection and have created DOM objects for the XML document and the stylesheet.</description>
		<content:encoded><![CDATA[<p>Hi, Stoyan, I've been reading your blog for a while, cool!<br />
While working on this, did you consider using XSLT? 'Cause I,ve been doing the same thing (converting XML to HTML in the browser) with XSLT and it's quite simple. The only problem is that Opera does not support it.<br />
The code:</p>
<p>/**<br />
* Transform XML document into HTML string<br />
*<br />
* @param xslStylesheet DOM object, containing the XSL transformation definition<br />
* @param xmlData DOM object, containing the XML to be transformed<br />
*/<br />
function applyXSL(xslStylesheet,xmlData) {<br />
	var output;<br />
	if (browser=='ie'){<br />
		// IE stuff<br />
		objSrcTree = new ActiveXObject(Microsoft.XMLDOM);<br />
		objSrcTree.async = false;<br />
		objSrcTree.load(xmlData);</p>
<p>		objXSLT=new ActiveXObject(Msxml2.FreeThreadedDOMDocument.5.0);<br />
		objXSLT.async = false;<br />
		objXSLT.load(xslStylesheet);</p>
<p>		objCache = new ActiveXObject(Msxml2.XSLTemplate.5.0);<br />
		objCache.stylesheet = objXSLT;</p>
<p>		var objXSLTProc = objCache.createProcessor();<br />
		objXSLTProc.input = objSrcTree;</p>
<p>		objXSLTProc.transform();<br />
		output=objXSLTProc.output<br />
	}<br />
	else{<br />
		// Mozilla<br />
		var processor = new XSLTProcessor();<br />
		processor.importStylesheet(xslStylesheet);</p>
<p>		var newDocument = processor.transformToDocument(xmlData);<br />
		var serializer = new XMLSerializer();<br />
		output = serializer.serializeToString(newDocument);<br />
	}<br />
	return output;<br />
}</p>
<p>This function expects you have previously done some browser detection and have created DOM objects for the XML document and the stylesheet.
</p>
]]></content:encoded>
				</item>
</channel>
</rss>
