xsl-list
[Top] [All Lists]

[xsl] getting the child element based on attribute

2010-11-12 18:44:28
Hi,
     I am trying to read an xml in xsl,based on QMName,i need to get the child 
element value.

Here is my xml file

<Config-Policy>
   <Policy QMName="BRKQM">     
      <QMNumber>01</QMNumber>      
   </Policy>
   <Policy QMName="BSKQM">     
      <QMNumber>02</QMNumber>      
   </Policy>   
</Config-Policy>

     If let us suppose QMName is BRKQM i need to get save it on variable
     and based on this i need to take the QMNumber and save it in a variable
          similar case with BSKQM as well.


Here is my xsl


<xsl:template match="/">
        <xsl:variable name="qmName"
                select="dp:variable('var://context/MYMQMD/QMName')" />
        <xsl:variable name="config"                     
select="document('local:///QM_Mapping.xml')" />
      
      <xsl:variable name="configQMName"
          select="$config/Config-Policy/Policy[(_at_)QMName=$qmName]" />
        <xsl:variable name="qmNumber" select="$configQMName/QMNumber" />
</xsl:template>


    But i am getting nothing from these variables.
         Can any one suggest how should i proceed on this



--~------------------------------------------------------------------
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>
--~--