M
mikael petterson
Hi (again!!),
I am still a beginner in xsl
I need to check if the <attribute> has a child called <mandatory>. (In this
case no!).
When I try to add some xsl code I first check what the current node is by
using:
<xsl:value-of select="."/>
The value I get is "BUS_DISABLED". Then my reasoning is the following:
I need to climb 2 levels in order to get on the same level as
<noNotification/>, <nonPersistent/>,<readOnly/> which is the same level as
where <mandatory> would have been. If <mandatory> exists add text mandatory
if not I add text optional. But I only get optional.
Any hints for the newbie ( or shall we say xsl wannabe).
//Mikael
Ps. I there a good book on xsl and xslt.
<xsl:choose>
<xsl:when test="../../boolean(mandatory)">
<xsl:text>"mandatory";</xsl:text>
</xsl:when>
<xsltherwise>
<xsl:text>"optional";</xsl:text>
</xsltherwise>
</xsl:choose>
This is part of xsl
=============
<attribute name="bbBusState">
<description></description>
<noNotification/>
<nonPersistent/>
<readOnly/>
<dataType>
<enumRef name="TxDeviceGroup_BbBusState">
<defaultValue>BUS_DISABLED</defaultValue>
</enumRef>
</dataType>
</attribute>
<attribute name="tpcMode">
I am still a beginner in xsl
I need to check if the <attribute> has a child called <mandatory>. (In this
case no!).
When I try to add some xsl code I first check what the current node is by
using:
<xsl:value-of select="."/>
The value I get is "BUS_DISABLED". Then my reasoning is the following:
I need to climb 2 levels in order to get on the same level as
<noNotification/>, <nonPersistent/>,<readOnly/> which is the same level as
where <mandatory> would have been. If <mandatory> exists add text mandatory
if not I add text optional. But I only get optional.
Any hints for the newbie ( or shall we say xsl wannabe).
//Mikael
Ps. I there a good book on xsl and xslt.
<xsl:choose>
<xsl:when test="../../boolean(mandatory)">
<xsl:text>"mandatory";</xsl:text>
</xsl:when>
<xsltherwise>
<xsl:text>"optional";</xsl:text>
</xsltherwise>
</xsl:choose>
This is part of xsl
=============
<attribute name="bbBusState">
<description></description>
<noNotification/>
<nonPersistent/>
<readOnly/>
<dataType>
<enumRef name="TxDeviceGroup_BbBusState">
<defaultValue>BUS_DISABLED</defaultValue>
</enumRef>
</dataType>
</attribute>
<attribute name="tpcMode">