I have an XML component that improves XPath updating of xml for ColdFusion.
With it, you could do something like this to solve your problem:

<cfinvoke component="betterXML_editor" method="init" returnvariable="myXML"
src="#myXMLFilePath#">

<cfscript>
 myXML.InsertAttribute("//facet/[EMAIL PROTECTED]", "isLive", "true");
 myXML.Write();
</cfscript>

And you are done :). I'm not sure of the XPath you need but it might be as
above (play around with it). As to identifying wether the id belongs to a
facet or a taxon I don't think that is possible unless you know where the
live ids have come from. The component(s) are here:

http://betterxml.riaforge.org/

Dominic

On 23/12/2007, Dave Francis <[EMAIL PROTECTED]> wrote:
>
> I have the following xmlDoc <snippet>, where each node has a unique id:
>
>    <facet id="aaa">
>        <taxon id="bbb" />
>        <taxon id="ccc" />
>    </facet>
>    <facet..... etc
>
> I also have a list of "live" ids, but the list is ids only - it doesn't
> indicate whether it's of a facet or taxon. For each id in the "live" list,
> I
> need to add a live="true" attribute to the corresponding xml node.
>
> But I can't figure out the right way to address the element I need. Best I
> can come up with is this (No, I haven't been at the egg-nog... Yet)
>    structInsert(xmlDoc.document.facet//[EMAIL 
> PROTECTED]"#argID#"].XmlAttributes,
> "live", "true")
>
> My xPath is weak, and structInsert probably doesn't recognize it anyway.
>
> But there has to be a way to add an attribute to a specific element -
> please.
>
>    Happy Xmas
>
>    Dave
>
>
>
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:295308
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to