Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries [Thread Prev] >Thread Next - Re: Help displaying XML Help displaying XMLTo: NULL Date: 5/10/2007 4:36:00 AM
Hi,
I have an xml document which to me is not formed very well, so is now
causing me problems.
The XML document looks like this:
<club>
<Glasgow>
<venue>some venue</venue>
<address>some address</address>
<url>some url</url>
<gig>date name of band</gig>
<gig>date name of band</gig>
</Glasgow>
<London>
<venue>some venue</venue>
<address>some address</address>
<url>some url</url>
<gig>date name of band</gig>
<gig>date name of band</gig>
<gig>date name of band</gig>
<gig>date name of band</gig>
</London>
<Aberdeen>
<venue>some venue</venue>
<address>some address</address>
<url>some url</url>
<gig>date name of band</gig>
<gig>date name of band</gig>
<gig>date name of band</gig>
</Aberdeen>
</club>
as you can see the <club> node has <CITY> nodes and then a venue,
address, url and then gig nodes. there can be multiple numbers of gig
nodes and the number can be different for every city.
I am not too sure how I will be able to display this in XSL? I have
tried a few ways but the gigs always end up on the same line instead
of being separate form each other.
the code I currently have is:
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/
Transform">
<xsl:output method="html"/>
<xsl:preserve-space elements="gig"/>
<xsl:template match="/">
<xsl:for-each select="/clubnme/*">
<h3><xsl:apply-templates select="./venue" /></h3>
<h4><xsl:apply-templates select="./address" /></h4>
<p><font class="gigdate"><xsl:apply-templates select="./gig" /></font>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
hope someone can help.
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
