Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: Getting context between nodes

From: "urug haiml" <taisto69@-------.--->
To: 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>




transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent