| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45
Back To Interview list
Michael Smith: I am talking with April Fleming about her upcoming talk at CFUN- 04 "XSLT for data manipulation". What is XSLT?
April Fleming: XSLT is a way to transform XML without writing traditional code. XSLT stands for XSL Transformations and Extensible Stylesheet Language. And XSL is a language for creating a style sheet for XML (Extensible Markup Language).
You can think of XSL as CSS for XML! XSL specifies the styling of an XML document by using XSLT to describe how the document is transformed into another XML document that uses the formatting vocabulary.
One thing I would like to clarify here, Michael, is that XSLT is considered a language. It has variables, looping, conditional logic and more. That is what makes XSLT so powerful. You use this power to transform the xml data you are working with into what you need it to be. Whereas, CSS provides you a means for "styling" but it limited by the fact that there is no inherent logic, as there is in XSLT.
MS: Wow, what a mouthfull! Why should someone be interested in XSLT?
AF: While many applications provide ways to manipulate XML data, including ColdFusion with the XML tags that come with CFMX, XSLT gives developers the freedom and flexibility to do what they need with this xml structured data without being confined to "tags" or "functions" written by software vendors. If you will be working with XML data at all in the future, and it looks as though you will, XSLT is a great tool to keep in the toolbox and pull out when the whatever else you may be using just won't give you the functionality that you need.
MS: And just to be a pest why is XML important now?
AF: XML has become the standard of choice for exchanging data over the web. Everywhere you look from BLOGS, Web services, Business to Business data transfers, that is just off the top of my head. Now with many database vendors providing XML support to automatically mark up the resident data it is becoming even more widely accepted and easy to use. So with all of these xml "packets" flying around we as application developers must be able to use this data in the many ways required by our customers. At the very least this data must be displayed or stored into databases to be used by existing applications.
MS: Yes XML is a hot topic! So what are some examples of things you can do with XSLT?
AF: Because XSLT is a way of transforming data you can use it to transform your data in a number of ways. XSLT can be used for transforming xml data from one xml schema to another (MathML to ChemML, KmartML to WalmartML), transforming XML data to HTML for direct display of XML data in any format you choose. I did this with a search engine that I wrote which had many different interfaces (a quick search, advanced search, external db search) this same xml data could then be displayed in many different formats no matter where the data originated from. Another use is to transform the XML data into SQL statements if your resident database does not include xml support so that you can insert external data into your own database. There are others, however, these are the ones that I will focus on for CFUN-04.
MS: How long has XSLT been around and where did it come from? Can you show us a snippet of XSLT code too?
AF: The first working draft for XSL was created by the W3C on August 18, 1998. Here is a snippet from that first w3c working draft
<fo:block font-size="10pt" space-before="12pt">
MS: That is cool. I am intrigued to see your session.