Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XML
|
XML General XML discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XML section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 3rd, 2007, 02:54 PM
Registered User
 
Join Date: Jul 2007
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Problem importing XML data to Excel

 have an application which prepares XML data for import into Excel, using Microsoft's schema for XML-based spreadsheet data:

Code:
<Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet"
xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns:x="urn:schemas-microsoft-com:office:excel"
xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet">
Generally this works just fine. However, when cells contain rather large strings, Excel does not import the cell data correctly. When it is imported into a non-XML Excel workbook, the data is incorrect or truncated, as described below.

The problems occur when cell data exceeds a certain character count: one problem occurs at about 2000 characters, the next problem occurs at about 10,000.

First problem:

I routinely embed string data for a cell within CDATA tags
(
Code:
<![CDATA[
and
Code:
]]>
)
delimiters, and this normally works fine: the embedded strings appear in the XLS cells (and the CDATA delimiters are not shown as part of the actual data). However, when the length of the cell string reaches about 2000 characters, the XLS starts to include the
Code:
<![CDATA[ 
... 
]]>
in the cell, as though its part of the literal data.

In my tests, a cell worked fine at length=1523 but failed at length=2194 (and all lengths larger than that), so the cutoff point is apparently somewhere between those lengths.

Second problem:

The largest cell in my XML file got truncated when displayed as XLS. Its length was 10,767 characters; the first few leading characters were truncated so that its length in the XLS file was 10,733. (In addition, the CDATA was left on, though only the ending delimiter remained -- since the leading characters were stripped off.)

I am using Excel 2002 SP3. I've searched extensively for similar problem reports, but haven't seen any.

 
Old July 3rd, 2007, 03:03 PM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

Your problem appears to be rather specific to Excel, so asking on a general XML forum is a bit of a long shot.

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
 
Old July 3rd, 2007, 03:35 PM
Registered User
 
Join Date: Jul 2007
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Okay, I've posted then to an Excel board.






Similar Threads
Thread Thread Starter Forum Replies Last Post
Importing Excel Data into a new Dataset Juan Patrick Visual Basic 2005 Basics 2 July 4th, 2007 09:03 PM
Problem importing XML data to Excel bluerattle Excel VBA 0 July 3rd, 2007 03:34 PM
problem in importing data from excel to sql hiren1977 General .NET 0 January 2nd, 2007 06:00 AM
Importing data from excel sheet to databaase jvraman SQL Server 2000 3 May 12th, 2006 12:00 AM
Importing from excel with missing data Lizu SQL Server DTS 4 September 21st, 2004 07:02 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.