Ask a Question related to Macromedia Flash Data Integration, Design and Development.
-
Bart_Sportpaleis #1
Accessing XML nodes
Suppose this your XML:
<content>
<author>
<book>
<title>this is the title</title>
<description>book description</description>
<book>
</author>
</content>
How can I easily retrieve the title using the nodeNames? I don't like this way
of accessing:
this.childNodes[0].childNodes[0].childNodes[0].childNodes[0].nodeValue
Just because it's confusing. I would like a notation like this or something
similar:
content.author.book.title.nodeValue()
Is this possible? Grtz, Bart
Bart_Sportpaleis Guest
-
Inserting XML nodes
I want to insert a new XML node in my XML object, but not at the end as ..appendchild() method does, but in the node position of my choice... for... -
Check for missing xml nodes or empty nodes
Hi, Is it possible to check for missing or empty xml nodes "before" putting them into a table or doing a XMLSearch . Sometimes the xml will come... -
FreeBSD 5.3 dev nodes
Hi all, ok, this may be a dumb question, but here goes... I have just started using the 5.X branch of FreeBSD, and needed to mount a hot swap... -
Creating nodes with ASP
I have a page that lists categories on the left, and I'd like to be able to click on one, and have a node pop out, revealing subcategories so users... -
referencing XML nodes by name
I would like to access the info in an XML file by name but Macromedias XML-Xtra instructions only explain how to access data via child-number eg... -
LuigiL #2
Re: Accessing XML nodes
Wouldn't that be comfortable. Unfortunately, no. But, you can define an object
and turn the nodes into properties of that object. Than you would have access
with myObject.title
Otherwise you could extend the XMLNode class but that might be even more
confusing.
Another option: if you don't like working with this syntax, consider the
XMLConnector component along with a DataHolder or DataSet. This gives you the
option of binding the XML tree visually and you don't have to work with the
childNodes syntax.
LuigiL Guest
-
chris.davis #3
Re: Accessing XML nodes
Bart_Sportpaleis,
Try this freeware XPath implementation for ActionScript:
[url]http://www.xfactorstudio.com[/url]
This library mimics XPath which makes traversing XML structures much easier.
You can refer to paths like directories (content/author/book/title) instead of
the awkward approach like you've shown. After I got fed up with the
"recommended" way to do this, I searched a while and found this and have been
much happier with it.
Hope this helps,
-Chris
chris.davis Guest



Reply With Quote

