Hi,
I'm having trouble displaying a select bit of data from my xml in html.
the xml is a load of galleries, each containing paintings:
<galleries>
<gallery name="greydisplay">
<painting>
<photo>/paintings/kitchen.jpg</photo>
<title>Table Under Window</title>
<year>2002</year>
<media>Acrylic on canvas board</media>
<dimensions>10" x 14"</dimensions>
<price>£90</price>
</painting>
...
</gallery>
...
</galleries>
The xslt is intended to just display the images from one of the galleries:
------------------------------------------------------
<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl=" version="1.0">
<xsl:template match="//gallery[@name='greydisplay']">
<xsl:for-each select="painting">
<div class="painting" >
<a href="#"><img src="{photo}" /></a>
</div>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
-------------------------------------------------------
The results works well, except that straight after the images I get a load more of the xml, in raw form:
../paintings/kitchen.jpgRed Room2003Acrylic on canvas board12" x 16"£140../paintings/kitchen.jpgKitchen Scene2004Acrylic on canvas board16" x 12"£140../paintings/kitchen.jpgPlant on Chair2003Acrylic on canvas board12" x 16"£140../paintings/kitchen.jpgRed Interior2002Acrylic on canvas board14" x 10"£90../paintings/kitchen.jpgBlue Interior2002Acrylic on paper9" x 11"£40../paintings/kitchen.jpgRooftops in Prague2001Oil on canvas board14" x 18"sold../paintings/kitchen.jpgGreen Courtyard2000Oil on canvas board14" x 18"sold../paintings/kitchen.jpgGreen House2002Acrylic on stretched canvas18" x 14"£100../paintings/kitchen.jpgPalazzo2005Oil on stretched canvas18" x 14"£160
Not sure why this is displaying. Any ideas?
I'm having trouble displaying a select bit of data from my xml in html.
the xml is a load of galleries, each containing paintings:
<galleries>
<gallery name="greydisplay">
<painting>
<photo>/paintings/kitchen.jpg</photo>
<title>Table Under Window</title>
<year>2002</year>
<media>Acrylic on canvas board</media>
<dimensions>10" x 14"</dimensions>
<price>£90</price>
</painting>
...
</gallery>
...
</galleries>
The xslt is intended to just display the images from one of the galleries:
------------------------------------------------------
<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl=" version="1.0">
<xsl:template match="//gallery[@name='greydisplay']">
<xsl:for-each select="painting">
<div class="painting" >
<a href="#"><img src="{photo}" /></a>
</div>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
-------------------------------------------------------
The results works well, except that straight after the images I get a load more of the xml, in raw form:
../paintings/kitchen.jpgRed Room2003Acrylic on canvas board12" x 16"£140../paintings/kitchen.jpgKitchen Scene2004Acrylic on canvas board16" x 12"£140../paintings/kitchen.jpgPlant on Chair2003Acrylic on canvas board12" x 16"£140../paintings/kitchen.jpgRed Interior2002Acrylic on canvas board14" x 10"£90../paintings/kitchen.jpgBlue Interior2002Acrylic on paper9" x 11"£40../paintings/kitchen.jpgRooftops in Prague2001Oil on canvas board14" x 18"sold../paintings/kitchen.jpgGreen Courtyard2000Oil on canvas board14" x 18"sold../paintings/kitchen.jpgGreen House2002Acrylic on stretched canvas18" x 14"£100../paintings/kitchen.jpgPalazzo2005Oil on stretched canvas18" x 14"£160
Not sure why this is displaying. Any ideas?