I am having problems turning my xml into html for display. A sample xml file is given below, followed by my pathetic xslt attempt to transform it into html. A textual representation of what I was hoping to see is last. I am using saxon to do the transformation.
<?xml version="1.0"?>
<Whatever>
<Company>Company One
<DateRange>21-27Mar2004</DateRange>
<SubOrg>Division A
<Data>163
<Description>A description of 163, Div A, Comp A</Description> </Data> <Data>201 <Description>Description of 201, Div. A, Comp A</Description> </Data> </SubOrg> <SubOrg>Division B <Data>213 <Description>More descriptive text.</Description> </Data> <Data>222 <Description>Again, more stuff.</Description> </Data> </SubOrg> </Company> </Whatever>
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <html> <head><title>Title Information</title></head> <body bgcolor="white"> <p align="center"><font size="+3">Report</font></p> <xsl:apply-templates/> </body> </html> </xsl:template> <xsl:template match="Company"> <br/> <p><font size="+2" color="green"><xsl:value-of select="."/></font></p> <xsl:apply-templates select="DateRange"/> <xsl:apply-templates select="SubOrg"/> <xsl:apply-templates select="Data"/> </xsl:template> <xsl:template match="DateRange"> <p><font color="blue"><xsl:value-of select="."/></font></p> </xsl:template> <xsl:template match="SubOrg"> <br/><font size="+1" color="red"><xsl:value-of select="."/></font> </xsl:template> <xsl:template match="Data"> <br/><font color="black"><xsl:value-of select="."/></font> </xsl:template> </xsl:stylesheet>
What I would like to see is some html that would appear somewhat like this:
Report
Company One
21-27Mar2004
Division A
163 - A description of 163, Div A, Comp A
201 - Description of 201, Div. A, Comp A
Division B
213 -
222 -
Company Two
07-14Apr2004
Division A
128 -
Division B
221 -
234 -
etc...
I am using saxon to turn the xml/xslt into html. It's probably obvious that I'm not getting the html I wanted.
Can any provide some help? Thanks in advance!
Bob.
<?xml version="1.0"?>
<Whatever>
<Company>Company One
<DateRange>21-27Mar2004</DateRange>
<SubOrg>Division A
<Data>163
<Description>A description of 163, Div A, Comp A</Description> </Data> <Data>201 <Description>Description of 201, Div. A, Comp A</Description> </Data> </SubOrg> <SubOrg>Division B <Data>213 <Description>More descriptive text.</Description> </Data> <Data>222 <Description>Again, more stuff.</Description> </Data> </SubOrg> </Company> </Whatever>
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <html> <head><title>Title Information</title></head> <body bgcolor="white"> <p align="center"><font size="+3">Report</font></p> <xsl:apply-templates/> </body> </html> </xsl:template> <xsl:template match="Company"> <br/> <p><font size="+2" color="green"><xsl:value-of select="."/></font></p> <xsl:apply-templates select="DateRange"/> <xsl:apply-templates select="SubOrg"/> <xsl:apply-templates select="Data"/> </xsl:template> <xsl:template match="DateRange"> <p><font color="blue"><xsl:value-of select="."/></font></p> </xsl:template> <xsl:template match="SubOrg"> <br/><font size="+1" color="red"><xsl:value-of select="."/></font> </xsl:template> <xsl:template match="Data"> <br/><font color="black"><xsl:value-of select="."/></font> </xsl:template> </xsl:stylesheet>
What I would like to see is some html that would appear somewhat like this:
Report
Company One
21-27Mar2004
Division A
163 - A description of 163, Div A, Comp A
201 - Description of 201, Div. A, Comp A
Division B
213 -
222 -
Company Two
07-14Apr2004
Division A
128 -
Division B
221 -
234 -
etc...
I am using saxon to turn the xml/xslt into html. It's probably obvious that I'm not getting the html I wanted.
Can any provide some help? Thanks in advance!
Bob.