By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,300 Members | 1,795 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,300 IT Pros & Developers. It's quick & easy.

How to find a matching element in xml with xsl

P: n/a

I have managed to get the name of the enum e.g. TxDeviceGroup_BbBusState
in the first part of the xml in the class element.
Now I need to find the minimum value of the enum called
TxDeviceGroup_BbBusState in the xml.
This is an operation I need to do for many enums.

I thought of doing something like this:

<xsl:call-template name="enumMin">
<xsl:with-param name="str"

<!-- Now str have the value "TxDeviceGroup_BbBusState"
Then search the xml document for the enum, TxDeviceGroup_BbBusState

<xsl:template name="enumMin">
<xsl:param name="str"/>
<xsl:if test="//enum/@name=$str">

<!-- Here i need to find the <enumMember> with <value> 0 ( or lowest)
and retrieve the
attribute name of <enumMember> -->



I appreciate all hints I could get.

My xml-file:
<class name="TxDeviceGroup">
<description>Device group for the Transmitter.
<attribute name="bbBusState">
<enumRef name="TxDeviceGroup_BbBusState">


<enum name="TxDeviceGroup_BbBusState">
<enumMember name="MASTER_LOADSHARING">
<enumMember name="MASTER_NO_LOADSHARING">
<enumMember name="SLAVE">
<enumMember name="BUS_DISABLED">
Jul 20 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.