2 Replies Latest reply on Oct 22, 2009 1:41 PM by -LokkiOnLintu-

    Counting xml elements using javascript

    Lokkionlintu

      How can I count the number of certain xml elements inside the xml file that import.

       

      Example xml:

       

      <list>

           <product>

                <name>Product_01</name>

                <detail>info here</detail>

           </product>

           <product>

                <name>Product_02</name>

                <detail>info here</detail>

           </product>

           <product>

                <name>Product_03</name>

                <detail>info here</detail>

           </product>

      </list>

       

       

       

      I would like to count the number of product -elements in this example xml.

      I'm using javascript for scripting.

       

      Thanks.