Domanda

I am trying to write an if condition inside my data attribute... right now I am receiving the xsml vaue but dont know how to put if there... when i use if outside html it works fine.. providing my code below...

http://xsltransform.net/bFukv8i/16

<xsl:if test="//Devices//SideMenu//NavTitleCheckBox='SideMenu'">     
        Data_Nav_Title="<xsl:value-of select='//Devices//SideMenu//NavTitle'/>"
    </xsl:if>



    <article class="banner-hero banner-hero--blocks" data-nav-title="{//Devices//SideMenu//NavTitle}"></article>
        <script>

Nessuna soluzione corretta

Altri suggerimenti

using XSL 2.0, you can do this

<article class="banner-hero banner-hero--blocks" data-nav-title="{if (//Devices//SideMenu//NavTitleCheckBox='SideMenu') then //Devices//SideMenu//NavTitle else ()}">
    </article>
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top