Nice trick on xmlParse.  You don't Get variables into a CFC, that is a SET.
You get from a CFC.  I SET some of the application variables in each of my
CFC's, rather then referencing an application variable in the CFC's.  This
is to create fully encapsulated objects (no outside references).

I also don't loop through the XML to load into separate application
variables.  I just refer directly to the application.xml message.  Saves
steps and only causes a few lines to be a bit longer.

Andy

-----Original Message-----
From: Will Tomlinson [mailto:[EMAIL PROTECTED] 
Sent: Sunday, September 18, 2005 4:38 PM
To: CF-Talk
Subject: Re: using an xml file for cfc settingsray style

>Wow, I just read what I wrote...it is like English but different.  But if
>you lower your intelligence by a few notches, you just might get the jist.
>Sorry.


I've been testing different ways of doin this. Ray tipped me off to a new
feature of XMLParse() in mx7 which lets you use filenames and url's, so you
can eliminate the whole cffile read, like this: 

<!--- Create a new CF XML document object--->   
  <cfset thevalues = XMLparse(ExpandPath("config.xml"))>

And what's mixing me up is the need to *get* the variables into a cfc. If
you loop thru and save all your xml to application variables, they're ready
to use in a cfc. This doesn't look like good cfc practice, but it works. If
I create a cfc using this, it returns the correct value. I never passed
anything to it. 

<cfcomponent>
        <cffunction name="myFunction" access="public" returntype="string">
                <cfset myResult = APPLICATION.DSN>
                <cfreturn myResult>
        </cffunction>
</cfcomponent>

Will




~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
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:218572
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

Reply via email to