Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


[xsl] Producing Excel 2000 htm files: how do I manage the hidden stuff

From: cknell@----------
To:
Date: 5/2/2006 4:05:00 PM
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


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent