Configuring Responder/Smart Grid
Network Adapter - Create XSL Style Sheet

Version: 10.1

Resource Center Home

In this step, you'll use the worksheet you filled in during the previous step to create an XSL style sheet that converts data exported from your geodatabase into a format that Network Adapter can use to import into DMS. You can copy the XML snippets below and enter data specific to your implementation to create your own XSL style sheet.

Get Started...

Start with the following XML. This information is necessary for your style sheet. No changes are needed.

 

Copy Code
<?xml version="1.0" encoding="utf-8">
 
<xsl:stylesheet version="1.0" xmlns:xsl=http://www.w3.org/1999/XSL/Transform>
 
  <xsl:template match="*|@*|text()">
 
    <xsl:copy>
 
      <xsl:apply-templates select="*|@*|text()"/>
 
    </xsl:copy>
 
  </xsl:template>

 

Map Attributes

Next, you will need to change the names of exported fields to match one of the supported standard data models (Electric Distribution or MultiSpeak). You are essentially renaming these fields using the XSL to ensure Network Adapter recognizes them while importing to DMS. There are two ways to do this. The first option (Option 1) changes the field name in a specific table (or feature/object class). The second option (Option 2), changes a field name across all feature classes. This is handy if the field is named the same across all feature classes (e.g., UnitPhaseDesignation becomes PhaseDesignation).

Below is an example worksheet. Note that it displays columns for both the Electric Distribution and MultiSpeak data models. Refer to the column that corresponds to the standard data model you wish to use.

CircuitSource (Electric Distribution) or Source (MultiSpeak)

Electric Distribution Field Name

MultiSpeak Field Name

Description

Custom Data Model Field Name

ID

FeederID

System-generated identifier of feeder initiated at this source. This may map to a FeederID field.

---

Name

FeederName

Utility name of CircuitSource. This may map to a FeederName field.

---

SubstationID

SubstationName

Substation identifier.

Substation_Name

ConnectionConfiguration

ConnectionConfiguration

 

Code indicating configuration of conductors; domain values may include Delta, Wye, etc.

---

CatalogID

CatalogID

 

This field is not part of the Electric Distribution data model, but it is required by DMS. The CatalogID field is a unique ID used by DMS to identify equipment.

---

PhaseDesignation

PhasingCode

Code indicating phases present; domain values may include A, AB, AC, etc.

UnitPhaseDesignation

--- in sample worksheet above indicate no change in the field name.

 

Electric Distribution Data Model Sample

Option 1:

Copy Code
<!--Enter the name of the table as it appears in your geodatabase (e.g., CircuitSource), then the name of the field (e.g., Substation_Name) as it appears in your geodatabase.-->
<xsl:template match="FEATURE[TABLE='CircuitSource']/FIELDS/FIELD/FIELDNAME[.='SUBSTATION_NAME']">
  <xsl:element name="FIELDNAME">
    <!--Enter the field name as it appears in the standard data model (e.g., SubstationID).-->
    <xsl:text>SUBSTATIONID</xsl:text>
   </xsl:element>
</xsl:template>

 

Option 2:

Copy Code
<!--Enter the name of the field (e.g., UnitPhaseDesignation) as it appears in your geodatabase.-->
<xsl:template match="FIELDNAME[.='UNITPHASEDESIGNATION']">
  <xsl:element name="FIELDNAME">
    <!--Enter the field name as it appears in the standard data model (e.g., PhaseDesignation).-->
    <xsl:text>PHASEDESIGNATION</xsl:text>
  </xsl:element>
</xsl:template>

 

 

MultiSpeak Data Model Sample

Option 1:

Copy Code
<!--Enter the name of the table as it appears in your geodatabase (e.g., Source), then the name of the field (e.g., Substation_Name) as it appears in your geodatabase.-->
<xsl:template match="FEATURE[TABLE='Source']/FIELDS/FIELD/FIELDNAME[.='SUBSTATION_NAME']">
  <xsl:element name="FIELDNAME">
    <!--Enter the field name as it appears in the standard data model (e.g., SubstationName).-->   
    <xsl:text>SUBSTATIONNAME</xsl:text>
  </xsl:element>
</xsl:template>

 

Option 2:

Copy Code
<!--Enter the name of the field (e.g., UnitPhaseDesignation) as it appears in your geodatabase.-->
<xsl:template match="FIELDNAME[.='UNITPHASEDESIGNATION']">
  <xsl:element name="FIELDNAME">
    <!--Enter the field name as it appears in the standard data model (e.g., PhasingCode).-->
    <xsl:text>PHASINGCODE</xsl:text>
  </xsl:element>
