File: apns-conf.xsl

package info (click to toggle)
mobile-broadband-provider-info 20190618-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 464 kB
  • sloc: xml: 13,653; makefile: 14; sh: 14
file content (114 lines) | stat: -rw-r--r-- 4,416 bytes parent folder | download
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
<?xml version="1.0" encoding="utf-8"?>

<!-- THIS WORK IS IN PUBLIC DOMAIN:
The person or persons who have associated work with this document
(the "Dedicator" or "Certifier") hereby either (a) certifies that, to the best
of his knowledge, the work of authorship identified is in the public domain of
the country from which the work is published, or (b) hereby dedicates whatever
copyright the dedicators holds in the work of authorship identified below
(the "Work") to the public domain. A certifier, moreover, dedicates any
copyright interest he may have in the associated work, and for these purposes,
is described as a "dedicator" below.

A certifier has taken reasonable steps to verify the copyright status of this
work. Certifier recognizes that his good faith efforts may not shield him from
liability if in fact the work certified is not in the public domain.

Dedicator makes this dedication for the benefit of the public at large and to
the detriment of the Dedicator's heirs and successors. Dedicator intends this
dedication to be an overt act of relinquishment in perpetuity of all present
and future rights under copyright law, whether vested or contingent, in the
Work. Dedicator understands that such relinquishment of all rights includes the
relinquishment of all rights to enforce (by lawsuit or otherwise) those
copyrights in the Work.

Dedicator recognizes that, once placed in the public domain, the Work may be
freely reproduced, distributed, transmitted, used, modified, built upon, or
otherwise exploited by anyone for any purpose, commercial or non-commercial,
and in any way, including by methods that have not yet been invented or
conceived.
-->

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:template match="/">

    <xsl:comment> Automatically generated from serviceproviders.xml </xsl:comment>
    <xsl:for-each select="comment()">
      <xsl:copy/>
    </xsl:for-each>

    <apns version="8">
      <xsl:text>&#xa;</xsl:text>
      <xsl:for-each select="serviceproviders/country/provider/gsm/apn">
        <xsl:text>&#x9;</xsl:text>
        <apn>

          <xsl:attribute name="carrier">
            <xsl:choose>
              <xsl:when test="name">
                <xsl:value-of select="name" />
              </xsl:when>
              <xsl:otherwise>
                <xsl:value-of select="../../name" />
              </xsl:otherwise>
            </xsl:choose>
          </xsl:attribute>

          <xsl:attribute name="mcc">
            <xsl:value-of select="../network-id/@mcc" />
          </xsl:attribute>

          <xsl:attribute name="mnc">
            <xsl:value-of select="../network-id/@mnc" />
          </xsl:attribute>

          <xsl:attribute name="apn">
            <xsl:value-of select="@value" />
          </xsl:attribute>

          <xsl:if test="username">
            <xsl:attribute name="user">
              <xsl:value-of select="username" />
            </xsl:attribute>
          </xsl:if>

          <xsl:if test="password">
            <xsl:attribute name="password">
              <xsl:value-of select="password" />
            </xsl:attribute>
          </xsl:if>

          <xsl:if test="usage/@type = 'mms'">
            <xsl:attribute name="mmsc">
              <xsl:value-of select="mmsc" />
            </xsl:attribute>
            <xsl:choose>
              <xsl:when test="contains(mmsproxy,':')">
                <xsl:attribute name="mmsproxy">
                  <xsl:value-of select="substring-before(mmsproxy,':')" />
                </xsl:attribute>
                <xsl:attribute name="mmsport">
                  <xsl:value-of select="substring-after(mmsproxy,':')" />
                </xsl:attribute>
              </xsl:when>
              <xsl:otherwise>
                <xsl:attribute name="mmsproxy">
                  <xsl:value-of select="mmsproxy" />
                </xsl:attribute>
                <xsl:attribute name="mmsport">8080</xsl:attribute>
              </xsl:otherwise>
            </xsl:choose>
          </xsl:if>

          <xsl:attribute name="type">
            <xsl:value-of select="'default'" />
            <xsl:if test="usage/@type = 'internet'">,supl</xsl:if>
            <xsl:if test="usage/@type = 'mms'">,mms</xsl:if>
          </xsl:attribute>
        </apn>
        <xsl:text>&#xa;</xsl:text>
      </xsl:for-each>
    </apns>

  </xsl:template>
</xsl:stylesheet>