xsl variables

S

sb1

Hi

I am new to xml and I am trying to use xsl to transform my xml
document to smil.

I want to create a line such as
<video src="../media/countries_video/cuba_100.ram "
id="../media/countries_video/greece_100.ram " region="x"/>

for a number of different video files, the references to which are
held within my xml files. At the minute my code:

<xsl:for-each select="$destination/Country/CountryVideo">

<xsl:variable name="countryvid"
select="$destination/Country/CountryVideo"/>
<video src="{$countryvid}" id="{$countryvid}" region="x" />
</xsl:for-each>

produces the correct number of lines but each contains the reference
to the same file, I'm guessing this is because I can't use the one
variable to reference each. I'd appreciate it if anyone could give me
some pointers on how to get around this. (Bearing in mind I'm very new
to all this!)
Thanks in advance
 
M

Martin Honnen

sb1 said:
Hi

I am new to xml and I am trying to use xsl to transform my xml
document to smil.

I want to create a line such as
<video src="../media/countries_video/cuba_100.ram "
id="../media/countries_video/greece_100.ram " region="x"/>

for a number of different video files, the references to which are
held within my xml files. At the minute my code:

<xsl:for-each select="$destination/Country/CountryVideo">

<xsl:variable name="countryvid"
select="$destination/Country/CountryVideo"/>
Try

<video src="{$countryvid}" id="{$countryvid}" region="x" />
</xsl:for-each>

produces the correct number of lines but each contains the reference
to the same file, I'm guessing this is because I can't use the one
variable to reference each. I'd appreciate it if anyone could give me
some pointers on how to get around this. (Bearing in mind I'm very new
to all this!)
Thanks in advance
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,825
Latest member
VernonQuy6

Latest Threads

Top