|
Summary
This example shows a simple example of how to output your XML into a text using XSL, by comma separating the output.
The most common use for XML transformation is to convert XML into HTML file. The other 2 common uses are to convert XML into another format of XML file or into an text file.
I just finished up one E-biz project, which has to send a message to customer by Email. Some custoemr prefer the HTML format mail, and others like text format one better.So I had to use 2 XSL file to transfer the same XML data to different customers.
Here is one simple example that convert XML data to text file:
First specify output method: <xsl:output method=text/>, then seperate the item by limitator, such as ,, ; or . . Here I seperate them by comma, and at the end I use period instead. I also use <xsl:sort select=. order=descending/> to sort the items.
In order to view the text file in the browser, you have to view the source inside the browser.
See the XML & XSL file, and the following the results:
Comma separated and sorted list--All the books on my desk are: XML Database, XML and VB 6.0, XML and SOAP Programming, XML, Oracle 8 Reference, Oracle 8 PL/SQL Programming, Javascript Reference, HTML 4, Dynamic HTML Reference, Database Access with Visual Basic 6, Active Server Page 3.0.
|