7. XSLT hammer

| No Comments | No TrackBacks

There are couple of transformations done using XSLT for ba.pm.org page. Using XSLT from one XML file the RSS feed (.rdf) and events page (.tt2) is generated. From another XML file the who is who page and JavaScript for Google maps is generated. Thanks goes to potyl for having patience and time doing these!

From Makefile:

html/en/news.rdf: etc/events.xml tt/dtd/events-1.0.dtd xslt/events-to-rdf.xslt
	xmllint --valid --noout $<
	xsltproc --stringparam lang en --nodtdattr xslt/events-to-rdf.xslt $< > $@

tt/events.tt2-en: etc/events.xml xslt/events-to-html.xslt tt/dtd/events-1.0.dtd
	xmllint --valid --noout $<
	xsltproc --stringparam lang en --nodtdattr xslt/events-to-html.xslt $< > $@

tt/who.tt2: etc/who.xml xslt/who-to-html.xslt
	xmllint --valid --noout $<
	xsltproc --nodtdattr xslt/who-to-html.xslt $< > $@

src/js/06_mongers.js: etc/who.xml xslt/who-to-js.xslt
	xmllint --valid --noout $<
	xsltproc --nodtdattr xslt/who-to-js.xslt $< > $@

So what so good about XSLT? It is made to do XML transformations. From XML to anything as you've seen in the above examples. Here is a collection of links pointing to XSLT related pages:

XSLT stylesheet can include other stylesheets with matchers, can override the ones defined earlier and it can do some other nasty hacks. You can do pretty much anything, although it may not be the best idea. Like in Perl...

No TrackBacks

TrackBack URL: http://blog.meon.eu/admin/tb/56

Leave a comment

Updates

Subscribe to the blog updates with an email:

If you like it, share it.

Pages

About this Entry

This page contains a single entry by Jozef Kutej published on November 6, 2009 8:34 PM.

6. feed us back was the previous entry in this blog.

8. one Apache child must be enough for everyone is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.