Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > XML > XSLT
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old September 27th, 2004, 05:37 AM
Authorized User
 
Join Date: Sep 2004
Location: , , .
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default is it possible to leave for-each loop

Hi all
Me again!
Sorry for being a pain
I want to be able to leave a for-each loop

I have the follwoing xml

<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="err5.xsl"?>
<start>
   <build>
      <message>stuff blah5 stuffaft</message>
      <message>stuff blah: 1 stuffaft</message>
      <message>stuff blah2 stuffaft</message>
      <message>stuff bla h3 stuffaft</message>
      <message>stuff bl ah4 stuffaft</message>
      <message>stuff blah5 stuffaft</message>
      <message>stuff blah5 stuffaft</message>
      <message>stuff blah5 stuffaft</message>
      <message>stuff blah5stuffaft</message>
      <message>blah 12 stuffaft </message>
      <message>stuff blah5 stuffaft</message>
      <message>stuff blah1 stuffaft</message>
      <message>stuff blah4 stuffaft</message>
      <message>stuff blah1 stuffaft</message>
      <message>stuff blah1 stuffaft</message>
      <message>stuff blah1stuffaft</message>
      <message>stuff blah1stuffaft</message>
      <message>stuff blah1stuffaft</message>
      <message>stuff blah1stuffaft</message>
      <message>blah 12 stuffaft </message>
      <message>stuff blah1stuffaft</message>
   </build>
</start>
 ===========================

and xslt

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">


  <xsl:template match="/">
      <xsl:apply-templates select="start/*" />
  </xsl:template>

  <xsl:template match="message[contains(., 'blah: 1')]">
     <xsl:for-each select="following-sibling::message[following-sibling::message[contains(., 'blah 12')]]">
            <xsl:value-of select="." /><br />
     </xsl:for-each>
  </xsl:template>

  <xsl:template match="message" />
  <xsl:template match="message222" />

</xsl:stylesheet>

============================

I want to stop showing output when I get to the first blah 12. At the moment it shows the output up tot he second blah 12

Thanks
Richard



Reply With Quote
  #2 (permalink)  
Old September 27th, 2004, 09:05 AM
Authorized User
 
Join Date: Sep 2004
Location: , , .
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I foudn an answer here:

http://www.biglist.com/lists/xsl-lis.../msg01528.html

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ToolStripMenuItem Enter & Leave Event angelboy C# 2005 6 November 21st, 2008 04:57 PM
Form and Combo Box Leave Trails on Screen Coby Excel VBA 4 August 4th, 2007 01:54 AM
nested while loop doesn't loop hosefo81 PHP Databases 5 November 12th, 2003 08:46 AM



All times are GMT -4. The time now is 06:07 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.