How to insert <META> Tag using XSLT on client
Dear Reader
I am using the following procedure to insert <META> tag in .html. But I cannnot see the <meta> tag in VIEW -> SOURCE. Please help me how can I XSLT on client, to insert <META>. so I can see <META> tag in VIEW -> SOURCE?
Please help me in this regard. I will be thankful to you for this kindness. Thanking you in anticipation.
------------- Problem starts here -------------
<!- example.xml -->
<?xml version="1.0" encoding="ISO-8859-1"?>
<tagMeta>
<metaKey>
<keyContent>
How to dynamically insert META Tag in an HTML document
<keyContent>
<metaKey>
<tagMeta>
<!- example.xsl -->
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<head>
<meta name="keywords" content="<xsl:value-of select="/metaKey/keycontent"/>
</head>
<body>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
<!- example.html -->
<html>
<body>
<script type="text/javascript">
// Load XML
var xml = new ActiveXObject("Microsoft.XMLDOM")
xml.async = false
xml.load("example.xml")
// Load XSL
var xsl = new ActiveXObject("Microsoft.XMLDOM")
xsl.async = false
xsl.load("example.xsl")
// Transform
document.write(xml.transformNode(xsl))
</script>
</body>
reply soon please
|