device:name-from-imei

Purpose

Returns the Antenna Device Repository device name that is associated with the given IMEI number.

Signature

device:name-from-imei(imei as xs:string) as xs:string?

Parameter

Name Description Type Use
imei

The IMEI number. If the device repository does not contain required IMEI information or the provided IMEI number is invalid, then an empty sequence is returned.

The IMEI number must consist of 15 digits, however only the first 8 digits are used to determine the corresponding device name.

xs:string required 

Example

<html xmlns="http://www.w3.org/2002/06/xhtml2"
  xmlns:sel="http://www.w3.org/2004/06/diselect"
  xmlns:pipeline="http://www.volantis.com/xmlns/marlin-pipeline">
  <head>
    <title>device:name-from-imei</title>
  </head>
  <body>
    <sel:select>
      <!-- true if the device name is Apple-iPhone4-OS-4.0 -->
      <sel:when expr="device:name-from-imei('000000000000000')='Apple-iPhone4-OS-4.0'">
        <p>This is Apple-iPhone4-OS-4.0.</p>
      </sel:when>
      <!-- true if the function returns an empty sequence -->
      <sel:when expr="count(device:name-from-imei('000000000000000'))=0">
        <p>Unknown device.</p>
      </sel:when>
      <sel:otherwise>
        <p>This is <pipeline:value-of expr="device:name-from-imei('000000000000000')"/>.</p>
      </sel:otherwise>
    </sel:select>
  </body>
</html>

Related topics