My aim is to use my xml (version 1.0) and xsl (version 1.0) files to create html pages.
This is the code in my XML file:
<Photo>
<Text id="one">This is the first Photo</Text>
<Image id="one" src="http://cdn.theatlantic.com/static/infocus/ngpc112812/s_n01_nursingm.jpg" /> </Photo>
<Photo>
<Text id="run">This is the run picture/Text>
<Image id="run" src="http://www.krav-maga.org.uk/uploads/images/news/running.jpg" /> </Photo>
I am trying to select individual pieces of my XML document by using their ID. I would also do this with other text or paragraphs which' I will give an ID, too. At the moment I am using a for-each function to present all images at once, but I don' know how I exactly I could select individual files. I was thinking about something like this:
<xsl:value-of select="Photo/Text[one]"/>
<img>
<xsl:attribute name="src" id="one">
<xsl:value-of select="Photo/Image/@src"/>
</xsl:attribute>
</img>
and
<xsl:value-of select="Photo/Text[run]"/>
<img>
<xsl:attribute name="src" id="run">
<xsl:value-of select="Photo/Image/@src"/>
</xsl:attribute>
</img>
But it doesn't work:( I tried what I can but I am lost. Could you help me?