I have an XML file which has XPath string in its attribute. Something like this -
<root>
<element name="A" visible="True" text="Display Text " selected="True" />
<element name="B" visible="True" text="DisplayText" visibilityCondition="//element[@name='A']/@selected" />
</root>
Now using XSLT I want to show or hide content based on visibilityCondition of element named A. i.e.
<xsl:for-each select="element">
<xsl:variable name="visibleCondition" select="@visibilityCondition" />
<xsl:choose>
<xsl:when test="boolean($visibleCondition)">
<xsl:when test="$visibleCondition">
<xsl:if test="$visibleCondition='True'">
...
</xsl:if>
<xsl:otherwise>
...
</xsl:otherwise>
</xsl:when>
</xsl:choose>
</xsl:foreach>
The problem is the if condition always fails since, $visibleCondition has a value
//element[@name='A']/@selected whereas I want to get the XPath parsed and match against the actual value in the selected attribute which is True.
How do I go about achieving this?
nameattribute of theBelement has no opening quote, the attributevisibilityConditionis not a valid XPath expression.