comparison gpf/util/sape/xslt/primID.xsl @ 0:509db1a7b7b8

initial import: leo2moko-r1
author Space Falcon <falcon@ivan.Harhan.ORG>
date Mon, 01 Jun 2015 03:24:05 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:509db1a7b7b8
1 <?xml version="1.0" encoding="UTF-8"?>
2 <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ext-pack="xalan://com.ti.xslt.extension" extension-element-prefixes="ext-pack">
3 <xsl:output method="text"/>
4 <!--PrimID template: This template will be used to assemble the hexadecimal value of the primitive identifier out of Number and Direction of the PrimID element and SAPid of the PrimitivesSection element. The values will be passed to an external java class, which performs the calculation for 16 bit and 32 bit primitive identifier types.-->
5 <xsl:template match="PrimID">
6 <xsl:param name="memHandle" select="false()"/>
7 <xsl:variable name="primDir">
8 <xsl:choose>
9 <xsl:when test='./@Direction="UPLINK"'>
10 <xsl:text>0</xsl:text>
11 </xsl:when>
12 <xsl:when test='./@Direction="DOWNLINK"'>
13 <xsl:text>1</xsl:text>
14 </xsl:when>
15 <xsl:otherwise>
16 <xsl:message terminate="yes">
17 <xsl:call-template name="cmdLineMsg">
18 <xsl:with-param name="msgType" select="error"/>
19 <xsl:with-param name="msg">
20 <xsl:text>PrimID@Direction is neither UPLINK nor DOWNLINK</xsl:text>
21 </xsl:with-param>
22 </xsl:call-template>
23 </xsl:message>
24 </xsl:otherwise>
25 </xsl:choose>
26 </xsl:variable>
27 <xsl:choose>
28 <xsl:when test='/SAP/PrimitivesSection[@PrimIDType="BIT32"]'>
29 <!-- Use customized java class of extension packet to get hexadecimal primitive identifier. -->
30 <xsl:value-of select="ext-pack:PrimIdentifier.get32BitPrimId(./@Number, $primDir, /SAP/PrimitivesSection/@SAPid, $memHandle )"/>
31 </xsl:when>
32 <xsl:when test='/SAP/PrimitivesSection[@PrimIDType="BIT32_VIRTUAL"]'>
33 <!-- Use customized java class of extension packet to get hexadecimal primitive identifier for internal purposes. -->
34 <xsl:value-of select="ext-pack:PrimIdentifier.get32BitPrimId(./@Number, $primDir, /SAP/PrimitivesSection/@SAPid, $memHandle, true() )"/>
35 </xsl:when>
36 <xsl:when test='/SAP/PrimitivesSection[@PrimIDType="BIT16"]'>
37 <!-- Use customized java class of extension packet to get hexadecimal primitive identifier. -->
38 <xsl:value-of select="ext-pack:PrimIdentifier.get16BitPrimId(./@Number, $primDir, /SAP/PrimitivesSection/@SAPid )"/>
39 </xsl:when>
40 <xsl:otherwise>
41 <xsl:message terminate="yes">
42 <xsl:call-template name="cmdLineMsg">
43 <xsl:with-param name="msgType" select="error"/>
44 <xsl:with-param name="msg">
45 <xsl:text>PrimitivesSection.@PrimIDType is neither BIT32 nor BIT16</xsl:text>
46 </xsl:with-param>
47 </xsl:call-template>
48 </xsl:message>
49 </xsl:otherwise>
50 </xsl:choose>
51 </xsl:template>
52 </xsl:stylesheet>