He's talking about the attribute node (the text contents of elements
are also nodes, but I digress)... however, if you're talking about
needing to make changes to the XML packet, I wouldn't do this in CF, I
would use an XSLT transformation:
<xsl:stylesheet>
<xsl:output method="xml"/>
<xsl:template match="*">
<xsl:copy>
<xsl:copy-of select="@*" />
<xsl:if test="string-length(@myattribute)='myvalue'">
<xsl:attribute
name="myattribute">newvalue</xsl:attribute>
</xsl:if>
<xsl:apply-templates />
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
Then run the xml packet through XMLTransform() with this sheet.
Look for tutorials on XPath and XSLT -- w3schools.com/org has some
decent info.
> Problem is that I don't know the Node Name
> -----Original Message-----
> From: Sergey Croitor [mailto:[EMAIL PROTECTED]
> Sent: Saturday, September 03, 2005 4:43 PM
> Use XPath query:
> tmpNodes=XmlSearch(your_XmlDoc,
> '//[EMAIL PROTECTED]"Y"]');
> Then loop through tmpNodes, it is an array.
> --
> Serg
> A> I need to search for all of the Nodes that an attribute
> X that equals Y,
> A> then do something with each of those nodes.
> A> Andy
> A> -----Original Message-----
> A> From: S. Isaac Dealey [mailto:[EMAIL PROTECTED]
> A> Sent: Saturday, September 03, 2005 1:47 PM
> A> To: CF-Talk
> A> Subject: Re: XML Tree Search
>>> Does anyone have code that they would share that
>>> traverses
>>> through every node in an XML structure?
> A> umm... XMLSearch() ... What are you trying to
> accomplish? The answer
> A> to that question might be more helpful.
> A> s. isaac dealey 954.522.6080
> A> new epoch : isn't it time for a change?
> A> add features without fixtures with
> A> the onTap open source framework
> A> http://www.fusiontap.com
> A> http://coldfusion.sys-con.com/author/4806Dealey.htm
> A>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking
application. Start tracking and documenting hours spent on a project or with a
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:217313
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54