You know, this reminds me of a question I've been meaning to ask. Is it
faster to read from an XML object than to do a Query of Query? I've
been pretty pleased with CFQuickDocs' speed, but I wonder if I were to
just put the XML object in the Application scope, and then reference
that instead of doing a Q of Q, if it would perform better.
I guess I need to do some cftimer tests. :)
On another note, would the xmlobject take up more, or less memory than
the query object? These are some deep thoughts I've been pondering
lately.
> -----Original Message-----
> From: Munson, Jacob
> Sent: Tuesday, July 18, 2006 5:02 PM
>
> I do this in CFQuickDocs, here's a shortened version of what I do:
>
> <cffile action="read" file="#baseCFPath#xml/cfmlTags.xml"
> variable="xmlDoc">
> <!--- Create an XML document object from the XML text --->
> <cfset xmlCFTagsObj = XmlParse(xmlDoc)>
> <cfset numTags = ArrayLen(xmlCFTagsObj.Tags.tag)>
>
> <!--- The next few lines convert the xmlDocument object into a query
> object --->
> <!--- 1. create the query object--->
> <cfset cftagsQuery = QueryNew("tag, category, summary, tagURL") >
> <cfset temp = QueryAddRow(cftagsQuery, #numTags#)>
> <!--- 2. loop over the contents of the xml object --->
> <cfloop index="i" from = "1" to = #numTags#>
> <!--- 3. insert a record for each cf tag --->
> <cfset temp = QuerySetCell(cftagsQuery, "tag",
> #xmlCFTagsObj.Tags.tag[i].XmlAttributes.id#,#i#)>
> <cfset temp = QuerySetCell(cftagsQuery, "category",
> #xmlCFTagsObj.Tags.tag[i].tagCategory.XmlText#, #i#)>
> <cfset temp = QuerySetCell(cftagsQuery, "summary",
> #xmlCFTagsObj.Tags.tag[i].tagSummary.XmlText#, #i#)>
> <cfset temp = QuerySetCell(cftagsQuery, "tagURL",
> #xmlCFTagsObj.Tags.tag[i].tagURL.XmlText#, #i#)>
> </cfloop>
>
> I believe you can also do this with cfscript and it looks a
> bit cleaner.
>
> > -----Original Message-----
> > From: Pete Ruckelshaus [mailto:[EMAIL PROTECTED]
> > Sent: Tuesday, July 18, 2006 2:23 PM
> >
> > Looking through the docs and cflib I don't see anything, but
> > have any of you
> > converted an XML doc to a CF query object? If so, can you
> > point me in the
> > right direction?
This transmission may contain information that is privileged, confidential
and/or exempt from disclosure under applicable law. If you are not the intended
recipient, you are hereby notified that any disclosure, copying, distribution,
or use of the information contained herein (including any reliance thereon) is
STRICTLY PROHIBITED. If you received this transmission in error, please
immediately contact the sender and destroy the material in its entirety,
whether in electronic or hard copy format. Thank you. A1.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
up-to-date ColdFusion information by your peers, delivered to your door four
times a year.
http://www.fusionauthority.com/quarterly
Archive:
http://www.houseoffusion.com/cf_lists/message.cfm/forumid:4/messageid:247090
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4