B
bouton
I am trying to 'union' multiple xml files into one html table with only
a few of the many fields/elements displayed using xsl.
I have index.xml which lists the documents, all of which validate with
the same .xsd
<?xml version="1.0"?>
<index>
<title>My List</title>
<entry>1111</entry>
<entry>2222</entry>
<entry>3333</entry>
</index>
the xsl file is this
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xslutput method="html"/>
<xsl:template match="index">
<html>
<head>
<title><xsl:value-of select="title"/></title>
</head>
<table border="1">
<tr>
<th colspan="13"><xsl:value-of select="title"/></th>
</tr>
<tr valign="top">
<th>local name</th>
<th>Scheme</th>
</tr>
<xsl:apply-templates/>
</table>
</html>
</xsl:template>
<xsl:template match="entry">
<tr valign="top">
<td><xsl:apply-templates select="document(concat(.,'.xml'))"/></td>
</tr>
</xsl:template>
<xsl:template match="Information/localName">
<td><xsl:value-of select="//Information//localName"/></td>
</xsl:template>
<xsl:template match="scheme">
<td><xsl:value-of
select="//Configuration/Properties//scheme"/></td>
</xsl:template>
</xsl:stylesheet>
I get the table I expect/want - but above it I get a complete listing
of the ALL the xml unformatted.
I know its probably a misplaced apply-template - but I can't figure it
out.
Suggestions?
thanks
a few of the many fields/elements displayed using xsl.
I have index.xml which lists the documents, all of which validate with
the same .xsd
<?xml version="1.0"?>
<index>
<title>My List</title>
<entry>1111</entry>
<entry>2222</entry>
<entry>3333</entry>
</index>
the xsl file is this
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xslutput method="html"/>
<xsl:template match="index">
<html>
<head>
<title><xsl:value-of select="title"/></title>
</head>
<table border="1">
<tr>
<th colspan="13"><xsl:value-of select="title"/></th>
</tr>
<tr valign="top">
<th>local name</th>
<th>Scheme</th>
</tr>
<xsl:apply-templates/>
</table>
</html>
</xsl:template>
<xsl:template match="entry">
<tr valign="top">
<td><xsl:apply-templates select="document(concat(.,'.xml'))"/></td>
</tr>
</xsl:template>
<xsl:template match="Information/localName">
<td><xsl:value-of select="//Information//localName"/></td>
</xsl:template>
<xsl:template match="scheme">
<td><xsl:value-of
select="//Configuration/Properties//scheme"/></td>
</xsl:template>
</xsl:stylesheet>
I get the table I expect/want - but above it I get a complete listing
of the ALL the xml unformatted.
I know its probably a misplaced apply-template - but I can't figure it
out.
Suggestions?
thanks