Hi Guys,

No worries, its satisfying to get to the bottom of this stuff.

I've actually discovered that the fix for this in 1.5 breaks a
behaviour of XMLSearch() that we rely on. Which is a quick way of
updating and adding nodes in an XML Document. The following test case
works in 1.4. but not in 1.5 Nightly 18th Feb, I guess the question is
is the leak and this lesser known capability related ?

<cfscript>

function
insertPropertyById(xmlDoc,nodeid,nodetype,propertyname,propertyvalue){
        var aParentNode = arrayNew(1);
        var nInsertPostion = 1;//Insert the node at the top

        //Check to see if this parentnode exists
        if(lcase(nodetype) eq "section"){
                //We are adding under a section
                aParentNode = xmlSearch(xmlDoc,"//section[@uuid='#nodeid#']");
        }else{
                if(lcase(nodetype) eq "page"){
                        //We are adding under a page
                        aParentNode = 
xmlSearch(xmlDoc,"//page[@page_uuid='#nodeid#']");
                }else{
                        aParentNode = 
xmlSearch(xmlDoc,"//#nodetype#[@uuid='#nodeid#']");
                }
        }

        if(arrayLen(aParentNode)){
                ArrayInsertAt(aParentNode[1].xmlChildren, nInsertPostion,
xmlElemNew(xmlDoc,"property"));
                aParentNode[1].XmlChildren[nInsertPostion].xmlAttributes.name =
trim(propertyname);//Add the attributes to
this new child
                aParentNode[1].XmlChildren[nInsertPostion].xmlAttributes.uuid =
createUUID();//Add the attributes to this
new child
                aParentNode[1].XmlChildren[nInsertPostion].xmlText = 
PropertyValue;//
Add the attributes to this new child
        }
}
</cfscript>

<cfxml variable="application.xdoc">
<root>
<section uuid="1">
        <page page_uuid="1234" />
</section>
</root>
</cfxml>

<cfset insertPropertyById(application.xdoc,"1","section","foo","bar")>

<cfdump var="#application.xdoc#">

Many thanks

Alex

On Feb 8, 10:54 pm, Matthew Woodward <[email protected]> wrote:
> On Tue, Feb 8, 2011 at 2:05 PM, Alan Williamson (aw2.0 cloud experts) <
>
> [email protected]> wrote:
> > Thank you Alex, for the confirmation.
>
> > please please report as soon you see anything afoot ... as you can tell ...
> > we're keen to get fixes out ASAP.
>
> Absolutely--thanks Alex! This is the #1 way people can help us is to report
> these issues and give us great test cases like you provided so they can be
> fixed quickly. We can't possibly test every scenario so having real-world
> apps in the mix that expose things we might not otherwise know about is a
> huge help to the project.
>
> --
> Matthew Woodward
> [email protected]http://blog.mattwoodward.com
> identi.ca / Twitter: @mpwoodward
>
> Please do not send me proprietary file formats such as Word, PowerPoint,
> etc. as attachments.http://www.gnu.org/philosophy/no-word-attachments.html

-- 
tag/function ref: http://www.openbluedragon.org/manual/
 mailing list - http://groups.google.com/group/openbd?hl=en

 Get to Texas in Feb for OpenCFSummit http://www.opencfsummit.org/

Reply via email to