Subject: Re: [office] Empty Cell by @office:value-type
Hi Svante, you wrote:
Where do you read this in part 2. I see: in 4.7 in part 2: "An empty cell is neither zero nor the empty string" and in 6.13.14: "A cell with the empty string is not considered blank". So that cell is not an empty (or blank) cell, IsBlank() should be FALSE.
What am I missing?
Dear TC members,
just a quick update on the discussions I had with Regina and Andreas.
The most importantÂchapter to understand the semantic of 'empty cell' seems to be the chapter of @office:value-type:http://docs.oasis-open.org/office/v1.2/os/OpenDocument-v1.2-os-part1.html#attribute-office_value-type,Âwhich might be improved in clarity. (Once a mentor of mine said if he has toÂslow down the reading toÂunderstand, the text is not well written).
There are some minor editorial mistakes asÂmissing italic (or character styles for attribute value types)ÂorÂexpressing the OASIS 'shall'ÂorÂmixing the naming of "value-type" and "value type".ÂBut most surprising is that theÂ'void' value is not always an allowed attribute value of @office:value-typeÂ- it only used as part of the form properties:
https://tdf.github.io/odftoolkit/docs/odf1.2/OpenDocument-v1.2-os-schema-rng.html#11038-11158ÂÂBut not for table cells, which only have the common type without 'void'.
(Please note above URLs, I have enabled some fragment identifierÂfor text line spans on the RNG HTML)ÂÂ
Instead of making @office:value-type mandatory and always have a type and some boilerplate, obviously the absence of the attribute was set equal to the attribute value 'void'.Unfortunately,ÂTable 14 - Value attributesÂdoes not make the absence of the 'void' value for cells obvious.
To me, theÂcolumns are not precisely definedÂand theÂmost important two paragraphs are quite separated:Finally,Âthe connection betweenÂisBlank(), type 'void' and the _expression_ 'empty cell' was not explicitly made.We might want to strive for a semantic dictionary similar to the DublinÂcore for the basic semantic of our office file format.Â
In isBlank:Âhttp://docs.oasis-open.org/office/v1.2/os/OpenDocument-v1.2-os-part2.html#ISBLANKÂthe semantics are:"If X is of type Number, Text, or Logical, return FALSE. If X is a reference to a cell, examine the cell; if it is blank (has no value), return TRUE, but if it has a value, return FALSE. A cell with the empty string isÂnotÂconsidered blank."
Unfortunately, Number, Text or Logical are not explicitly mapped to Table 14 of part1.Â
I assume that those three types above are all types of table 14 just without voidÂ(which is not allowed in table cells anyway), right?
Is theÂempty cellÂequal toÂblankÂandÂtype void? I would think so.ÂOr do you see indications against it?
TheÂonly indicator I can see for an empty cell from reading carefully the spec is the missing of @office:value-type within the cell element.Still, it seems problematic that user content is being deleted from a cell during roundtrip instead of adding an extra rule that a cell with content is by default of type string.
This seems so easy now and then I created a simple test document with three cells, which are being tested on blank from its follow (right) cell.
- The first cell is easy a cell with string content and string type. Clearly not empty andÂFALSEÂas the result of isBlank()!
- The second cell has an empty string. String type with empty paragraph. This case is explicitly mentioned in part 2 and the result of isBlank() should beÂTRUE!
- The third cell is a completely empty cell without descendant nodes. It can not be more blank.ÂTRUEÂshould be the result of isBlank()!
- The fourth cell has an empty paragraph but no data type attribute.ÂÂTRUEÂshould be the result of isBlank()!
- The fifth cell has a paragraphÂwith text content but no data type attribute.ÂTRUEÂshould be the result of isBlank()!ÂÂ
- The sixth cell has a paragraphÂwith text content but an invalid data type attribute.ÂTRUEÂshould be the result of isBlank()!
PS: Please note the test document is invalid on purpose.
--------------------------------------------------------------------- To unsubscribe from this mail list, you must leave the OASIS TC that generates this mail. Follow this link to all your TCs in OASIS at: https://www.oasis-open.org/apps/org/workgroup/portal/my_workgroups.php