M
mikeyjudkins
New to XSL here. Im trying some basic tests transforming some XML files
to HTML using XSL. The XML is output by a content management system,
Teamsite, which outputs these files called DCRs that have DOCTYPE
definitions at the top like so:
<?xml version="1.0" encoding="UTF-8"?>
<DOCTYPE record SYSTEM "dcr4.5.dtd">
<record name="20041209" type="content">
<item name="Title">
<value>Some Title</value>
</item>
<item name="SubTitle">
<value>President Vicente Fox Honors PLAMEX for
Excellence in Total Quality Management</value>
</item>
<item name="Paragraph">....and on and on.....</item>
</record>
The problem is that the XSL processor on the server side (we use ATG
Dynamo JHTML which provides the server side parsing of the XSL) does
not like the DOCTYPE definition inside DCR. But Teamsite needs the
DOCTYPE definition to validate the XML with its tools. I tried closing
the DOCTYPE element with a backslash like so:
<DOCTYPE record SYSTEM "dcr4.5.dtd"/>
it had a different result using the above but the XSL transform didnt
get at the data in the item nodes. Instead of giving me an error it
gave me empty results. Here is the XSL document for reference:
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<html>
<head>
<title>test</title>
</head>
<body>
<xsl:template match="/record">
<xsl:for-each select='item'>
<p><xsl:value-of select="value"/></p>
</xsl:for-each>
</xsl:template>
</body>
</html>
</xsl:stylesheet>
to HTML using XSL. The XML is output by a content management system,
Teamsite, which outputs these files called DCRs that have DOCTYPE
definitions at the top like so:
<?xml version="1.0" encoding="UTF-8"?>
<DOCTYPE record SYSTEM "dcr4.5.dtd">
<record name="20041209" type="content">
<item name="Title">
<value>Some Title</value>
</item>
<item name="SubTitle">
<value>President Vicente Fox Honors PLAMEX for
Excellence in Total Quality Management</value>
</item>
<item name="Paragraph">....and on and on.....</item>
</record>
The problem is that the XSL processor on the server side (we use ATG
Dynamo JHTML which provides the server side parsing of the XSL) does
not like the DOCTYPE definition inside DCR. But Teamsite needs the
DOCTYPE definition to validate the XML with its tools. I tried closing
the DOCTYPE element with a backslash like so:
<DOCTYPE record SYSTEM "dcr4.5.dtd"/>
it had a different result using the above but the XSL transform didnt
get at the data in the item nodes. Instead of giving me an error it
gave me empty results. Here is the XSL document for reference:
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<html>
<head>
<title>test</title>
</head>
<body>
<xsl:template match="/record">
<xsl:for-each select='item'>
<p><xsl:value-of select="value"/></p>
</xsl:for-each>
</xsl:template>
</body>
</html>
</xsl:stylesheet>