File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes XML and Related Technologies and the fly likes XML files to Excel Files Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "XML files to Excel Files" Watch "XML files to Excel Files" New topic
Author

XML files to Excel Files

Rafael Afonso
Ranch Hand

Joined: Jul 16, 2002
Posts: 63
Hello,
Does Anyone know how to tranform a XML file to a Excel file using XSL transfoms? By the way, a XML file to any Micro$oft Office file (*.doc, *.ppt , etc.). I know that xls files are not a open specification, but PDF files are not too and we have FOP.
Thanks


=================================<br /> Rafael U. C. Afonso<br /> <a href="http://www.javafree.com.br" target="_blank" rel="nofollow">www.javafree.com.br</a><br />=================================<br /><i>Where is debug?<br />debug is on the table</i>
John Coleman
Ranch Hand

Joined: Jul 24, 2001
Posts: 65
The simplest xls file consists of elements deliminated by tab characters organised into rows by terminating with a newline character.
You can create a variable called $newline with a value like this:
<xsl:variable name="newline">
<xsl:text>
</xsl:text>
</xsl:variable>
No doubt you are aware XSLT usually outputs raw text, HTML or XML. However the normal xl formatted file contains all sorts of binary gubbins instead of nice tags that would probably be crazy to create in xslt.
IMO as xl also reads HTML, the nicest thing to do is generate a table in HTML using the usual <table><tr><td> syntax. I know that only goes half way, but it is clean and more "open", and a lot easier to figure out!


John Coleman, MSTA<br />Sun Certified Programmer for the Java� 2 Platform<br />john.coleman@eurobase-international.com<br />Eurobase banking solutions<br /><a href="http://www.eurobase-international.com/banking" target="_blank" rel="nofollow">http://www.eurobase-international.com/banking</a>
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: XML files to Excel Files
 
Similar Threads
where to put SQL queries ?
Merging 2 xml files and want to see the output how can I achieve.
POI HSSF - Excel question
How to extract an xml file after matching content from a zip file using java
Excel File Parser