sum function and formatting
Here should go questions about transforming XML with XSLT and FOP.
-
- Posts: 5
- Joined: Thu May 12, 2005 4:31 pm
sum function and formatting
Hi there,
I am trying to sum some coordinates, afterwards I want to format them and display the issue.
I tried the following but it didn't work out.
The source looks like this:
On the display it says that it is not a number, so I used "number" to convert it but it didn't work as well.
Maybe somebody could give me a tip..
cheers
andy
I am trying to sum some coordinates, afterwards I want to format them and display the issue.
I tried the following but it didn't work out.
Code: Select all
<xsl:template name="x">
<xsl:variable name="x_sum" select="sum(xplan:position/gml:Polygon/gml:exterior/gml:LinearRing/gml:pos[substring-before(.,' ')])"/>
<xsl:variable name="x_count" select="count(xplan:position/gml:Polygon/gml:exterior/gml:LinearRing/gml:pos)"/>
<xsl:variable name="x_format" select="format-number($x_sum, '#')"/>"
<xsl:variable name="x_rw" select="3400000"/>
<xsl:variable name="x_ges" select="$x_rw*$x_count"/>
<xsl:variable name="x_ges1" select="$x_format - $x_ges"/>
<xsl:variable name="x_ges2" select="$x_ges1 div $x_count"/>
<xsl:value-of select="$x_sum"/>
</xsl:template>
Code: Select all
(...)
<gml:pos>3480252.383 5889479.27</gml:pos>
<gml:pos>3480289.585 5889464.571</gml:pos>
(...)
Maybe somebody could give me a tip..
cheers
andy
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service