xslt - Search for a IF-ANY solution that works with <XSL:for-each> -


i searching solution following problem:

currently have code:

<div class="box">               <div class="header">                 <h2>item</h2>               </div>    </div> <xsl:for-each select="umbraco.library:getxmlnodebyid($source)/* [name() = $documenttypealias , string(umbraconavihide) != '0']"> <xsl:if test="string(experuserid)=$currentpage/experuserid">     <xsl:value-of select="@nodename"/>                 <xsl:value-of select="subtitel"/>   <a href="{umbraco.library:niceurl(@id)}" class="readmore">  lees meer              </a>     </div>    </xsl:if> </xsl:for-each> 

this code produces result for-each time source(experuserid) equals currentpage/experuserid.

the problem when test comes negative , there no experuserid's match currentpage. want make when occures, layout won't show. need this:

<xsl:if-any test="string(experuserid)=$currentpage/experuserid">     <div class="box">                   <div class="header">                     <h2>item</h2>                   </div>        </div>     <xsl:for-each select="umbraco.library:getxmlnodebyid($source)/* [name() = $documenttypealias , string(umbraconavihide) != '0']">     <xsl:if test="string(experuserid)=$currentpage/experuserid">         <xsl:value-of select="@nodename"/>                     <xsl:value-of select="subtitel"/>       <a href="{umbraco.library:niceurl(@id)}" class="readmore">      lees meer                  </a>         </div>        </xsl:if>     </xsl:for-each>     <xsl:if-any> 

does kind of solution exist? p.s. xslt-rookie. read using if test * so:

<xsl:if test="*string(experuserid)=$currentpage/experuserid"> 

but not work, help?

you want count number of matches , if there ... ...

<xsl:if test="count( child::page[experuserid = string(experuserid)] ) > 0">  <div ... blah ... /> </xsl:if> 

not entirely sure "string(experuserid)" doing (apart converting textual number contained in child node called experuserid of current node string, already), present working in example i'm re-using ... have no context determine it's validity.


Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -