More XML Confusion?

Ian Wood revlist at azurevision.co.uk
Tue May 29 08:16:37 EDT 2007


On 29 May 2007, at 13:04, Dave wrote:

> I've been playing around and got to the point where I can add nodes  
> etc. However I need to generate lots of "Failure" nodes. When I run  
> the following code, only the second node gets added. How can I add  
> multiple nodes?

What is "UtilXMLNewElement"? I'm assuming that it's some function of  
your own, as it's not a Rev function.

I've successfully used the following inside a repeat structure, where  
treeID is the ID of the XML tree:

====================================

revAddXMLNode treeID,  tAssetsNode, "asset", ""
put the result into tItemNode
checkforerror tItemNode
revSetXMLAttribute treeID, tItemNode, "id_number", char 2 to 4 of  
numAssets
revSetXMLAttribute treeID, tItemNode, "main_title", the main_title of  
tControl
revSetXMLAttribute treeID, tItemNode, "asset_path", the asset_path of  
tControl
revSetXMLAttribute treeID, tItemNode, "artist_name", the artist_name  
of tControl
revSetXMLAttribute treeID, tItemNode, "x", text of fld "x" of stack  
"position"
revSetXMLAttribute treeID, tItemNode, "y", text of fld "y" of stack  
"position"
revSetXMLAttribute treeID, tItemNode, "wall", text of fld "wall" of  
stack "position"
revSetXMLAttribute treeID, tItemNode, "pan", text of fld "pan" of  
stack "position"
revSetXMLAttribute treeID, tItemNode, "hFOV", text of fld "hFOV" of  
stack "position"
revSetXMLAttribute treeID, tItemNode, "hOffset", text of fld  
"hOffset" of stack "position"
revSetXMLAttribute treeID, tItemNode, "vOffset", text of fld  
"vOffset" of stack "position"

====================================

Ian



More information about the use-livecode mailing list