This content has been marked as final. Show 5 replies
I suppose using Flash's XPathAPI.setNodeValue() would be more ideal.
I can't say because I've not used setNodeValue... I've used XPathAPI quite a bit for getting arrays of nodes or a single node, but I always end up using the regular AS2 node access properties for altering values.
What you were trying to do with altering the attributes by text manipulaition is possible. Its just (after getting used to it) much better to use the XML/XMLNode class and maybe XPathAPI
Your text manipulation was missing the single or double quotes around the attributes values.
Here's a few examples for you to digest, based on what you had.
ah! Cool...yeah, XPathAPI is new to me. Just learned about it today in fact! Thanks for the info, i do need to change my code here to use the selectSingleNode(). Thanks.
You don't have to use XPathAPI... but I'd suggest it makes life a bit easier.
The line in my example
is doing it without XPathAPI
I forgot to mention that my plan has slightly changed since I first posted this thread, I still need to access all attributes that have an value for ‘att’. I have a huge XML file with many different levels of nodes in which I need to find and archive those attributes. The code below is my first use of Xpath.
Do you think that there is a more elegant way of doing this, instead of adding several wildcards to the path?