Status/Resolution/Reason: Closed/Fixed/NeedMoreInfo
Reporter/Name(from Bugbase): Aaron Neff / ()
Created: 04/12/2018
Components: Language
Versions: 2016
Failure Type: Usability Issue
Found In Build/Fixed In Build: 0 / docs
Priority/Frequency: Normal / Very few users will encounter
Locale/System: / Platforms All
Vote Count: 0
Issue: The "Modifying a ColdFusion XML object" doc's description of StructAppend is: "Appends a document fragment XML document object to another XML document object.", but there is no example.
I'm unsure what a working example would look like. FWIW, these all fail (i.e. the "bar" node does not appear in the dumps):
<cfscript>
xmlDoc1 = xmlParse("<myXML><foo>foo</foo></myXML>");
xmlDoc2 = xmlParse("<myXML><bar>bar</bar></myXML>");
structAppend(xmlDoc1.myXML, xmlDoc2.myXML);//WRONG_DOCUMENT_ERR: A node is used in a different document than the one that created it.
writeDump(xmlDoc1);
abort;
</cfscript>
<cfscript>
xmlDoc = xmlParse("<myXML><foo>foo</foo></myXML>");
xmlElem = xmlElemNew(xmlDoc, "bar");
structAppend(xmlDoc.myXML, xmlElem);
writeDump(xmlDoc);//does not show the "bar" node
abort;
</cfscript>
<cfscript>
xmlDoc = xmlParse("<myXML><foo>foo</foo><bar>bar</bar></myXML>");
xmlFragDoc = duplicate(xmlDoc.myXML.xmlNodes[2]);
structDelete(xmlDoc.myXML, "bar");
structAppend(xmlDoc.myXML, xmlFragDoc);
writeDump(xmlDoc);//does not show the "bar" node
abort;
</cfscript>
Related URL: https://helpx.adobe.com/coldfusion/developing-applications/using-web-elements-and-external-objects/using-xml-and-wddx/modifying-a-coldfusion-xml-object.html
Attachments:
Comments: