Tim Huffam

Dotting the I and crossing the T of I.T.

  Home  |   Contact  |   Syndication    |   Login
  152 Posts | 0 Stories | 2310 Comments | 653 Trackbacks

News

Archives

Post Categories

Interesting Blogs/Links

XML, XSL, etc

XPath statements are case sensitive. To get around this use the following example to convert all data to lower case before performing the equality check: /bookstore/book[translate(@... 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz') = '" + searchtext.ToLower() + "'] Thanks very much to Harish for this
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Serialize (convert an object instance to an XML document): // Assuming obj is an instance of an objectXmlSerializer ser = new XmlSerializer(obj.GetType()... sb = new System.Text.StringBuilder()... writer = new System.IO.StringWriter(sb);... obj);XmlDocument doc = new XmlDocument();doc.LoadXml(s... Deserialize (convert an XML document into an object instance): //Assuming doc is an XML document containing a serialized object and...
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Here's an HTML page containing javascript functions for displaying an RSS feed in nicely formatted HTML. Licence Agreement: To use this work, you, the licencee, agree to purchase, me (Tim Huffam) a pint of beer. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><HT... HTML RSS Viewer </TITLE><script> var rssDoc = new ActiveXObject("MSXML2.DOMDo... rssDoc.onreadystatechange = popData; function displayRSS(path){ mainTitle.href =...
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Thought it was about time there was a xsl template for allowing you to view RSS... so here's a basic one I've knocked up.. feel free to use (note that I've added some jigery-pokery so it caters for encoded embedded html within the rss description element). I'll follow this post with another one showing how to acheive this using javascript (ajax style). To use, just save the following xsl to a file, then add a reference to it in your rss feed with the following line: <?xml-stylesheet type="text/xsl"...
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati