Hi John
The createAttribute method should be called on the DOMDocument object, not
an element object. Try
//create new element
JourneyNode = objXMLDOM.CreateElement("Journey");
//add attribute
objXMLDOM.createAttribute("Number");
The full syntax for createAttribute is at:
http://msdn.microsoft.com/library/en-us/xmlsdk/htm/xml_mth_ac_4ehx.asp
You might find it easier to use the setAttribute method - see below for an
example:
<cfscript>
temp = xmldoc.loadXML('#myxml#');
child = xmldoc.createElement('Journey');
child.setAttribute('Number','');
node1=xmlDoc.documentElement;
node1.appendChild(child);
</cfscript>
Best wishes
Tom
-----------------+
tom dyson
t: +44 (0)1608 811870
m: +44 (0)7958 752657
http://torchbox.com
> Greetings,
>
> I would have thought this would have worked when adding an attribute
> to a new element,
>
> //create new element
> JourneyNode = objXMLDOM.CreateElement("Journey");
> //add attribute
> JourneyNode.createAttribute("Number");
>
> but I'm getting this error,
>
> Failed attempting to find "CREATEATTRIBUTE" property/method on the object
> COM error 0x80020006. Unknown name
>
> I'm obviously calling createAttribute wrong,
>
> any ideas out there,
>
> respectfully,
>
> j
-----------------------+
cf-xml mailing list
list: [EMAIL PROTECTED]
admin: [EMAIL PROTECTED]
home: http://torchbox.com/xml