Scott How about....
<cfhttp url="http://aaronkarp.com/prettyXML/" method="POST"> <cfhttpparam name="xml" type="FORMFIELD" value="<root><something><somethingelse>Hello</somethingelse></something></ro ot>" /> </cfhttp> <cfset formattedXML = REMatch("<pre>[^<]*</pre>", CFHTTP.FileContent) /> <cfoutput>#formattedXML[1]#</cfoutput> Steve -----Original Message----- From: Scott Thornton [mailto:scott.thorn...@hnehealth.nsw.gov.au] Sent: Monday, 7 June 2010 2:54 PM To: cfaussie@googlegroups.com Subject: Re: [cfaussie] Display XML on webpage Hi, I have now. it will also need special formatting to make it more readable. >>> Blair McKenzie <shi...@gmail.com> 07/06/2010 2:50 pm >>> Have you tried the htmleditformat function? On Mon, Jun 7, 2010 at 2:44 PM, Scott Thornton < scott.thorn...@hnehealth.nsw.gov.au> wrote: > Hi, > > interestingly it kinda of works, at least IE display the xml now. > > Originally, i replaced all of the > with ">" etc in the query thinking > that thwy would be a problem... > > Ill also try the formatter posted > http://alexgorbatchev.com/wiki/SyntaxHighlighter > > > > >>> On 07/06/2010 at 2:37 pm, in message < > 4c0c7794.1070...@ampersand.net.au>, "m...@ampersand.net.au" < > m...@ampersand.net.au> wrote: > How about #replace(query.xml,"<","<","all")# > > Dodgy I know but does it work? > > > On 7/06/2010 2:29 PM, Scott Thornton wrote: > > Thanks, however: > <cfcontent variable="#query.xml#"> > returns: > > Attribute validation error for tag cfcontent. > java.lang.String is not a supported variable type. The variable is expected > to contain binary data. > > > > > > > > > Andrew Scott <andr...@andyscott.id.au> ( mailto:andr...@andyscott.id.au ) > 07/06/2010 2:22 pm >>> Try using the cfcontent. > > > On Mon, Jun 7, 2010 at 2:18 PM, Scott Thornton < > scott.thorn...@hnehealth.nsw.gov.au> wrote: > > > > Hi, > > I was hoping to achieve something rather simple ( I thought), which was to > display on a webpage the xml stored from within a database, in hopefully a > formatted manner. > > The XML is stored unformatted within a database text field. > > When I save the following XML a text document with an .xml extension, > Internet explorer formats it and displays it okay, but a simple output of > the database field eg: > <cfquery>select ....</cfquery><cfoutput>#query.xml#</cfoutput> > Internet explorer displays an error, > > The XML page cannot be displayed > Cannot view XML input using XSL style sheet. Please correct the error and > then click the Refresh button, or try again later. > > Firefox displays it as one long string. > > Wrapping the cfoutput in <CODE></CODE> doesn't help. > > Putting the cfoutput with a CFtextarea helps, but then I need to format it > ( indent it to make it more readable ) > > I guess one potential problem is that the xml string contains another XML > string ( partData ) > <?xml version="1.0" encoding="UTF-8" standalone="yes"?> > <ns1:transmissionMessage transmissionGmt="20100517153248" > transmissionId="WEB20117091e4bf161a06700" from="WEB20117" mode="FIXME" > contentsSigned="false" > contentsType="MCA/OlcHospital/inhospitalclaimreques...@1" xmlns:ns1=" > http://hic.gov.au/hiconline/protocol/model" ( > http://hic.gov.au/hiconline/protocol/model )> <adaptor minorVersion="28" > majorVersion="6.10" vendor="HIC" > platform="os: Windows 2003 x86 5.2 jre: Sun 1.5.0_05" product="HicOnline"> > </adaptor> <logic minorVersion="56" majorVersion="1" vendor="MCA" > platform="os: > Windows 2003 x86 5.2 jre: Sun 1.5.0_05" product="OlcHospital"> </logic> > <originator minorVersion="1" majorVersion="2.610" vendor="NOT SPECIFIED" > platform="os: Windows 2003 x86 5.2 jre: Sun 1.5.0_05" product="Platypus2"> > </originator> <pki minorVersion="0" majorVersion="2.3.3" vendor="HIC" > platform="os: > Windows 2003 x86 5.2 jre: Sun 1.5.0_05" product="eSignature"> </pki> > <content transactionId="WEB11111111222222" sendCount="1" requestId="1" > role="" dataRef="1" type="MCA/OlcHospital/inhospitalclaimreques...@1" > signed="false"> </content> <partData> <?xml version="1.0" > encoding="UTF-8" standalone="yes"?> <ns1:inHospitalClaimRequest > xmlns:ns1=" > http://hic.gov.au/hiconline/eclipse/version-1" ( > http://hic.gov.au/hiconline/eclipse/version-1 )> <claim > messagePartId="CID"> <claimTypeCde>PU</claimTypeCde> > <facilityId>0012790J</facilityId> <fundBrandId>ABC</fundBrandId> > <accountReferenceId>A1234567</accountReferenceId> > <senderContact> <name>abc 123</name> > <phone>0249853321</phone> <email> > emailaddr...@hnehealth.nsw.gov.au</email> </senderContact> > <contiguousClaimCde>N</contiguousClaimCde> > <urgencyCode>9</urgencyCode> > <compensationClaimCde>N</compensationClaimCde> > <totalHospitalChargeAmount>58800</totalHospitalChargeAmount> > <totalChargeAmount>58800</totalChargeAmount> > <facilityTypeCode>1</facilityTypeCode> <patient > messagePartId="PAT"> <patient gender="2" > dateOfBirth="1939-01-16+10:00"> <identity > firstName="firstName" lastName="lastName"/> > <residentialAddress postcode="2287"/> <medicare > memberRefNum="1" memberNum="1234567707"/> <healthFund > memberNum="1234567"/> </patient> > <medicalRecordId>97654321</medicalRecordId> </patient> > <episode messagePartId="EPD"> > <admissionDate>2010-05-03+10:00</admissionDate> > <admissionTime>09:24:00+10:00</admissionTime> > <dischargeDate>2010-05-05+10:00</dischargeDate> > <dischargeTime>15:35:00+10:00</dischargeTime> > <episodeId>2116524</episodeId> > <patientClassificationCode>OT</patientClassificationCode> > <episodeTypeCode>10</episodeTypeCode> > <accommodationStatusCode>A</accommodationStatusCode> > <sameDayCode>2</sameDayCode> <lengthOfStay>3</lengthOfStay> > <dischargeTypeCode>09</dischargeTypeCode> > <referralSourceCode>4</referralSourceCode> > <admissionCategoryCode>1</admissionCategoryCode> </episode> > <accommodationSummary messagePartId="ACS"> > <fromDate>2010-05-03+10:00</fromDate> > <toDate>2010-05-05+10:00</toDate> <numberOfDays>2</numberOfDays> > <leaveDays>0</leaveDays> > <accommodationDays>2</accommodationDays> > <totalChargeAmount>58800</totalChargeAmount> > <chargeRaisedCde>C</chargeRaisedCde> <accommodation > messagePartId="ACD00001"> > <fromDate>2010-05-03+10:00</fromDate> > <toDate>2010-05-05+10:00</toDate> > <numberOfDays>2</numberOfDays> > <chargeAmount>58800</chargeAmount> > <chargeRaisedCde>C</chargeRaisedCde> <dayRate>29400</dayRate> > <patientClassificationCode>OT</patientClassificationCode> > <bedLevelCode>S</bedLevelCode> > <bedLevelAddOnInd>false</bedLevelAddOnInd> </accommodation> > </accommodationSummary> <principalService > messagePartId="PSG00001"> > <serviceDate>2010-05-03+10:00</serviceDate> > <serviceTime>09:24:00+10:00</serviceTime> <serviceCode > typeCode="C">56507</serviceCode> <chargeAmount>0</chargeAmount> > <chargeRaisedCde>I</chargeRaisedCde> > <theatreBandCode>0</theatreBandCode> > <theatreBandTypeCode>N</theatreBandTypeCode> > <theatreCategoryCode>S</theatreCategoryCode> > <anaestheticTypeCode>N</anaestheticTypeCode> > <totalChargeAmount>0</totalChargeAmount> > <theatreMinutes>0</theatreMinutes> </principalService> > <drgMorbidity messagePartId="DMG"> <principalDiagnosis> > <text>C782</text> </principalDiagnosis> > <additionalDiagnosis> <text>C80</text> > </additionalDiagnosis> <procedures> > <text>5650700</text> </procedures> <procedures> > <text>9555000</text> </procedures> > <procedures> <text>9555003</text> </procedures> > <ventilationHours>0</ventilationHours> </drgMorbidity> > </claim> </ns1:inHospitalClaimRequest> </partData> > </ns1:transmissionMessage> > > Can anyone offer a simple solution? > > The website http://aaronkarp.com/prettyXML/ formats the long string okay, > which makes me think there might be some kind of webservice available to do > this? > > PS: A software product external to CF creates the XML and stores it in our > database. I have no control over this software and can't modify the XML > directly... > > Thanks, > > > > > > -- > You received this message because you are subscribed to the Google Groups > "cfaussie" group. > To post to this group, send email to cfaus...@googlegroups.com. > To unsubscribe from this group, send email > tocfaussie+unsubscr...@googlegroups.com<tocfaussie%2bunsubscr...@googlegroup s.com> > <cfaussie%2bunsubscr...@googlegroups.com<cfaussie%252bunsubscr...@googlegrou ps.com>> > ( mailto:cfaussie%2bunsubscr...@googlegroups.com<cfaussie%252bunsubscr...@goog legroups.com>). > For more options, visit this group athttp:// > groups.google.com/group/cfaussie?hl=en. > > > > > -- > You received this message because you are subscribed to the Google Groups > "cfaussie" group. > To post to this group, send email to cfaus...@googlegroups.com. > To unsubscribe from this group, send email to > cfaussie+unsubscr...@googlegroups.com<cfaussie%2bunsubscr...@googlegroups.co m> > . > For more options, visit this group at > http://groups.google.com/group/cfaussie?hl=en. > > -- > You received this message because you are subscribed to the Google Groups > "cfaussie" group. > To post to this group, send email to cfaus...@googlegroups.com. > To unsubscribe from this group, send email to > cfaussie+unsubscr...@googlegroups.com<cfaussie%2bunsubscr...@googlegroups.co m> > . > For more options, visit this group at > http://groups.google.com/group/cfaussie?hl=en. > > -- You received this message because you are subscribed to the Google Groups "cfaussie" group. To post to this group, send email to cfaus...@googlegroups.com. To unsubscribe from this group, send email to cfaussie+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/cfaussie?hl=en. -- You received this message because you are subscribed to the Google Groups "cfaussie" group. To post to this group, send email to cfaus...@googlegroups.com. To unsubscribe from this group, send email to cfaussie+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/cfaussie?hl=en. -- You received this message because you are subscribed to the Google Groups "cfaussie" group. To post to this group, send email to cfaus...@googlegroups.com. To unsubscribe from this group, send email to cfaussie+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/cfaussie?hl=en.