I believe the patch in 1.5 to fix the original issue reported issue in
1.4 is removing the pass by reference which is solving the leak but
breaking some other compatibility.

Alan mentioned here
http://groups.google.com/group/openbd/browse_thread/thread/dffc61c33d24ce77/d433f5447a9dd838?lnk=gst&q=xpath#d433f5447a9dd838
that swapping out the Xalan libraries for the latest versions was an
alternative way of resolving.

I spoke to a mate that uses this quirk of Xpath on CF so it appears
its not as unsual as i thought.

Any pointers whats involved in sorting this as its blocking our
adoption of OpenBD? I assume a latest version swap out is more
involved than replacing Jars ?

Many thanks

Alex





, is the Xalan library swap out more involved than

On Feb 11, 10:07 pm, AlexS <[email protected]> wrote:
> Hi,
>
> I've create a test case to illustrate a feature that was previously
> working in 1.4 that now isn't in the nightly build of 18th Feb.
>
> This is probably a lesser known behaviour that you can run an xpath on
> an xml object make a change to the resultant search and this changes
> the original xml. Very useful for being able to search, locate and
> update nodes.
>
> We now get an error about differing documents though.
>
> @alan is this as result of the clone nodes to fix the xpath leak.
>
> Thanks
>
> Alex
>
> <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#">

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

Reply via email to