all groups > flash data integration > june 2006 >
You're in the

flash data integration

group:

nextSibling Pain


nextSibling Pain mcshaw
6/6/2006 9:40:29 PM
flash data integration:
Im having a problem with using nextSibling.
- I do not want to contiue to add nextSibling.nextSibling.nextSibling
- I have tried unsuccessfuly to concatenate a string and insert it as so
firstChild[tmp_str].arttributes.editability = 1

This is what I want:
<row>
<cell editability="1"></cell>
<cell editability="2"></cell>
<cell editability="3"></cell>
</row>

This is how Im doing it:

var tmpnode:XMLNode = doc1.createElement("cell");
doc1.firstChild.appendChild(tmpnode);
doc1.firstChild.firstChild.attributes.editability = 1;

var tmpnode:XMLNode = doc1.createElement("cell");
doc1.firstChild.appendChild(tmpnode);
doc1.firstChild.firstChild.nextSibling.attributes.editability = 2;


var tmpnode:XMLNode = doc1.createElement("cell");
doc1.firstChild.appendChild(tmpnode);
doc1.firstChild.firstChild.nextSibling.nextSibling.attributes.editability = 3;

Re: nextSibling Pain Raymond Basque
6/7/2006 8:55:49 AM
The XML.createElement method returns a reference to the newly created
XMLNode. You can set your attributes directly on the node reference instead
of doing the nextSibling thing.

i.e

var tmpnode:XMLNode = doc1.createElement("cell");
doc1.firstChild.appendChild(tmpnode);
tmpnode.attributes.editability = 1;


[quoted text, click to view]

AddThis Social Bookmark Button