Have been trying, on and off, to do an XML based blog for a while now and while I can get everything else working fine I keep getting stuck when it comes to rendering href's in the text.
I finally got it working today but it's clumsy I think and based on a 2001 javascript book so I'm hoping someone here can point me to a good book that has the info I need in it, or can explain it here.
Here is the XML file, as you can see the CDATA is the way I am using to render the href, with escaping turned off in the xslt.
<?xml version ="1.0" ?>
<?xml-stylesheet type="text/xsl" href="test.xsl" ?>
<testtext>
<story>
<text><![CDATA[
This is a test of URL embedding. <a href="http://www.gen-xxx.com">Testing here</a>
]]></text>
</story>
</testtext>
And here is the xslt
<?xml version ="1.0" encoding="iso-8859-1" ?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" >
<xsl:output method="html" indent="no" encoding="iso-8859-1" />
<xsl:template match="testtext">
<html>
<head>
<title></title>
</head>
<body>
<xsl:for-each select="story">
<xsl:value-of select="./text" disable-output-escaping="yes" />
</xsl:for-each>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
Any help would be appreciated, this has been driving me nuts for so long (like more than 2 years) and I can just never find the correct way of doing it with an xsl command.
Thread Closed
This thread is kinda stale and has been closed but if you'd like to continue the conversation, please create a new thread in our Forums,
or Contact Us and let us know.