Candace-

Look into the <CFXML> tag:

For example:

<cfquery name="getEmployees" datasource="SampleApps">
select *
from tblEmp
</cfquery>

<cfxml variable="EmployeeDoc">
        <employee>
                <cfoutput query="getEmployees">
                        <name id="#strEmpID#">
                                <title>#strTitle#</title>
                                <first>#Strfname#</first>
                                <last>#Strlname#</last>
                        </name>
                </cfoutput>
        </employee>
</cfxml>

<cfdump var="#EmployeeDoc#">

Collin Tobin
QA Engineer
617 219 2000
[EMAIL PROTECTED]
Macromedia�
What the web can be.(tm)




-----Original Message-----
From: Candace Cottrell [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, January 14, 2003 9:31 AM
To: CF-Talk
Subject: CFC to populate XML file


Ok, so I have a cfc that pulls data from a database:

<cffunction name="getDropDownData" access="public" returntype="query">
<cfargument name="pageType_ID" type="numeric" required="true"
default="0">
        <cfset var qgetDropDownData = ""/>

        <cfquery name="qGetDropDownData" datasource="#REQUEST.DSN#">
                Select DD_ID, DD_Title, DD_Header1, DD_Header2,
DD_Header3, DD_HEader4, PageType_ID
                From DD
                Where DD_PageType_ID = #PageType#
        </cfquery>

        <cfreturn getDropDownData>

</cffunction>


</cfcomponent>




And then I also have an xml file that populates a flash menu:

<?xml version="1.0"?>
<NAV main_onColor="#000000" main_offColor="#ff0000"
sub_onColor="#000000" sub_offColor="#666666" navWidth="150" fadeTime="0"
lineWidth="150" main_y_padding="4" sub_y_padding="2" sub_indent="10">
     <MAIN text="Foyer" URL="index.htm" target="_self"></MAIN>
   <MAIN text="Family Room" expand="true">
      <SUB text="The Family" URL="http://www.treadwaygallery.com";
target="_blank"></SUB>
      <SUB text="All-time Favorites" URL="http://www.wright20.com";
target="_blank"></SUB>
      <SUB text="2002 Group Reading List" URL="http://www.lamodern.com";
target="_blank"></SUB>
      <SUB text="Current Personal Reads" URL="http://www.ragoarts.com";
target="_blank"></SUB>
   </MAIN>

So, my question is, how do I get the query to populate the xml nodes?

Is it possible to somehow loop throught the query and ouput the
attributes like... (this is conceptual code only)


   <MAIN text="#DD_Header1#" expand="true">
      <SUB text="#DD_SubHeader1#" URL="#DD_SubHeader_URL#"></SUB>
      <SUB text="#DD_SubHeader2#" URL="#DD_SubHeader2_URL#"
target="_blank"></SUB>
</MAIN>

   <MAIN text="#DD_Header2#" expand="true">
      <SUB text="#DD_SubHeader1#" URL="#DD_SubHeader_URL#"></SUB>
      <SUB text="#DD_SubHeader2#" URL="#DD_SubHeader2_URL#"
target="_blank"></SUB>
</MAIN>

Thanks in advance, and sorry if I cause any brain tumors...

Candace K. Cottrell, Web Developer 
The Children's Medical Center 
One Children's Plaza 
Dayton, OH 45404 
937-641-4293 
http://www.childrensdayton.org

 
[EMAIL PROTECTED]

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

                                Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
                                

Reply via email to