-
Notifications
You must be signed in to change notification settings - Fork 0
/
punch.xsl
40 lines (37 loc) · 1.57 KB
/
punch.xsl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:cml="http://www.xml-cml.org/schema"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:me="http://www.chem.leeds.ac.uk/mesmer">
<xsl:output method="text"/>
<xsl:template match="/">
<xsl:value-of select="concat(me:mesmer/cml:title,' calculated ',//me:analysis[1]/@calculated,'
')"/>
<xsl:call-template name="header"/>
<xsl:apply-templates select="//me:analysis/me:rateList"/>
</xsl:template>
<xsl:template name="header">
<xsl:for-each select="//me:analysis[1]/me:parameters/@*">
<xsl:value-of select="concat(name(),',')"/>
</xsl:for-each>
<xsl:value-of select="concat('T',',','conc',',')"/>
<xsl:for-each select="//me:analysis[1]/me:rateList[1]/me:firstOrderRate">
<xsl:value-of select="concat(@fromRef,'->',@toRef,',')"/>
</xsl:for-each>
<xsl:for-each select="//me:analysis[1]/me:rateList[1]/me:firstOrderLoss">
<xsl:value-of select="concat('Loss of ',@ref,',')"/>
</xsl:for-each>
<xsl:text>
</xsl:text>
</xsl:template>
<xsl:template match="me:analysis/me:rateList">
<xsl:for-each select="../me:parameters/@*">
<xsl:value-of select="concat(.,',')"/>
</xsl:for-each>
<xsl:value-of select="concat(@T,',',@conc,',')"/>
<xsl:for-each select="me:firstOrderRate">
<xsl:value-of select="concat(.,',')"/>
</xsl:for-each>
<xsl:for-each select="me:firstOrderLoss">
<xsl:value-of select="concat(.,',')"/>
</xsl:for-each>
<xsl:text>
</xsl:text>
</xsl:template>
</xsl:stylesheet>