I'm in need of some direction... I have many xml files that I need to parse
and save their content into a database. All the xml files have the same
element names and those names match the names of the fields in my database
table.
My problem is I need to loop though each xml file and collect its data then
store the available content into the database as a mass insert. I need to
loop through about 100 xml files all at once and then somehow make this an
auto process that can be run once a week to update the content.
Any ideas...?
Below is my current code for outputting the information (only the name field
is shown).
<cfhttp method="GET"URL=""> <cfset XMLDoc = XMLParse(CFHTTP.FileContent)>
<cfset xRoot = XMLDoc.Xmlroot>
<cfset myBenefit = XMLSearch(XMLDoc, "/benefitDocument")>
<!--- Output the XML formatted query results --->
<cfloop from="1" to="#arrayLen(myBenefit)#" index="i">
<cfoutput>
<cfif structKeyExists(myBenefit[i], "Name")>
#myBenefit[i].Name.xmltext#
<cfelse>
</cfif>
</cfoutput>
</cfloop>
Thanks,
- Neal
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

