Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

XML files to Excel Files

 
Rafael Afonso
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
John Coleman
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic