xsl-list
[Top] [All Lists]

FW: get child tag value

2005-11-29 08:03:56
Hi,

In my xml I have the following data:
<parameter name="measType">
   <dataType>
      <long>
         <range>
            <min>3</min><max>4</max>
            <min>5</min><max>6</max>
...............


xsl
==
............................
<xsl:choose>
     
     <!-- Make constants for input parameters -->
     <xsl:for-each select="parameter">
      <xsl:variable name="range_const_name">
       public static final<xsl:text> </xsl:text><xsl:call-template 
name="dataType"/><xsl:call-template name="Camel2Underscore">
      <xsl:with-param name="str" 
select="@name"/></xsl:call-template></xsl:variable>
      <xsl:for-each select="dataType">
       <xsl:call-template name="action_in_parameter_value"><xsl:with-param 
name="range_const_name" select="$range_const_name"/>
      <!-- I need an additional parameter for the dataType. It is defined in 
the child tag with different data type names -->
      <!-- <xsl:with-param name="data_type" select="."/>-->
       </xsl:call-template>
      </xsl:for-each>
     </xsl:for-each>
        </xsl:when>
...............

<xsl:template name="action_in_parameter_value">
   <!-- range_const_name is : public static final int MEAS_TYPE 
        So for each <min> <max> pair I want to print the follwing:
        public static final int MEAS_TYPE_VALUE = 3;
public static final int MEAS_TYPE_VALUE = 4;
 public static final int MEAS_TYPE_VALUE = 5;
public static final int MEAS_TYPE_VALUE = 6;

-->
 </xsl:template>

Since the child to <dataType> varies I am not sure how I can accomplish this.

Any ideas?

cheers,

//mikael






--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



<Prev in Thread] Current Thread [Next in Thread>