[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Producing Excel 2000 htm files: how do I manage the h

Subject: Producing Excel 2000 htm files: how do I manage the hidden stuff
From: cknell@xxxxxxxxxx
Date: Tue, 02 May 2006 12:04:47 -0400
htm files
I have a task to produce files for Excel 2000 from XML documents returned from a database query.

I started by saving a typical Excel file to a .htm file and began modifying it to produce an XSLT stylesheet. For the most part, this has not been a challenge. For the most part. But now comes the PITA (and that's not greek flatbread).

Round one:
Excel codes it's html style element by surrounding the content with comment markers (i.e., &lt;--  --&gt;). So my first thought was to enclose the content of the style element within a <xsl:text disable-output-escaping="yes"> element. But all that produced was an empty set of style tags (<style></style>).

Round two:
I decided to use the shameful <![CDATA[ ]]> markup. Well that produced what I was looking for between the opening and closing <style> tags, and the correct styling appeared in the document when view with MS-Excel.

But wait! There's more! (apologies to all non-U.S. residents who never saw a "Popeil" or "RONCO" ad on television).

Round three:
Just below the <style> section, and still in the <head> section, Excel places an XML document which gives additional information used when the file is viewed by Excel rather than with a browser. When left in the stylesheet "bare", that is to say without remarking it out in some way, the markup appears in the top, left-most cell of the Excel spreadsheet. Since the point of this exercise was to produce an Excel document that would require no further editing, deleting the cell's contents manually is not an option.

Round four:
So I tried to cause a set of HTML/XML comment delimitters to appear around this piece of markup, but to no avail. What worked for the <style> contents (enclosing it in !<[CDATA[ ]]>) caused all the angle brackets in the XML markup to appear as escaped characters.

Round five:
I next tried to place the whole XML document inside an <xsl:text disable-output-escaping="yes"> set of tags, but that caused Saxon's sax parser to object to character markup that was not well-formed.

Round six:
I next tried to enclose only the comment delimitters in <$[cdata[ ]]> elements. See the paragraph immediately above.

I think I've worn him out punching me. I need just one little trick to knock him out, but I'm out of ideas

Thanks for sticking with me so far. Now you know what I've done and a variety of things that don't work. Any suggestions?



-- 
Charles Knell
cknell@xxxxxxxxxx - email

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.