You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by Erik van de Pol <Er...@mendix.com> on 2011/12/20 16:31:02 UTC
Excel ooxml: sheet?.xml: s-attribute of a cell-node (c)
Hi list!
We are trying to import ooxml Excel sheets into our custom database.
Where does the s-attribute of a cell-node refer to? Is it a style? If it is, what style does it refer to? According to the ISO-spec it is a unsigned int, which does not help us much.
In particular, 65 seems to be a Date in our case. 80 also, but a different representation.
If there is a comprehensive mapping list somewhere, where can we find it?
Also, an xls file saved as an xlsx file, seems to have a lot more s-attributes. This puzzles us.
We hope you can help.
Greetings,
Erik and Oscar
RE: Excel ooxml: sheet?.xml: s-attribute of a cell-node (c)
Posted by Nick Burch <ni...@alfresco.com>.
On Wed, 21 Dec 2011, Erik van de Pol wrote:
> We need the streaming model because we want to be able to import 1
> million rows with 700 columns.
I'd suggest you use the XSSF event api stuff, it will handle much of the
styles stuff for you:
http://poi.apache.org/spreadsheet/how-to.html#xssf_sax_api
> It works for us now by using the info from BuiltinFormats.java.
That won't work for all cases, if the user defines their own style (or
uses some of the newer "built in" ones) then you'll need to see the styles
table for the details. The event stuff will handle that for you!
Nick
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org
RE: Excel ooxml: sheet?.xml: s-attribute of a cell-node (c)
Posted by Erik van de Pol <Er...@mendix.com>.
Thanks for the info! We figured out that it was indeed a reference to the styles table.
We need the streaming model because we want to be able to import 1 million rows with 700 columns.
It works for us now by using the info from BuiltinFormats.java.
Oscar and Erik
-----Original Message-----
From: Nick Burch [mailto:nick.burch@alfresco.com]
Sent: Wednesday, December 21, 2011 2:11 AM
To: POI Users List
Subject: Re: Excel ooxml: sheet?.xml: s-attribute of a cell-node (c)
On Tue, 20 Dec 2011, Erik van de Pol wrote:
> Where does the s-attribute of a cell-node refer to? Is it a style? If
> it is, what style does it refer to? According to the ISO-spec it is a
> unsigned int, which does not help us much.
It's a cell style, yes.
> If there is a comprehensive mapping list somewhere, where can we find
> it?
It's dynamic based on the file, the style definitions get stored in different streams of the file
If you want a good way to see how the styles and formatting fits together, but while working close to the XML level, then the event based text extractor (XSSFEventBasedExcelExtractor) is probably a good place to look.
That handles parsing a .xlsx file largely via sax, and pulls out the formatting information for cells as it goes so it can format numbers and dates for output
Alternately, just use the XSSF usermodel and it's all handled for you :)
Nick
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org For additional commands, e-mail: user-help@poi.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org
Re: Excel ooxml: sheet?.xml: s-attribute of a cell-node (c)
Posted by Nick Burch <ni...@alfresco.com>.
On Tue, 20 Dec 2011, Erik van de Pol wrote:
> Where does the s-attribute of a cell-node refer to? Is it a style? If it
> is, what style does it refer to? According to the ISO-spec it is a
> unsigned int, which does not help us much.
It's a cell style, yes.
> If there is a comprehensive mapping list somewhere, where can we find
> it?
It's dynamic based on the file, the style definitions get stored in
different streams of the file
If you want a good way to see how the styles and formatting fits together,
but while working close to the XML level, then the event based text
extractor (XSSFEventBasedExcelExtractor) is probably a good place to look.
That handles parsing a .xlsx file largely via sax, and pulls out the
formatting information for cells as it goes so it can format numbers and
dates for output
Alternately, just use the XSSF usermodel and it's all handled for you :)
Nick
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org