</xsl:template>

 

 

Map Table to Table

This section shows you how to map a feature class in your custom data model to a feature or table in one of the supported standard data models (i.e., Electric Distribution or MultiSpeak). Essentially you are telling the XSL to change the name of the feature class as it is exported from your geodatabase (XFR in the example below) to the name of the feature class as it appears in the Electric Distribution or MultiSpeak data model (Transformer and TransformerBank in the examples below).

Using the worksheet from the previous step, identify any feature or object class (table) names that do not match the Electric Distribution or MultiSpeak data models (skip any that have multiple features mapping to a single feature; those are covered in the next section). For each of the table names identified, add the XML described below.

Below is an example worksheet. Note that it displays columns for both the Electric Distribution and MultiSpeak data models. Refer to the column that corresponds to the standard data model you wish to use.

Transformer

Electric Distribution Feature Class Name MultiSpeak Feature Class Name Description Custom Data Model Feature Class Name
Transformer TransformerBank Transformer feature class captures information about distribution and power transformers. Subtypes may include Network, Single Phase Overhead, Single Phase Underground, Two Phase Overhead, Three Phase Overhead, Three Phase Underground, Step, and Power. XFR

 

Electric Distribution Data Model Sample
Copy Code
<!--Enter the name of the class in your geodatabase (e.g., "XFR").-->
<xsl:template match="TABLE[.='XFR']">
  <xsl:element name="TABLE">
    <!--Enter the name of the class (or table) in the standard data model (e.g., "Transformer").-->
    <xsl:text>Transformer</xsl:text>
  </xsl:element>

 

 

MultiSpeak Data Model Sample
Copy Code
<!--Enter the name of the class in your geodatabase (e.g., "XFR").-->
<xsl:template match="TABLE[.='XFR']">
  <xsl:element name="TABLE">
    <!--Enter the name of the class (or table) in the standard data model (e.g., "TransformerBank").-->
    <xsl:text>TransformerBank</xsl:text>
  </xsl:element>

 

The section of XML above changes the table name. This XML is necessary for every table name that must be changed to match the Electric Distribution or MultiSpeak data model.

 

Map Multiple Tables to One Table (Subtypes)

This may occur if your geodatabase models Reclosers, Sectionalizers and CircuitBreakers as individual classes. Whereas the Electric Distribution and MultiSpeak data models model these as subtypes of the Dynamic Protective Device feature class. In this case, Reclosers, Sectionalizers and CircuitBreakers will all map to the DynamicProtectiveDevice class. Another example is OpenPoints. They map to the Switch feature class (as do switches).

In the examples below, Breaker, Sectionalizer and Recloser from the geodatabase all map to DynamicProtectiveDevice (Electric Distribution) or DynamicProtectiveDeviceBank (MultiSpeak). These sections change the name of the Breaker, Sectionalizer and Recloser tables to DynamicProtectiveDevice (or DynamicProtectiveDeviceBank).

Note: All exported fields on all classes (e.g., Breaker, Sectionalizer and Recloser) mapping to a single class (e.g., DynamicProtectiveDevice) MUST be named the same. If they are not, the fields must be renamed to match.

Below is an example worksheet. Note that it displays columns for both the Electric Distribution and MultiSpeak data models. Refer to the column that corresponds to the standard data model you wish to use.

DynamicProtectiveDevice (Electric Distribution) or DynamicProtectiveDeviceBank (MultiSpeak)

Electric Distribution Feature Class Name

MultiSpeak Feature Class Name

Description

Custom Data Model Feature Class Name

DynamicProtectiveDevice

DynamicProtectiveDeviceBank

In addition to opening when a fault is detected, dynamic protective devices also reclose to attempt to reestablish service. If the fault remains after a prescribed number of reclosings, the device may lock open the circuit. Reclosing is designed to reduce or eliminate the effects of temporary faults. Other Dynamic Protective Devices include: Circuit Breaker, Recloser, Sectionalizer, Fault Interrupter.

Breaker, Sectionalizer, Recloser

 

