AS totalPrice
FROM orderquery
</cfquery>
<cfset discountPrice = priceQuery.totalPrice * (1 - drate/100)>
<!--- Display the full price and discounted price --->
<cfoutput>
<b>Full Price=</b> #priceQuery.totalPrice#<br>
<b>Discount Price=</b> #discountPrice#
</cfoutput>
<br><br>
<!---Generate an XML Receipt --->
<cfxml variable="receiptxml">
<receipt num = "34">
<cfoutput>
<price>#discountPrice#</price>
<cfif drate GT 0 >
<discountRate>#drate#</discountRate>
</cfif>
</cfoutput>
<itemsFilled>
<cfoutput query="orderQuery">
<name>#name# </name>
<qty>
#qty# </qty>
<price> #qty*unitPrice# </price>
</cfoutput>
</itemsFilled>
</receipt>
</cfxml>
<!--- Display the resulting receipt --->
<cfdump var=#receiptxml#>
Example: using XML in a ColdFusion application
695
Need help?
Do you have a question about the COLDFUSION MX 61-DEVELOPING COLDFUSION MX and is the answer not in the manual?
Questions and answers