html - ASP.NET if statement creating div -


i have sidebar menu creates div's within li's.

the issue i'm having if item in menu active, shouldn't create inactive div before it. ie: should have <li><div></div></li>, not <li><div></div><div></div></li>.

      <xsl:if test="number(parententityid) = 0 , entityid!=$pcatid">         <div class="inactive">           <!--<a href="{concat('c-',entityid,'-',sename,'.aspx')}" style="color:black">-->           <xsl:choose>             <xsl:when test="count(child::entity)=0">                <a href="{concat('c-',entityid,'-',sename,'.aspx')}" style="color:black">                 <xsl:value-of select="$ename"/>               </a>             </xsl:when>             <xsl:otherwise>               <xsl:choose>                 <xsl:when test="entityid=$parentcategoryid">                   <div class="active">                     <xsl:value-of select="$ename"/>                   </div>                 </xsl:when>                 <xsl:otherwise>                   <xsl:value-of select="$ename"/>                 </xsl:otherwise>               </xsl:choose>             </xsl:otherwise>           </xsl:choose>            <!--</a>-->         </div>       </xsl:if> 

that outputs:

<li>   **<div class="inactive">**     <div class="active">     active item   **</div>**   </div> </li> <li>   <div class="inactive">   inactive item   </div> </li> 

what must change in above code inactive div isn't created outside of active div, , should created inactive? i've placed lines in **'s shouldn't there.

i know has arranging test="entityid=$parentcategoryid" or if statement can't figure out.

what version?

  <xsl:if test="number(parententityid) = 0 , entityid!=$pcatid">       <xsl:choose>         <xsl:when test="count(child::entity)=0">           <a href="{concat('c-',entityid,'-',sename,'.aspx')}" style="color:black">             <xsl:value-of select="$ename"/>           </a>         </xsl:when>         <xsl:otherwise>           <xsl:choose>             <xsl:when test="entityid=$parentcategoryid">               <div class="active">                 <xsl:value-of select="$ename"/>               </div>             </xsl:when>             <xsl:otherwise>               <div class="inactive">               <xsl:value-of select="$ename"/>                </div>             </xsl:otherwise>           </xsl:choose>         </xsl:otherwise>       </xsl:choose>   </xsl:if> 

Comments

Popular posts from this blog

python - How to create a legend for 3D bar in matplotlib? -

java - Multi-Label Document Classification -

php - Dynamic url re-writing using htaccess -