Itron Commissioning XSL Transformations

The Oracle Utilities Smart Grid Gateway Adapter for Itron OpenWay supports multiple versions of the Itron OpenWay API. To achieve this support, several of the request XSLs check a version number embedded in the source schema. Similarly, the responses XSLs are designed to handle different source XML and map the values to the common SGG format.

The Itron commissioning process uses the following XSL transformations.

D8-CommissionRequest.xsl

<xsl:stylesheet version="1.0" 
        xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
        xmlns:serArr="http://schemas.microsoft.com/2003/10/Serialization/Arrays" 
        xmlns:prov390="http://www.itron.com/ami/2009/08/provisioning" 
        xmlns:prov370="http://www.itron.com/ami/2008/10/provisioning">

    <xsl:output method="xml" encoding="UTF-8" omit-xml-declaration="yes" indent="yes"/>
    
    <xsl:template match="/*">
        <xsl:apply-templates select="./requestEnvelope/AddMeterDefinitions"/>
    </xsl:template>
    
<xsl:template match="AddMeterDefinitions[../itronVersion='3.70']">
        <xsl:apply-templates select="." mode="Itr370"/>
    </xsl:template>
    
    <xsl:template match="AddMeterDefinitions[../itronVersion='3.90']">
        <xsl:apply-templates select="." mode="Itr390"/>
    </xsl:template>

<xsl:template match="*[local-name() != 'string']" mode="Itr370">
        <xsl:element name="{local-name()}" namespace="http://www.itron.com/ami/2008/10/provisioning">
            <xsl:apply-templates select="*|text()" mode="Itr370"/>
        </xsl:element>
    </xsl:template>
    
    <xsl:template match="*[local-name() != 'string']" mode="Itr390">
        <xsl:element name="{local-name()}" namespace="http://www.itron.com/ami/2009/08/provisioning">
            <xsl:apply-templates select="*|text()" mode="Itr390"/>
        </xsl:element>
    </xsl:template>
    
    <xsl:template match="string" mode="Itr390">
        <xsl:element name="string" namespace="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
            <xsl:value-of select="."/>
        </xsl:element>
    </xsl:template>

<xsl:template match="string" mode="Itr370">
        <xsl:element name="string" namespace="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
            <xsl:value-of select="."/>
        </xsl:element>
    </xsl:template>
    
</xsl:stylesheet>

D8-CommissionResponse.xsl

<xsl:stylesheet version="1.0" 
        xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
        xmlns:serArr="http://schemas.microsoft.com/2003/10/Serialization/Arrays" 
        xmlns:prov390="http://www.itron.com/ami/2009/08/provisioning" 
        xmlns:prov370="http://www.itron.com/ami/2008/10/provisioning">

    <xsl:output method="xml" encoding="UTF-8" omit-xml-declaration="yes" indent="yes"/>
    
    <xsl:template match="/*">
        <xsl:apply-templates select="./requestEnvelope/AddMeterDefinitions"/>
    </xsl:template>
    
<xsl:template match="AddMeterDefinitions[../itronVersion='3.70']">
        <xsl:apply-templates select="." mode="Itr370"/>
    </xsl:template>
    
    <xsl:template match="AddMeterDefinitions[../itronVersion='3.90']">
        <xsl:apply-templates select="." mode="Itr390"/>
    </xsl:template>

<xsl:template match="*[local-name() != 'string']" mode="Itr370">
        <xsl:element name="{local-name()}" namespace="http://www.itron.com/ami/2008/10/provisioning">
            <xsl:apply-templates select="*|text()" mode="Itr370"/>
        </xsl:element>
    </xsl:template>
    
    <xsl:template match="*[local-name() != 'string']" mode="Itr390">
        <xsl:element name="{local-name()}" namespace="http://www.itron.com/ami/2009/08/provisioning">
            <xsl:apply-templates select="*|text()" mode="Itr390"/>
        </xsl:element>
    </xsl:template>
    
    <xsl:template match="string" mode="Itr390">
        <xsl:element name="string" namespace="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
            <xsl:value-of select="."/>
        </xsl:element>
    </xsl:template>

<xsl:template match="string" mode="Itr370">
        <xsl:element name="string" namespace="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
            <xsl:value-of select="."/>
        </xsl:element>
    </xsl:template>
    
</xsl:stylesheet>