To date I've only ever used <cfxml> to create fresh whole packets of xml
data and xmlparse to read them, but now I need to take an existing xml
packet (read in via cffile) and add elements to it.
this is for error logging, so the structure I have is:
<incidents>
<error>
<date>{ts '2003-07-16 10:14:40'}</date>
<referer>some_page.cfm</referer>
<diagnostics>You experienced a general lack of CF skills on
some_page.cfm</diagnostics>
</error>
</incidents>
I want to take this packet and add a new error element to it.
so far I have this:
<cfscript>
errorelem = xmlelemnew(errorpacket, "error");
errordate = xmlelemnew(errorelem, "date");
errordate.xmlText = now();
arrayappend(errorelem.xmlchildren, errordate);
errormsg = xmlelemnew(errorelem, "referer");
errormsg.xmltext = error.httpreferer;
arrayappend(errorelem.xmlchildren, errormsg);
errordetail = xmlelemnew(errorelem, "diagnostics");
errordetail.xmltext = error.diagnostics;
arrayappend(errorelem.xmlchildren, errordetail);
arrayappend(errorpacket.xmlroot.xmlchildren, errorelem);
</cfscript>
which gives me a java casting error (why do cfmx errors seem to miss out
line numbers these days?)
can anyone help me with the correct syntax?
much thankings...
-------------------------------------------------------
Rich Wild
Senior Simian
-------------------------------------------------------
e-mango Tel: 01202 755 300
Gild House Fax: 01202 755 301
74 Norwich Avenue West
Bournemouth Mailto:[EMAIL PROTECTED]
BH2 6AW, UK http://www.e-mango.com
-------------------------------------------------------
This message may contain information which is legally
privileged and/or confidential. If you are not the
intended recipient, you are hereby notified that any
unauthorised disclosure, copying, distribution or use
of this information is strictly prohibited. Such
notification notwithstanding, any comments, opinions,
information or conclusions expressed in this message
are those of the originator, not of e-mango.com ltd,
unless otherwise explicitly and independently indicated
by an authorised representative of e-mango.com ltd.
-------------------------------------------------------
--
** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
For human help, e-mail: [EMAIL PROTECTED]