Electric Distribution Data Model Sample
Copy Code
<!--Enter the name of the class in your geodatabase (e.g., Sectionalizer, Breaker, Recloser).-->
<xsl:template match="FEATURE[TABLE='Breaker']">
  <xsl:copy>
    <xsl:apply-templates select="@*"/>    
    <xsl:element name="TABLE">
      <!--Enter the name of the class (or table) in the standard data model to which your class maps (e.g., DynamicProtectiveDevice).-->
      <xsl:text>DynamicProtectiveDevice</xsl:text>
    </xsl:element> 
    <xsl:apply-templates select="NODE"/>
    <xsl:element name="FIELDS">
      <xsl:element name="FIELD">
        <xsl:element name="FIELDNAME">
          <!--Enter the name of the field the standard data model that will be used to identify the subtype (e.g., SubtypeCD).-->
          <xsl:text>SUBTYPECD</xsl:text>
        </xsl:element>
        <xsl:element name="FIELDVALUE">
          <!--Enter the domain value in the above field that maps to the subtype in the standard data model to which the feature maps.
          For example, Breaker maps to subtype value 1 in the SubtypeCD field.-->
          <xsl:text>1</xsl:text>
        </xsl:element>
      </xsl:element>
      <xsl:apply-templates select="FIELDS/*[FIELDNAME != 'SUBTYPECD']"/>
    </xsl:element>
    <!--This next line of XML ensures that any related objects and trace weight information are included in the export. This XML does not need to be edited.-->
    <xsl:apply-templates select="RELATIONSHIP | ELECTRICINFO"/>
  </xsl:copy>
</xsl:template>
 

<!--Repeat the above section for each feature in your geodatabase that should map to a subtype in the same feature class in the standard data model.-->
 

<xsl:template match="FEATURE[TABLE='Sectionalizer']">
  <xsl:copy>
    <xsl:apply-templates select="@*"/>    
    <xsl:element name="TABLE">
      <xsl:text>DynamicProtectiveDevice</xsl:text>
    </xsl:element> 
    <xsl:apply-templates select="NODE"/>
    <xsl:element name="FIELDS">
      <xsl:element name="FIELD">
        <xsl:element name="FIELDNAME">
          <xsl:text>SUBTYPECD</xsl:text>
        </xsl:element>
        <xsl:element name="FIELDVALUE">
          <xsl:text>8</xsl:text>
        </xsl:element>
      </xsl:element>
      <xsl:apply-templates select="FIELDS/*[FIELDNAME != 'SUBTYPECD']"/>
    </xsl:element>
    <xsl:apply-templates select="RELATIONSHIP | ELECTRICINFO"/>
  </xsl:copy>
</xsl:template>
 

<xsl:template match="FEATURE[TABLE='Recloser']">
  <xsl:copy>
    <xsl:apply-templates select="@*"/>    
    <xsl:element name="TABLE">
      <xsl:text>DynamicProtectiveDevice</xsl:text>
    </xsl:element> 
    <xsl:apply-templates select="NODE"/>
    <xsl:element name="FIELDS">
      <xsl:element name="FIELD">
        <xsl:element name="FIELDNAME">
          <xsl:text>SUBTYPECD</xsl:text>
        </xsl:element>
        <xsl:element name="FIELDVALUE">
          <xsl:text>3</xsl:text>
        </xsl:element>
      </xsl:element>
      <xsl:apply-templates select="FIELDS/*[FIELDNAME != 'SUBTYPECD']"/>
    </xsl:element>
    <xsl:apply-templates select="RELATIONSHIP | ELECTRICINFO"/>
  </xsl:copy>
</xsl:template>

 

 

MultiSpeak Data Model Sample
Copy Code
<!--Enter the name of the class in your geodatabase (e.g., Sectionalizer, Breaker, Recloser).-->
<xsl:template match="FEATURE[TABLE='Breaker']">
  <xsl:copy>
    <xsl:apply-templates select="@*"/>    
    <xsl:element name="TABLE">
      <!--Enter the name of the class (or table) in the data model to which your class maps (e.g., DynamicProtectiveDeviceBank).-->
      <xsl:text>DynamicProtectiveDeviceBank</xsl:text>
    </xsl:element> 
    <xsl:apply-templates select="NODE"/>
    <xsl:element name="FIELDS">
      <xsl:element name="FIELD">
        <xsl:element name="FIELDNAME">
          <!--Enter the name of the field the data model that will be used to identify the subtype (e.g., SubtypeCode).-->
          <xsl:text>SUBTYPECODE</xsl:text>
        </xsl:element>
        <xsl:element name="FIELDVALUE">
          <!--Enter the domain value in the above field that maps to the subtype in the data model to which the feature maps.
          For example, Breaker maps to subtype value 1 in the SubtypeCode field.-->
          <xsl:text>1</xsl:text>
        </xsl:element>
      </xsl:element>
      <xsl:apply-templates select="FIELDS/*[FIELDNAME != 'SUBTYPECODE']"/>
    </xsl:element>
    <!--This next line of XML ensures that any related objects and trace weight information are included in the export. This XML does not need to be edited.-->
    <xsl:apply-templates select="RELATIONSHIP | ELECTRICINFO"/>
  </xsl:copy>
