Xsl

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • coolsuhas
    New Member
    • Jun 2006
    • 1

    Xsl

    I want to display a field in one column or the next column depending upon the existence of an element

    The XML is:
    Code:
    <TextTag><Name>XPER011</Name></TextTag>
    <TextTag><Name>XPER013</Name></TextTag>
    The xsl is:
    Code:
    <xsl:if test="Name='XPER011' or Name='XPER013'">
                <xsl:if test="Name='XPER011'">
                    <span id="textbgblue"><b>Evening Phone</b></span>
                </xsl:if>
                <xsl:if test="Name='XPER013'">
                    <span id="textbgblue"><b>Business Name</b></span>
               </xsl:if>
    </xsl:if>
    The condtion is such that the XSL should use the fragment:

    Code:
    <xsl:if test="Name='XPER013'">
                    <span id="textbgblue"><b>Business Name</b></span>
    </xsl:if>
    only when <TextTag><Name> XPER011</Name></TextTag> does not exist in XML. If it does exist, then, Name = XPER013 is handled by XSL from somewhere else in the XSL(not in above code)
    Last edited by Dormilich; Jan 21 '09, 12:00 PM. Reason: added [code] tags
Working...