Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: Help displaying XML

From: "Joe Fawcett" <joefawcett@---------.------>
To: NULL
Date: 5/11/2007 12:17:00 AM

You need to write a template that matches gig elements, and inside put some 
HTML:
<xsl:template match="gig">
  <p><xsl:value-of select="."/></p>
</xsl:template>


-- 

Joe Fawcett (MVP - XML)
http://joe.fawcett.name

"TheDude5B" <timbjames@g...> wrote in message 
news:1178796957.208072.60270@l......
> 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.
> 




transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent