Using IF statements for differentiating between several xhtml metatags
Posted: Fri Feb 24, 2012 8:10 pm
Hi,
In my source xhtml I have three metatags in the head as follows:
In my xslt, I currently have
which returns
However I would like the follwing
So I thought about using <xsl:if>, but really don't know the syntax for working it through.
I would like to implement something like:
Any suggestions or help would be excellent.
Kind Regards
Lewis
In my source xhtml I have three metatags in the head as follows:
Code: Select all
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>blah blah</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<meta name="keywords" content="keywordone, keywordtwo, keywordthree" />
<meta name="revised" content="2010-2-15T14:50:7+0"/>
...
</head>
Code: Select all
<xsl:template match="html:meta"
<dc:modified>
<xsl:value-of select="@content"/>
</dc:modified>
Code: Select all
<dc:modified>text/html; charset=UTF-8</dc:modified>
<dc:modified>keywordone, keywordtwo, keywordthree</dc:modified>
<dc:modified>2010-2-15T14:50:7+0</dc:modified>
Code: Select all
<dc:content>text/html; charset=UTF-8</dc:content>
<dc:description>keywordone, keywordtwo, keywordthree</dc:description>
<dc:modified>2010-2-15T14:50:7+0</dc:modified>
I would like to implement something like:
Code: Select all
If
@meta, content=date format
then
<dc:modified>
<xsl:value-of select=".">
<dc:modified>
else if
@meta, content=keywordone, ...
then
<dc:description>
<xsl:value-of select=".">
<dc:modified>
else
@meta, content=text/html
then
<dc:content>
<xsl:value-of select=".">
<dc:content>
Kind Regards
Lewis