XSL Help
Posted: Sat Jul 17, 2004 9:34 pm
I'm doing a lot with XSL transformations now and have run into several potentially huge problems. First, it seems to not recognize and "non-english" characters, I get a parser error when using the MSXML parser. the second is the inability to use required HTML characters in an XSL template.
I'm transforming to HTML, and the & is a reserved character so that means that I cannot include   and friends in the stylesheet (though they can be in the XML as long as they're escaped). No use of the &* characters makes it really hard to write HTML transformation templates.
Perhaps I'm going about this the wrong way all together. Hopefully someone with some experience in XML/XSL can help out here..
these are super simplified examples of what I'm doing, but you get the idea I hope.
Example of how I'm doing the XSL stylesheet :
An example of the XML that might be associated with it :
I'm transforming to HTML, and the & is a reserved character so that means that I cannot include   and friends in the stylesheet (though they can be in the XML as long as they're escaped). No use of the &* characters makes it really hard to write HTML transformation templates.
Perhaps I'm going about this the wrong way all together. Hopefully someone with some experience in XML/XSL can help out here..
these are super simplified examples of what I'm doing, but you get the idea I hope.
Example of how I'm doing the XSL stylesheet :
Code: Select all
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html"/>
<xsl:template match="Example">
<html>
<head>
<title>Invoice</title>
</head>
<body>
<xsl:value-of select="First_Value"/>
<br />
<xsl:value-of select="Second_Value"/>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
Code: Select all
<Example>
<First_Value>Test test test 1</First_Value>
<Second_Value>Test test test 2</Second_Value>
</Example>