Easy question, I would think.

Let's say I'm creating a node in an XML object like this:


public function buildNode( newNode:String, parentNode:String, contents:Array
):XML
{
 var buffer:XML = new XML( parentNode );
 for( var i:int = 0; i < contents.length; i++ )
 {
  var node:XML = new XML( newNode );
  node.appendChild( contents[i] );
  buffer.appendChild( node );
 }
  return buffer;
}
This actually creates nodes like this....

<nodename>value</nodename>

But what if I wanted to do this:

<nodename type="value"></nodename>

I looked at the documentation for the XML object and it says how to retreive
attributes, but doesn't seem to discuss adding attributes to a node.

Rick


-- 
CFMBB - Coldfusion Message Boards, Version 1.21 Now Available!
http://www.cfmbb.org


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Create Web Applications With ColdFusion MX7 & Flex 2. 
Build powerful, scalable RIAs. Free Trial
http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJS 

Archive: http://www.houseoffusion.com/groups/Flex/message.cfm/messageid:3822
Subscription: http://www.houseoffusion.com/groups/Flex/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.37

Reply via email to