• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Issue with XML & XSL...

New Here ,
Feb 16, 2007 Feb 16, 2007

Copy link to clipboard

Copied

Hi All,
I am trying to display a saved XML file with a pre-defined XSL, which was provided to us by a third party vendor. The XML file is the same format the third party vendor expects it to be:
This is the code I am using to display the XML file in HTML friendly way..

<cffile action="read" file="#Request.ReportPath#/Report.xsl" variable="ReportXsl">
<cfset xmldoc = XmlParse("E:\Inetpub\EMPProjDEV\Reports\Report_2003.xml")>

<cfoutput>#XmlTransform(xmldoc,ReportXsl)#</cfoutput>

But the display page comes up empty. No error either. Am I missing something??
TOPICS
Advanced techniques

Views

375

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advisor ,
Feb 16, 2007 Feb 16, 2007

Copy link to clipboard

Copied

"View source" on your displayed page.

That should point you in the right direction.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 17, 2007 Feb 17, 2007

Copy link to clipboard

Copied

<cfscript>
writeoutput(htmleditformat(XmlTransform(xmldoc,ReportXsl)));
</cfscript>

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 17, 2007 Feb 17, 2007

Copy link to clipboard

Copied

Oh, and, an explanation. Writeoutput and cfoutput are designed to ignore tags that occur in text. See it for yourself.

<cfset testString = "<myXML></myXML>">
<cfset testString2 = "<myXML>myXMLText</myXML>">
testString: <cfscript>writeoutput(testString);</cfscript><br>
testString2: <cfoutput>#testString2#</cfoutput>

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 19, 2007 Feb 19, 2007

Copy link to clipboard

Copied

Hi,
This is what i Get if i use the cfscript and writeoutput to do the xml transformation ..

<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" " http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <META http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>Report</title> </head> <body></body> </html>

The XSL styles inside the body tag are not getting processed. Can someone shed any light on this? I have never worked with XSL's before.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 19, 2007 Feb 19, 2007

Copy link to clipboard

Copied

LATEST
One can't say much without the xmlDoc and the xsl file

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation