0 Replies Latest reply on Jun 14, 2017 11:58 PM by revathiv80720177

    Getting family id from xml using script

    revathiv80720177 Level 1

      Hi,

       

      I am trying to get a family id from xml only for the product placed in the InDesign document using scripts.

       

      I have a script to get the all family id from xml.

       

      Here is my script,

       

      var product;

                                                  currFamilyID = new String(currFamilyIDAttr.value);

                                                    alert(currFamilyID);

                                                  currFamilyID = currFamilyID + "']";

                                   updatedFamily = xmlTree.xpath("//*[@family_id='"+currFamilyID);

                                                //     product = updatedFamily.child("products").children()[0];

                                               if(product!=null)//if product tag exists in updated XML6

        {

                                              var product;

                                                  currFamilyID = new String(currFamilyIDAttr.value);

      }

      This scripts returns all family id from the xml. How shall I get the family id for the product placed in the InDesign document.

       

      Regards,

      Revathi