2 Replies Latest reply on Sep 8, 2009 6:51 AM by guyenInDesign000

    Assigning imported XML tag values to a variable

    guyenInDesign

           Hello, guys

      I have a need to assign the imported XML tag value to a variable. Is it possible at all.

      I have tried to do something like that

       

      Given the xml content like this:

      <card>
        <fullName>
          <x>10</x>
          <y>10</y>
          <w>220</w>
          <h>30</h>
        </fullName>

      </card>

       

      myDocument.xmlElements.item(0).xmlElements.item(0).xmlElements.item(2).content will extract the value 220 and print it

      if I place into text box.But I wanna use the value in the script and tried to assign like follows:

       

      var fullNameX = myDocument.xmlElements.item(0).xmlElements.item(0).xmlElements.item(2). But variable fullNameX

      does not get the value of 220

       

      and if I do

      alert(myDocument.xmlElements.item(0).xmlElements.item(0).xmlElements.item(2).content);

      then the alertbox says [object XML Element]

       

      Could someone help me please. Thanks!