Say No to Strings

March 22nd, 2009

I'm sticking with XSL, XML and DOM, so I'm trying to free myself of strings. I had a tough time dropping disable-output-escaping, as I first tried xsl:copy-of, which resulted in an empty xmlns attribute in xhtml docs.

I finally remembered that the nodes just have to be rebuilt, either using xsl:element or the new elements entirely. Now to try and keep things flexible, I'll need to craft up some xsl:templates for common html elements. So far I've got script and link, but of course I'll need a whole bunch more than that.

Also, attribute sets!

Hah, well its actually not that difficult. All that was needed was an identity transform which avoids copy and copy-of. Thanks to Ben, its really quite simple!

Yearly Indexes: 2003 2004 2006 2007 2008 2009 2010 2011 2012 2013 2015 2019 2020 2022