XML Create and Export
Hello,
I am trying to create a XML document in coldfusion using the below method.
<cfoutput>
<cfxml variable="MyXMLDoc">
<?xml version='1.0' encoding='utf-8' ?>
<root>
<cfloop query = "student">
<Student ID> #S_ID# </Student ID>
<Student Name> #S_Name# </Student Name>
</cfloop>
</root>
</cfxml>
</cfoutput>
The problem I am encountering is with the XML Tag <Student ID>, ID is considered as an attribute of Student and it expects a value to be associated with ID attribute. How to address this problem?
Also, How do I export the XML document? I am able to dump the contents on the screen but if I want to export as I do for an excel doc as below
<cfcontent type="application/vnd.ms-excel">
How do I do it?
Thanks
Nikhil
