Skip navigation
Currently Being Moderated

How to traverse hyphenated nodes of an xml?

Jul 17, 2013 5:45 AM

Tags: #as3 #flex #actionscript

Hi,

 

I have an xml structure as follows,

<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:ucreate="http://www.xmpie.com/ucreate">

                                                                                          <fo:layout-master-set>

                                                                                                         <fo:simple-page-mas ter>

                                                                                                         </fo:simple-page-ma ster>

                                                                                          </fo:layout-master-set>

</fo:root>

 

Now, I need to traverse this structure. This is not possible in the usual manner like xml.fo:layout-master-set. Flex gives a compile error here. On searching I found that I could traverse to fo:layout-master-set via the namespace. As follows,

 

var foNm:Namespace = xml.namespace("fo");

var childNode:XMLList = xml.foNm::["layout-master-set"];

 

After execution, childNode holds the correct list which is for layout-master-set.

 

However, I need to traverse to simple-page-master node. I tried to do that in a similar manner.

var childNode:XMLList = xml.foNm::["simple-page-master"];

 

But in this case childNode comes up empty. How can I do this?

 

Please guide.

 
Replies

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points