Hi,
i am trying to do a simple template engine in XSLT to separate content from structure/design. I don't want do invent a whole new XML language for that, so I want to stick to XHTML.
Basically, I have an XML file like this:
Code:
<entry>
<metadata>
<dateCreated>04.06.06</dateCreated>
<title>Test Entry</title>
</metadata>
<content>
</content>
</entry>
I want the result to be like this:
Code:
<html>
<head>
<title>Test Entry</title>
</head>
<body>
<h1>Test Entry</h1>
</body>
</html>
How can I achieve this? I use the client-side XSLT transformation of Mozilla 1.5. When I experimented with the following, called from another template, Mozilla complained about the recursive loop.
Code:
<xsl:template name="all" match="*">
<xsl:element name="{local-name()}">
<xsl:copy-of select="@*"/>
<xsl:call-template name="all"/>
</xsl:element>
</xsl:template>