Hi;
I am using templates and coverting raw xml from asp / xsl to HTML my problem is
I presently have 2 tabels the first table just flows one row at a time for 1 <td>and thats fine . But. my second table has 3 <td> per row and there all bunch up in each row. is there any way to space them apart form one another equally Like...
VoterName Vote Comments
xxxxxx xxxxxx xxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxx xxxxxxxxxx xxxxxxxxxxxxxx
Is there away to do this in XSLT
Ive try the following in my XSL is three some thing wrong.
Any Help would be appreciated.
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl=" version="1.0">
<xslutput omit-xml-declaration="yes"/>
<xsl:template match="/">
<html>
<body>
<table valign="top">
<xsl:apply-templates select="ARTICLES" />
</table>
</body>
</html>
</xsl:template>
<xsl:template match="ARTICLES">
<xsl:apply-templates select="ARTICLE" />
</xsl:template>
<xsl:template match="ARTICLE">
<xsl:apply-templates select="title" />
<xsl:apply-templates select="author" />
<xsl:apply-templates select="approvedDate" />
<xsl:apply-templates select="abstract" />
<xsl:apply-templates select="article" />
<xsl:apply-templates select="voter" />
</xsl:template>
<xsl:template match="title">
<tr>
<xsl:element name="td">
<strong>Title: </strong>
<xsl:value-of select="."/>
</xsl:element>
</tr>
</xsl:template>
<xsl:template match="author">
<tr>
<xsl:element name="td">
<strong>Author: </strong>
<xsl:value-of select="."/>
</xsl:element>
</tr>
</xsl:template>
<xsl:template match="approvedDate">
<tr>
<xsl:element name="td">
<xsl:attribute name="align">right</xsl:attribute>
<strong>
Approved for release on:
<xsl:value-of select="."/>
</strong>
</xsl:element>
</tr>
</xsl:template>
<xsl:template match="abstract">
<tr>
<xsl:element name="td">
<strong>Abstract: </strong>
<xsl:value-of select="."/>
</xsl:element>
</tr>
</xsl:template>
<xsl:template match="article">
<tr>
<xsl:element name="td">
<strong>Article: </strong>
<xsl:value-of select="."/>
</xsl:element>
</tr>
<tr>
<xsl:element name="td">
<xsl:attribute name="align">center</xsl:attribute>
<strong>HSBR Votes: </strong><hr/>
</xsl:element>
</tr>
</xsl:template>
<xsl:template match="voter">
<table cols="3" >
<COL>
<tr>
<xsl:apply-templates select="./voterName" />
<xsl:apply-templates select="./voterVote" />
<xsl:apply-templates select="./voterNotes" />
</tr>
</COL>
</table>
</xsl:template>
<xsl:template match="voterName">
<xsl:element name="td">
<!-- <strong>Voter Name: </strong> -->
<xsl:attribute name="table-cell-width">4in</xsl:attribute>
<xsl:attribute name="text-align">right</xsl:attribute>
<xsl:value-of select="."/>
</xsl:element>
</xsl:template>
<xsl:template match="voterVote">
<xsl:element name="td">
<xsl:attribute name="align">right</xsl:attribute>
<strong>Voter Vote: </strong>
<xsl:attribute name="align">right</xsl:attribute>
<xsl:value-of select="."/>
</xsl:element>
</xsl:template>
<!-- This is the second table. I am try to process these three templates
so that the output
coreasponse to the coreect person need to space td or cols so
data flows like example-->
<xsl:template match="voterNotes">
<xsl:element name="td">
<xsl:attribute name="align">right</xsl:attribute>
<strong>Voter Notes: </strong>
<xsl:value-of select="."/>
</xsl:element>
</xsl:template>
</xsl:stylesheet>
I am using templates and coverting raw xml from asp / xsl to HTML my problem is
I presently have 2 tabels the first table just flows one row at a time for 1 <td>and thats fine . But. my second table has 3 <td> per row and there all bunch up in each row. is there any way to space them apart form one another equally Like...
VoterName Vote Comments
xxxxxx xxxxxx xxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxx xxxxxxxxxx xxxxxxxxxxxxxx
Is there away to do this in XSLT
Ive try the following in my XSL is three some thing wrong.
Any Help would be appreciated.
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl=" version="1.0">
<xslutput omit-xml-declaration="yes"/>
<xsl:template match="/">
<html>
<body>
<table valign="top">
<xsl:apply-templates select="ARTICLES" />
</table>
</body>
</html>
</xsl:template>
<xsl:template match="ARTICLES">
<xsl:apply-templates select="ARTICLE" />
</xsl:template>
<xsl:template match="ARTICLE">
<xsl:apply-templates select="title" />
<xsl:apply-templates select="author" />
<xsl:apply-templates select="approvedDate" />
<xsl:apply-templates select="abstract" />
<xsl:apply-templates select="article" />
<xsl:apply-templates select="voter" />
</xsl:template>
<xsl:template match="title">
<tr>
<xsl:element name="td">
<strong>Title: </strong>
<xsl:value-of select="."/>
</xsl:element>
</tr>
</xsl:template>
<xsl:template match="author">
<tr>
<xsl:element name="td">
<strong>Author: </strong>
<xsl:value-of select="."/>
</xsl:element>
</tr>
</xsl:template>
<xsl:template match="approvedDate">
<tr>
<xsl:element name="td">
<xsl:attribute name="align">right</xsl:attribute>
<strong>
Approved for release on:
<xsl:value-of select="."/>
</strong>
</xsl:element>
</tr>
</xsl:template>
<xsl:template match="abstract">
<tr>
<xsl:element name="td">
<strong>Abstract: </strong>
<xsl:value-of select="."/>
</xsl:element>
</tr>
</xsl:template>
<xsl:template match="article">
<tr>
<xsl:element name="td">
<strong>Article: </strong>
<xsl:value-of select="."/>
</xsl:element>
</tr>
<tr>
<xsl:element name="td">
<xsl:attribute name="align">center</xsl:attribute>
<strong>HSBR Votes: </strong><hr/>
</xsl:element>
</tr>
</xsl:template>
<xsl:template match="voter">
<table cols="3" >
<COL>
<tr>
<xsl:apply-templates select="./voterName" />
<xsl:apply-templates select="./voterVote" />
<xsl:apply-templates select="./voterNotes" />
</tr>
</COL>
</table>
</xsl:template>
<xsl:template match="voterName">
<xsl:element name="td">
<!-- <strong>Voter Name: </strong> -->
<xsl:attribute name="table-cell-width">4in</xsl:attribute>
<xsl:attribute name="text-align">right</xsl:attribute>
<xsl:value-of select="."/>
</xsl:element>
</xsl:template>
<xsl:template match="voterVote">
<xsl:element name="td">
<xsl:attribute name="align">right</xsl:attribute>
<strong>Voter Vote: </strong>
<xsl:attribute name="align">right</xsl:attribute>
<xsl:value-of select="."/>
</xsl:element>
</xsl:template>
<!-- This is the second table. I am try to process these three templates
so that the output
coreasponse to the coreect person need to space td or cols so
data flows like example-->
<xsl:template match="voterNotes">
<xsl:element name="td">
<xsl:attribute name="align">right</xsl:attribute>
<strong>Voter Notes: </strong>
<xsl:value-of select="."/>
</xsl:element>
</xsl:template>
</xsl:stylesheet>