Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries >Thread Prev - Getting context between nodes [Thread Next] Re: Getting context between nodesTo: NULL Date: 6/3/2005 10:48:00 AM
"urug haiml" <taisto69@h...> wrote in message
news:OP7aPeAaFHA.612@T......
> Hello
>
> I have a problem with my xsl-transforming because my xml-data is not well
> structured. Unfortunately it cant be changed. My data looks like this:
>
> <schedule>
> <day>monday</day>
> <job>dishes</job>
> <job>clean</job>
> <job>...</job>
> <day>Tuesday</day>
> <job>wipe</job>
> <job>....</job>
> <day>Wednesday</job>
> <job>...</job>
> ....
> </schedule>
>
> Is there a way to pick jobs, for example monday from between the day-tags
> monday & tuesday. Ive tried this
>
> <xsl:for-each select="schedule/day">
> <xsl:value-of select="."/>
> <xsl:if test="name(following-sibling::*[1])='job'">
> <xsl:for-each select="following::day">
> <xsl:value-of select="."/>
> </xsl:for-each>
> </xsl:for-each>
>
> But this goes over the next day tag and for monday it picks the jobs for
the
> whole week.
>
> Iva looked up Generate-id(), but i couldnt really put my finger on how to
> use it on this case. Could somebody please help me?
>
>
Sorry about the wrong code, heres the right one
xsl:for-each select="schedule/day">
<xsl:value-of select="."/>
<xsl:if test="name(following-sibling::*[1])='job'">
<xsl:for-each select="following::job">
<xsl:value-of select="."/>
</xsl:for-each>
</xsl:for-each>
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
