Table of Contents
Available invocation parameter
Filename: Crane-ods.xsl
$Id: Crane-ods.xsl,v 1.7 2008/03/06 20:09:56 G. Ken Holman Exp $
This provides XSLT 2.0 access to an ODS spreadsheet table. The table is expected in an ODS XML instance, not a raw ODS ZIP package. The "content.xml" component of the ODS file ZIP package is the XML instance.
Crane-ods-document select="/" as="document-node()" (xsl:param)
The default document that contains the ODS XML.
This can be overridden with an explicit document node to an ODS document.
When this library is being indirectly included into a stylesheet, but the library isn't needed in any way, this parameter needs to be overridden so that it doesn't try to validate the source doucment as being an ODS file. The following variable declaration in an importing stylesheet will override the use of any file for this library:
<xsl:variable name="Crane-ods-document" select="/.." as="node()?"/>
cs:get-table(0) as="element(table:table)" (xsl:function)
Having this avoids having to know about default table global variable.
cs:column-number(1) as="xsd:double+" (xsl:function)
Return the column number of the given node provided it is a table cell.
Parameter cell as="element(table:table-cell)"
The cell being examined.
cs:get-rows(1) as="element(table:table-row)*" (xsl:function)
Obtain the set of table rows for the given table
Note there is no distinction between rows in the header and rows in the table itself.
Parameter table as="element(table:table)?"
The table to access.
cs:get-cell(3) as="xsd:string" (xsl:function)
This returns the value of an addressed cell using three arguments: the table, the decimal row number and the decimal column number.
Table cells are counted incorporating the number of columns spanned in previous columns
Parameter table as="element(table:table)?"
The table to access.
Parameter col as="xsd:double"
Numeric column to access.
Parameter row as="xsd:double"
Numeric row to access.
cs:get-cell(2) as="xsd:string" (xsl:function)
This returns the value of an addressed cell using two arguments.
There are two ways to use this function, based on the type of the arguments
Parameter ref as="element()?"
When this is the empty sequence (implying the default table) or is a table:table then the second argument is expected to be the alphanumeric address of the cell to access encoded as {A-Z}{n}, e.g. B3.
When this is table:table-row then the second argument is expected to be a decimal column number.
Other types of the first argument flag errors.
Parameter col-row as="xsd:anyAtomicType?"
See the definition of $ref for the two possible values for this parameter.
Note the implementation limitation at this time for alphanumeric cell addresses: there can only be a single letter in the column specification, multiple letters are not supported at this time.
csint:table-check as="element(table:table)?" (xsl:variable)
An internal-use-only variable that gracefully reports an unexpected document. This expects lazy evaluation, so that if the variable is not accessed, then it is not evaluated. A processor that does not do lazy evaluation may incorrectly report an error when the user never means to use this variable.