I have an xml structure like below and would like to store the activity
name attribute as key along with complete inputBindings structure with
xml tags etc as value in a hash -

activityName = Hash.new

Following doesn't get anything in value -

xml.elements.each("/kp:process/kp:activity"){ |e|
@activityName[e.attributes["name"]] =
xml.elements("/kp:process/kp:activity[@name=e.attributes["name"]]/kp:inputBindings
}

<kp:process>
 <kp:activity name="one">
        <kp:x>857</kp:x>
        <kp:y>161</kp:y>
        <config>
            <faultName>ErrorSchema</faultName>
        </config>
        <kp:inputBindings>
            <ns2:ActivityInput>
                <data>
                    <xsl:choose>
                        <xsl:when
test="$map/EventData/retryEvent='true'">
          ........
         <kp:inputBindings>
  </kp:activity>
  <kp:activity name="two">
          <kp:x>857</kp:x>
          <kp:y>161</kp:y>
          <config>
              <faultName>ErrorSchema</faultName>
          </config>
          <kp:inputBindings>
              <ns2:ActivityInput>
                  <data>
                      <xsl:choose>
                          <xsl:when
test="$map/EventDataretryEvent='true'">
            ........
           <kp:inputBindings>
  </kp:activity>
<kp:process>

-- 
Posted via http://www.ruby-forum.com/.