</xsl:template>
 

<!--Repeat the above section for each feature in your geodatabase that should map to a subtype in the same feature class in the standard data model.-->
 

<xsl:template match="FEATURE[TABLE='Sectionalizer']">
  <xsl:copy>
    <xsl:apply-templates select="@*"/>    
    <xsl:element name="TABLE">
      <xsl:text>DynamicProtectiveDeviceBank</xsl:text>
    </xsl:element> 
    <xsl:apply-templates select="NODE"/>
    <xsl:element name="FIELDS">
      <xsl:element name="FIELD">
        <xsl:element name="FIELDNAME">
          <xsl:text>SUBTYPECODE</xsl:text>
        </xsl:element>
        <xsl:element name="FIELDVALUE">
          <xsl:text>3</xsl:text>
        </xsl:element>
      </xsl:element>
      <xsl:apply-templates select="FIELDS/*[FIELDNAME != 'SUBTYPECODE']"/>
    </xsl:element>
    <xsl:apply-templates select="RELATIONSHIP | ELECTRICINFO"/>
  </xsl:copy>
</xsl:template>
 

<xsl:template match="FEATURE[TABLE='Recloser']">
  <xsl:copy>
    <xsl:apply-templates select="@*"/>    
    <xsl:element name="TABLE">
      <xsl:text>DynamicProtectiveDeviceBank</xsl:text>
    </xsl:element> 
    <xsl:apply-templates select="NODE"/>
    <xsl:element name="FIELDS">
      <xsl:element name="FIELD">
        <xsl:element name="FIELDNAME">
          <xsl:text>SUBTYPECODE</xsl:text>
        </xsl:element>
        <xsl:element name="FIELDVALUE">
          <xsl:text>2</xsl:text>
        </xsl:element>
      </xsl:element>
      <xsl:apply-templates select="FIELDS/*[FIELDNAME != 'SUBTYPECODE']"/>
    </xsl:element>
    <xsl:apply-templates select="RELATIONSHIP | ELECTRICINFO"/>
  </xsl:copy>
</xsl:template>

 

 

Map Subtypes to Feature Class

This may occur if your geodatabase models multiple Electric Distribution or MultiSpeak data model features as subtypes of a single feature in your custom data model. For example, your geodatabase may have a feature class called PrimaryConductor. Your PrimaryConductor feature class may have two subtypes: Overhead and Underground. These subtypes would map to two classes in the MultiSpeak (PrimaryOHLineSection, PrimaryUGLineSection) or Electric Distribution (PriOHElectricLineSegment, PriUGElectricLineSegment) data models. The sample below uses the Electric Distribution data model.

Below is an example worksheet. Note that it displays columns for both the Electric Distribution and MultiSpeak data models. Refer to the column that corresponds to the standard data model you wish to use.

PriOHElectricLineSegment

Electric Distribution Feature Class Name

MultiSpeak Feature Class Name

Description

Custom Data Model Feature Class Name

PriOHElectricLineSegment

PrimaryOHLineSection

Overhead electric line segments carry electric current and are supported by structures including power poles, H-frames, and towers.

PrimaryConductor (Overhead subtype = 1)

 

PriUGElectricLineSegment

Electric Distribution Feature Class Name

MultiSpeak Feature Class Name

Description

Custom Data Model Feature Class Name

PriUGElectricLineSegment

PrimaryUGLineSection

Primary URD cables are usually single-conductor, concentric-neutral insulated with polyethylene or cross-linked polyethylene. You may find voltage levels (High, Medium, Low) modeled as individual classes in a custom data model.

PrimaryConductor (Underground subtype = 2)

 

