0

I have an ugly druple-gardens RSS feed coming into flash and I'm using the same idea as this link. http://www.eccesignum.org/blog/accessing-views-from-flash-in-drupal-gardens to parse it into a new xml structure.

flash code:

            var str = item.description;
            var newString = str.split("&lt;").join("<").split("&gt;").join(">").split("&quot;`").join("\"").split("&nbsp;").join(" ");
            var description = new XML('<description>'+ newString + '</description>');

            trace("myXML = "+description[0]);

I'm trying to see how I can get to each element by names. Here is the first description node. traced out description xml.

<description>
  <div class="field field-name-field-hometown field-type-text field-label-above">
    <div class="field-label">Home Town:</div>
    <div class="field-items">
      <div class="field-item even">Bemidji, Minnesota (up near where they filmed Fargo)</div>
    </div>
  </div>
  <div class="field field-name-field-school field-type-text field-label-above">
    <div class="field-label">School:</div>
    <div class="field-items">
      <div class="field-item even">UCONN Undergrad / Columbia MBA</div>
    </div>
  </div>
  <div class="field field-name-field-lives field-type-text field-label-above">
    <div class="field-label">Currently Live:</div>
    <div class="field-items">
      <div class="field-item even">Milford, CT</div>
    </div>
  </div>
  <div class="field field-name-field-relationship field-type-text field-label-above">
    <div class="field-label">relationship status:</div>
    <div class="field-items">
      <div class="field-item even">Married with two boys</div>
    </div>
  </div>
  <div class="field field-name-field-tidbit field-type-text-long field-label-above">
    <div class="field-label">tidbit:</div>
    <div class="field-items">
      <div class="field-item even">I’m an avid UCONN fan, a Green Bay Packers shareholder and I golf whenever I get the chance.</div>
    </div>
  </div>
  <div class="field field-name-field-favorite-memory field-type-text-long field-label-above">
    <div class="field-label">Favorite Memory:</div>
    <div class="field-items">
      <div class="field-item even">beating Worthington in the Ping Pong Tournament</div>
    </div>
  </div>
</description>

I have tried to get to field-label with no luck. Example:

description.div.field-label and the value of the field items

Anyone have any idea how I can get to the elements using the names in the above xml.

1 Answer 1

1

Have you tried

var list:XMLList =yourXML.descendents('div').(attribute('class')=='field-label');
for each var (node:XML in list) {
   trace(node.text());
}

?

Sign up to request clarification or add additional context in comments.

1 Comment

Hi Amy how would I get to the image node in this. <div class="field-items"> <div class="field-item even"> <img typeof="foaf:Image" src="blsa.drupalgardens.com/sites/blasa.drupalgardens.com/files/…" width="525" height="700" alt=""/> </div>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.