Sign In/My Account | View Cart  
advertisement

Article:
 The Vanishing Image: XHTML 2 Migration Issues
Subject: Use of Conditional Comments
Date: 2003-07-05 06:58:33
From: James Fuller
Response to: Use of Conditional Comments

+1 on that, and why build another processing idiom, when we have xslt;


legacy html


<html>
<body>
<img id="1" src="sample.jpg" alt="sample" width="100" height="100" />
</body>
</html>


migration stylesheet
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" version="1.0"/>


<xsl:template match="/">
<xsl:apply-templates/>
</xsl:template>


<xsl:template match="img">
<object id="{@id}"
type="image/jpeg"
data="{@src}"
width="{@width}"
height="{@height}"/>
</xsl:template>
</xsl:stylesheet>


and of course we can build in logic to manipulate as per the "if" statements.


Personally, I see xhtml a perfect partner with xslt, and would like to see increased binding between the two.


cheers, jim fuller


No Previous Message Previous Message Move up to Parent Message Up Next Message No Next Message


Sponsored By: