[uf-dev] HG and XSLT Refactoring

Brian Suda brian.suda at gmail.com
Mon Nov 13 04:19:57 PST 2006


I have spent some free-time over the last week and have completely
refactored alot of the XSLT code. I have broken it out into a new
mf-template.xsl file which is sort of the "go find me microformatted
data" code. It abstracts all the small details of which element type,
all the child class="value" stuff, and other things perticular to
extracting microformats data. So the nice things is that you can now
do:

<xsl:for-each select="[@class='fn']">
<!-- Put your out specific code here -->
<xsl:text>FN:</xsl:text>

<!-- call template to get you the value -->
<xsl:call-template name="mf:extractText">

</xsl:for-each>

That call-template will get you the value of FN no matter where it is
encoded. The other benefit is now hCal, hCal, GEO, hCite all use the
same mf-template.xsl so if there is a bug, it will be fixed
simultaneously across all the formats.

This also has lead to a much faster prototyping of new templates, it
is possible for anyone to churn out an XSLT to convert hCalendar
encoded data to formats besides iCalendar fairly easily, you just
build the "view" xslt and call the mf-template to get you the data.

I know there has been discussion of re-orgainizing the structure of HG
to accomidate for the new XSLTs and Tests for various formats. Does
anyone know the status of that? when that is up and running i can
check-in all the new code and tests.

-brian

-- 
brian suda
http://suda.co.uk


More information about the microformats-dev mailing list