Electric Distribution Data Model Sample
Copy Code
<!--First enter the name of the class in your geodatabase (e.g., PrimaryConductor). The FIELDS/FIELD attribute 
holds the name of your field (in the geodatabase) that contains subtype information (e.g., FIELDNAME='SUBTYPECD'). The FIELDVALUE attribute holds the subtype value that corresponds to the subtype (e.g., FIELDVALUE=1).-->
<xsl:template match="FEATURE[TABLE = 'PrimaryConductor' and FIELDS/FIELD[FIELDNAME='SUBTYPECD' and FIELDVALUE = 1&cd;/TABLE">
  <xsl:element name="TABLE">
    <!--Enter the name of the class (or table) in the standard data model to which your subtype maps.-->
    <xsl:text>PriOHElectricLineSegment</xsl:text>
  </xsl:element>
</xsl:template>
 

<!--This section contains the same information as the first section, but for a the underground subtype (e.g., FIELDVALUE=2).-->
<xsl:template match="FEATURE[TABLE = 'PrimaryConductor' and FIELDS/FIELD[FIELDNAME='SUBTYPECD' and FIELDVALUE = 2&cd;/TABLE">
  <xsl:element name="TABLE">
    <xsl:text>PriUGElectricLineSegment</xsl:text>
  </xsl:element>
</xsl:template> 

 

 

MultiSpeak Data Model Sample
Copy Code
<!--First enter the name of the class in your geodatabase (e.g., PrimaryConductor). The FIELDS/FIELD attribute 
holds the name of your field (in the geodatabase) that contains subtype information (e.g., FIELDNAME='SUBTYPECD'). The FIELDVALUE attribute holds the subtype value that corresponds to the subtype (e.g., FIELDVALUE=1).-->
<xsl:template match="FEATURE[TABLE = 'PrimaryConductor' and FIELDS/FIELD[FIELDNAME='SUBTYPECD' and FIELDVALUE = 1&cd;/TABLE">
  <xsl:element name="TABLE">
    <!--Enter the name of the class (or table) in the standard data model to which your subtype maps.-->
    <xsl:text>PrimaryOHLineSEction</xsl:text>
  </xsl:element>
</xsl:template>
 

<!--This section contains the same information as the first section, but for the underground subtype (e.g., FIELDVALUE=2).-->
<xsl:template match="FEATURE[TABLE = 'PrimaryConductor' and FIELDS/FIELD[FIELDNAME='SUBTYPECD' and FIELDVALUE = 2&cd;/TABLE">
  <xsl:element name="TABLE">
    <xsl:text>PrimaryUGLineSEction</xsl:text>
  </xsl:element>
</xsl:template> 

 

 

And Finally...

End your style sheet with the following XML. No changes are needed.

Copy Code
</xsl:stylesheet>

Save the file with an .xsl extension (remember the name you give it; you'll need that information for configuration), and save it in the Program Files (x86)\ArcFM Solution\Bin\Style Sheets\ directory.

 

Configure It

You will need to modify the NetworkAdapter.exe.config file to use the XSL style sheet you just created. To do this, you'll add a pipeline rule to the configuration file. Follow the steps below.

  1. Browse to NetworkAdapter.exe.config and open the file. By default, this file is installed here: Program Files (x86)\ArcFM Solution\Bin.
  2. Look for the "remove namespace" rule in the <PipelineRules> section. After the "remove namespace" rule, add the following XML. You can copy the "remove namespace" rule and modify it or copy the XML below. Regardless, it must come after the "remove namespace" rule.

 

Copy Code
    <add name="RuleName"
      XslFileName="YourCustomXSL.xsl" 
      SaveToFile="true" 
      OutputFileName="YourOutputFile.xml" 
      ChildName="remove namespace" 
      type="Miner.Geodatabase.Integration.XslTransform`1[[Miner.Geodatabase.Integration.ElectricExportScope, 
        Miner.Geodatabase, Version=9.2.0.0, Culture=neutral, PublicKeyToken=196beceb052ed5dc&cd;, 
        Miner.Geodatabase, Version=9.2.0.0, Culture=neutral, PublicKeyToken=196beceb052ed5dc" />

 

Add name: Enter a name for your rule. This can be any name you choose.

XslFileName: Enter the name of the custom XSL file you just created.

OutputFileName: Enter a name for your output file. This can be any name. This XML file is output to C:\Documents and Settings\[login username]\Application Data\Miner and Miner\Network Adapter.

ChildName: Enter the name of the pipeline rule that comes before this one. This value must be "remove namespace".

  1. Next, you will need to change the ChildName value on the rule below the one you just added. This rule is probably "multispeak transformation". Select the ChildName field on this rule and enter the name of the rule you just created (Line 1 in the XML sample in step 2).
  2. Save and close NetworkAdapter.exe.config.

 


Send Comment to documentation@schneider-electric.com