1

Topic: How in XSLT correctly to use in XML scheme MS Excel' addressing R1C1?

I do XSL-transformation initial XML for its outswapping in Excel.
I use a standard XML scheme for this purpose:

<xsl:stylesheet version = "1.0" xmlns:xsl = "http://www.w3.org/1999/XSL/Transform"
xmlns:o = "urn:schemas-microsoft-com:office:office"
xmlns:x = "urn:schemas-microsoft-com:office:excel">
...
</xsl:stylesheet>

I cause summation Excel-function in the formula for a cell here thus:

<xsl:stylesheet version = "1.0" xmlns:xsl = "http://www.w3.org/1999/XSL/Transform"
xmlns:o = "urn:schemas-microsoft-com:office:office"
xmlns:x = "urn:schemas-microsoft-com:office:excel">
...
<xsl:template match = "/">
<html xmlns = "http://www.w3.org/TR/REC-html40"
xmlns:o = "urn:schemas-microsoft-com:office:office"
xmlns:x = "urn:schemas-microsoft-com:office:excel">
...
<td class = "xl788" style ='border-left:none ' x:num = "" x:fmla = "">
<xsl:attribute name = "x:fmla"> =SUM (A1:A5) </xsl:attribute>
<! - xsl:attribute name = "x:fmla"> =SUM (R10C5:R <xsl:value-of select = "9+count (ROW)-1"/> C5) </xsl:attribute->
</td>
...
</html>
</xsl:template>
</xsl:stylesheet>

And all perfectly works.
But there was a necessity to use style of addressing of cells not bukveno-digital A1, and numeral R1C1.
I try to change:

<xsl:stylesheet version = "1.0" xmlns:xsl = "http://www.w3.org/1999/XSL/Transform"
xmlns:o = "urn:schemas-microsoft-com:office:office"
xmlns:x = "urn:schemas-microsoft-com:office:excel">
...
<xsl:template match = "/">
<html xmlns = "http://www.w3.org/TR/REC-html40"
xmlns:o = "urn:schemas-microsoft-com:office:office"
xmlns:x = "urn:schemas-microsoft-com:office:excel">
...
<td class = "xl788" style ='border-left:none ' x:num = "" x:fmla = "">
<xsl:attribute name = "x:fmla"> =SUM (R1C1:R5C1) </xsl:attribute>
</td>
...
</html>
</xsl:template>
</xsl:stylesheet>

Does not understand. The ex-fur-tree gives an error.
Then in XSLT I change style of addressing on R1C1 specifying:

...
<x:RefModeR1C1/>
...

And in Excel style of addressing really changes, but all is produced an error - does not understand the formula in format R1C1.
I understand, what the question difficult, but suddenly who faced?

2

Re: How in XSLT correctly to use in XML scheme MS Excel' addressing R1C1?

verter wrote:

I Understand, what the question difficult, but suddenly who faced?

Create sheet with the formula in Eksele, save in XML and look that turned out. Then write corresponding XSL. If there are difficulties then publish a piece target XML here

3

Re: How in XSLT correctly to use in XML scheme MS Excel' addressing R1C1?

Here at you an error that you define attribute twice

verter wrote:

<td class = "xl788" style ='border-left:none ' x:num = "">>> x:fmla <<<= "">
<xsl:attribute name = ">>> x:fmla <<<"> =SUM (R1C1:R5C1) </xsl:attribute>
</td>

4

Re: How in XSLT correctly to use in XML scheme MS Excel' addressing R1C1?

_Vasilisk _;
I, of course, and made - saved in XML sheet of Ekselja with the formula in style R1C1 and with switched on numeral mode R1C1.
But to my astonishment in XML in the formula all there was style A1.

5

Re: How in XSLT correctly to use in XML scheme MS Excel' addressing R1C1?

[quote = _ Vasilisk _] Here at you an error that you define attribute twice
it is passed...

Yes, removed superfluous, but it did not affect result - the Error in the cell formula.