XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Conferences Close Tree View
+ Stylus Studio Feature Requests (1192)
- Stylus Studio Technical Forum (14621)
-> - Stylus Studio - Registrar en o... (1)
-> + Stylus Studio - Registrar en o... (2)
-> + Can a pipeline send a file by ... (2)
-> + After Updateing WIN10 to WIN11... (12)
-> + Where do I add the custom java... (3)
-> + Where is the Diagram tab? (5)
-> + Applying XSLT to Word DOCX/XML (2)
-> - CSV conversion via ConvertToXM... (1)
-> + Text symbols in SS not same as... (4)
-> + Exposing xquery as webservice ... (6)
-> + Syntax Identifier (2)
-> + Saving a Converted XML as an X... (5)
-> + Output document cannot be pars... (4)
-> - Archiving output from conversi... (1)
-> + EDIFACT guideline from Stylus ... (3)
-> + CSV file putting all the data ... (5)
-> + Can't install Home version 64b... (5)
-> + presale - Can I covers this sc... (5)
-> + Problem with UNB (5)
-> + Splitting EDIFACT files pipeli... (4)
-- [1-20] [21-40] [41-60] Next
+ Website Feedback (249)
+ XSLT Help and Discussion (7625)
+ XQuery Help and Discussion (2017)
+ Stylus Studio FAQs (159)
+ Stylus Studio Code Samples & Utilities (364)
+ Stylus Studio Announcements (113)
Topic  
Postnext
George MurphySubject: Reading XML file with Stylus Studio Professional applying a XSLT style.
Author: George Murphy
Date: 26 Apr 2006 12:05 PM
Hi I am totally new to XSLT. I am an experienced ColdFusion Developer. I am grabbing this RSS rdf file from here via CFHTTP.
http://finance.yahoo.com/rss/MajorAirlines/
I am calling the RSS file dave_blog.rdf

I have designed a stylesheet for it called. Untitled1.xsl

Everything loks great in the WYSIWYG. My question is how do I get this to work in a browser through ColdFusion? Or how do I get it to work in a browser period. Here is my ColdFusion Code.
<cffile action="READ" file="#ExpandPath("dave_blog.rdf")#" variable="variables.xmlData">
<cffile action="READ" file="#ExpandPath("Untitled1.xsl")#" variable="variables.xsltData">

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>XSLT Test</title>
<style type="text/css">
p.article {
font-family: 'verdana';
font-size: 11px;
}
</style>
</head>
<body>
<!--- Output transformed data --->
<cfoutput>#XmlTransform(variables.xmlData, variables.xsltData)#</cfoutput>
</body>
</html>


Unknowndave_blog.rdf
RSS Feed

UnknownUntitled1.xsl

Postnext
Minollo I.Subject: Reading XML file with Stylus Studio Professional applying a XSLT style.
Author: Minollo I.
Date: 26 Apr 2006 12:50 PM
If you want to open the .rdf inside a browser and have the transformation automatically applied, you can add the following XML PI immediately after the <?xml one:

<?xml-stylesheet href="untitled1.xsl" type="text/xsl"?>
(assuming the XSLT is in the same folder)

I have no experience with ColdFusion to answer that part of your question.

Postnext
Ivan PedruzziSubject: Reading XML file with Stylus Studio Professional applying a XSLT style.
Author: Ivan Pedruzzi
Date: 26 Apr 2006 02:12 PM


I didn't try but should it be enough do the following?
Assuming taht the page is executed on the server and #XmlTransform simply run the xslt and return the result

<cffile action="READ" file="#ExpandPath("dave_blog.rdf")#" variable="variables.xmlData">
<cffile action="READ" file="#ExpandPath("Untitled1.xsl")#" variable="variables.xsltData">
<cfoutput>#XmlTransform(variables.xmlData, variables.xsltData)#</cfoutput>

Also you are missing the doctype declaration in your xslt

<xsl:output method="html" doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"/>

Hope this helps
Ivan Pedruzzi
Stylus Studio Team

Posttop
George MurphySubject: Reading XML file with Stylus Studio Professional applying a XSLT style.
Author: George Murphy
Date: 27 Apr 2006 11:03 AM
Thanks for your post. I was able to get this working using the same method that you used however I had to rename the .rdf file to xml and it worked fine. Here is my code.

<!--- This code gets the latest news feed --->
<cfhttp url="http://finance.yahoo.com/rss/MajorAirlines" method="get" timeout="5" path="XXX/XXX/XXX" file="newsfeed.xml" />
<!--- This code reads the latest newsfeed and style sheet and turns them into structures for the XmlTransform function --->
<cffile action="READ" file="#ExpandPath("newsfeed.xml")#" variable="variables.xmlData">
<cffile action="READ" file="#ExpandPath("Untitled1.xsl")#" variable="variables.xsltData">
<!--- Output transformed data --->
<h3>Airline Industry News</h3>
<cfoutput>#XmlTransform(variables.xmlData, variables.xsltData)#</cfoutput>

   
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  
go

Log In Options

Site Map | Privacy Policy | Terms of Use | Trademarks
Stylus Scoop XML Newsletter:
W3C Member
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2016 All Rights Reserved.