Thursday, 19 November 2009

XML, XSLT - Equivalent CASE statement in XSLT

 1: <poem author="jm" year="1667">
 2:  <verse>Seest thou yon dreary Plain, forlorn and wild,</verse>
 3:  <verse>The seat of desolation, void of light,</verse>
 4:  <verse>Save what the glimmering of these livid flames</verse>
 5:  <verse>Casts pale and dreadful?</verse>
 6: </poem>
 7:  
 8: <xsl:template match="poem">
 9:  
 10:  <xsl:choose>
 11:  <xsl:when test="@year < 1638">
 12:  The poem is one of Milton's earlier works.
 13:  </xsl:when>
 14:  
 15:  <xsl:when test="@year < 1650">
 16:  The poem is from Milton's middle period.
 17:  </xsl:when>
 18:  
 19:  <xsl:when test="@year < 1668">
 20:  The poem is one of Milton's later works.
 21:  </xsl:when>
 22:  
 23:  <xsl:when test="@year < 1675">
 24:  The poem is one of Milton's last works.
 25:  </xsl:when>
 26:  
 27:  <xsl:otherwise>
 28:  The poem was written after Milton's death.
 29:  </xsl:otherwise>
 30:  
 31:  </xsl:choose>
 32:  
 33: </xsl:template>

XML, XSLT - Beginner's Guide

Create 2 files, 1 XML the other XSLT.
Populate the XML file with your XML data.
Reference your XSLT by using the following syntax.

1: <?xml-stylesheet type="text/xsl" href="poem.xslt"?>

Host your XML file on your webserver and open the XML file in your browser to view the transformed XML.

Thursday, 5 November 2009

Windows 7: System crashed, lost administrative privileges to exfat drive

I'm running Windows 7 RTM, computer just crashed an hour ago and have noticed that I've lost write access to my D drive formatted in exFat, what gives??

Seems like the entire partition has been reset with a readonly flag.

Seen a couple of solutions on the net.

Try running a new command window in elevated mode, change to drive and run "chkdsk /f".

Or try using diskpart > select disk xx > select vol xx > att vol clear readonly

The diskpart didn't work for me, but chkdsk worked!! Sigh... haven't had to do chkdsk since windows98.