Rough night last night and im having trouble dynamically pasing and xml doc.
here is an example of the xml doc
<?xml version="1.0" encoding="utf-8"?>
<settings>
<application>
<name>cfInferno</name>
<version>v 0.1 {alpha}</version>
<url>http://localhost/cfinferno</url>
<secure></secure>
</application>
<database>
<dsn>mycart</dsn>
</database>
</settings>
This is just an example, the file above can be dynamic. I need to create a
structure of structures dymically like so
<cfset settings = structNew()>
<cfset settings.application = structNew()>
<cfset settings.application.name = "myname">
<cfset settings.application.version = "1.0">
<cfset settings.database = structNew()>
<cfset settings.database.dsn = "mydsn">
Here is my function, again I am just getting on the dyamic xml stuff,
creating a new struct for each node and and children. Thanks for the help on
this rough sunday, GO BUCKS!!!
<cffunction name="read" access="public" output="true"
returntype="struct"
hint="I will return a structure containing all application
seetings.">
<cfset var xml = "">
<cfset var xmldoc = "">
<cftry>
<cffile action="read" file="#variables.configPath#"
variable="xml"/>
<cfcatch type="any">
<cfthrow message="Unable to read xml file
'#variables.configpath#'.">
</cfcatch>
</cftry>
<cfset xmldoc = xmlParse(xml)>
<cfloop item="key" collection="#xmldoc#">
??
</cfloop>
<cfabort>
<cfreturn variables.settings>
</cffunction>
--
Thank You
Dan Vega
[EMAIL PROTECTED]
http://www.danvega.org
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Create robust enterprise, web RIAs.
Upgrade & integrate Adobe Coldfusion MX7 with Flex 2
http://ad.doubleclick.net/clk;56760587;14748456;a?http://www.adobe.com/products/coldfusion/flex2/?sdid=LVNU
Archive:
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:265934
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4