![]() |
![]() | ![]() | ![]() | Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries >Thread Prev - XSL If Statement [Thread Next] Re: XSL If StatementTo: NULL Date: 2/14/2007 12:55:00 AM RigasMinho wrote: > Hello, > I have an XML file with the following Data: > > <headerinfo title='Name'>John</headerinfo> > <headerinfo title='Name'>Raymond</headerinfo> > I then use the following to grab the information and display it: > <td> > <xsl:value-of select="infoObjectDetail[@title =Name']"/> > <xsl:text> </xsl:text> > </td> That doesn't make sense. What's infoObjectDetail? Did you mean headerinfo? And it's not well-formed: you're missing an open-quote before Name. > Which displays John | Raymond > > How do I make it so that if "John" is in the XML - it skips it over > and doesnt print that line? Use a conditional statement. > I tried a bunch of different if statments but havent found a right way > to do this yet. If you read the documentation you'll find it much easier than guessing. <xsl:if test="headerinfo[@title='Name']!='John'"> <xsl:value-of select="headerinfo[@title='Name']"/> <xsl:text> </xsl:text> </xsl:if> Or perhaps test="not(contains(headerinfo[@title='Name'],'John'))" ///Peter -- XML FAQ: http://xml.silmaril.ie/ | ![]() | ![]() | ![]() |
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | |||||
|
