Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Very basic XML based problem

Status
Not open for further replies.

Zuulde

Programmer
Oct 10, 2010
5
DK
Hello there guys!

I have a very basic problem.
I want to use xsd and xsl on my xml file.
Everything is fine, except the following:
only the first elements are shown. I have more than one, but always the first one appears, and none else.

It looks like this:
<year name="2005-2006/1" >
<courses>
<course has_lecture="yes" has_practice="yes" > First </course>
<course has_lecture="yes" has_practice="yes" > Second </course>
<course has_lecture="yes" has_practice="yes" > Third </course>
<course has_lecture="yes" has_practice="yes" > Fourth </course>
<course has_lecture="yes" has_practice="yes" > Fifth </course>
</courses>
</year>

When I use those xsd, xsl files only the "first" shown.
I have an another year node, it appears fine.
 
Okay guys, I have found out. I have to use: "."
Its okay.
But I have another problem.
I want to use them in a list.
But only the first element has a spot on it

I am using this xsl code:

<xsl:template match="year" >
<h3><xsl:value-of select="@name" /></h3>
<li>
<xsl:apply-templates select="courses" >

</xsl:apply-templates>
</li>
<xsl:apply-templates select="timetable" />
</xsl:template>

<xsl:template match="courses" >
<xsl:apply-templates select="course" />
</xsl:template>

<xsl:template match="course" >
<ul><xsl:value-of select="." /></ul>
</xsl:template>
 
 http://img87.imageshack.us/img87/9671/xml.jpg
okay. made it. How can I remove these? :>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top