netuh Posted November 2, 2006 Share Posted November 2, 2006 Hi,Someone know how break a for-each?example: <?xml version="1.0"?><xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"><xsl:output method="xml" indent="yes"/><xsl:template match="/"><foo> <xsl:for-each select="/thing"> <xsl:if test="name = 'moo' "> <moo/> </xsl:if> </xsl:for-each></foo></xsl:template></xsl:stylesheet> And when the if be true, the tag <moo/> is placed. But i want that when place the tag <moo/>, the for-each stop. Someone can help me?Thanks. Link to comment Share on other sites More sharing options...
aspnetguy Posted November 2, 2006 Share Posted November 2, 2006 does this help? http://lists.xml.org/archives/xml-dev/200403/msg00443.html Link to comment Share on other sites More sharing options...
boen_robot Posted November 2, 2006 Share Posted November 2, 2006 How about a predicate in the for-each? <xsl:for-each select="/thing[name='moo']"> <moo/> </xsl:for-each> Link to comment Share on other sites More sharing options...
netuh Posted November 4, 2006 Author Share Posted November 4, 2006 Thanks guys!!!!!!!!! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now