• Home
  • About
  • Articles and Presentations
  • Contact Me
  • Upcoming Presentations

Library Web Chic

Resources for librarians who are interested in the application of web design and technologies in libraries

Feed on
Posts
Comments

More XML Lessons

Dec 15th, 2004 by Karen

More XML Lessons

I had a breakthrough last week involving XML. The usability of the
little orange XML button has been irritating me for some time and I
have been trying to figure out how to deal with it without redirecting
users to another page explaining RSS. The reason being that I want
people who know what RSS is, to be able to get the feed. I also don't
like the idea of cluttering the screen with extra links (if I don't
have to).

What I really want to do is add an XSL to my XML file that includes an
explanation of RSS. So if you go to rss.xml in your web browser you get
an attractive page that explains RSS and shows you the feed formatted
nicely. However, RSS adopters can still just get the feed. I'm seen
this done with Atom feeds and I like the way it looks. I've just had
issues with making it work. Particularly with my feed for this site
which is created by Radio. Today I figured out how to add what I want
with little fuss.

The
following code adds a stylesheet to an existing XML file on the fly.
The original XML file stays the same it is just that the stylesheet
gets added when you view it.
<%
set xmlDoc = Server.CreateObject(”Msxml2.DOMDocument.4.0″)
xmlDoc.load (Server.MapPath(”rss.xml”))
'add XSL file
set docXsl =
xmlDoc.createProcessingInstruction(”xml-stylesheet”, “type='text/xsl'
href='basic_display.xsl'”)
xmldoc.insertBefore docXsl, xmldocnew.documentElement
Response.ContentType = “text/xml”
response.write xmldoc.xml
%>

Linked is the stylesheet which gets attached and transforms the feed into something readable. Feel free to look at or use the code.

Overall,
this works quite well, but not consistently across browsers (of
course). This is because XML parsers vary from browser to browser. Oh
well, in my opinion this is a dramatic improvement over the original
orange button, but only time will tell.

Posted in General Thoughts | No Comments

Comments are closed.

  • Recent Posts

    • This is why open source software rules
    • WorldCat Search API Terms of Service issues
    • Drupal Content Management and Community for your Library
    • Drupal modules I wish existed
    • The Views module for Drupal is AWESOME
    • Creating Database lists with Wordpress Link tool
  • Categories

    • AJAX (1)
    • BLeading Edge Thoughts (4)
    • Blogging (23)
    • Chat (3)
    • Coldfusion (2)
    • CSS (14)
    • Digital Libraries (3)
    • Findability (2)
    • General Thoughts (425)
    • Library Systems (16)
    • Linux (3)
    • LITA Top Tech Trends (1)
    • Mac (5)
    • Nifty Tools (6)
    • Notes from the Field (105)
    • Ongoing Projects (7)
    • open source software (6)
    • OpenURL (8)
    • Podcasting (1)
    • Presentations (1)
    • RSS (32)
    • Social Software (5)
    • Tech Configuration Tidbits (1)
    • Tech Demons (11)
    • Usability (11)
    • Web 2.0 (5)
    • Web Services (3)
    • Web Standards (1)
    • Wikis (7)
    • XHTML (3)
    • XML (19)
  • Archives

    • 2008
      • October
      • September
      • August
      • July
      • June
      • May
      • April
      • March
      • February
      • January
    • + 2007
      • December
      • November
      • October
      • September
      • August
      • July
      • June
      • May
      • April
      • March
      • February
      • January
    • + 2006
      • December
      • November
      • October
      • September
      • August
      • July
      • June
      • May
      • April
      • March
      • February
      • January
    • + 2005
      • December
      • November
      • October
      • September
      • August
      • July
      • June
      • May
      • April
      • March
      • February
      • January
    • + 2004
      • December
      • November
      • October
      • September
      • August
      • July
      • June
      • May
      • April
      • March
  • Pages

    • About
      • CV
    • Articles and Presentations
      • AJAX Presentation
      • Incorporating Web 2.0 into Library Websites
      • Library 2.0 and Web 2.0, Changing the Face of Professional Development
      • Mashing Up and Remixing the Library Website
      • Next Stop Blogging
      • Observing and Analysing Library Website User Behavior (CIL 2006 Postconference)
      • Open Source Software for Library Websites Presentation
      • Social Software for Reference Services Presentation
      • Ten News Items of Note for Libraries
      • TLA 2006 Presentation
      • Upcoming Presentations
      • Using Blogs for Internal Communications
      • Web 2.0, Library 2.0 and the Future of Libraries
      • WorldCat Wordpress Widget
    • Contact Me
    • Stories - Tutorials and Code Demonstrations
      • Feedburner
      • Incorporating XML Content Into Your Web site (ASP)
      • Making your blog friendly to mobile devices
      • Print Style sheets
      • Server-side and Client-side includes, explanations, applications, and examples
      • Web Server Log Analysis Tools and Tips
      • Wordpress and Tags
    • Tag Cloud
  • Meta

    • Log in
    • Valid XHTML
    • Powered by Wordpress
    • Get Firefox!
    • I See Blog People
    • AIM Status
  • Creative Commons License

    MistyLook made free by Web Hosting Bluebook