XMLBuilderDiagram XML Schema Definition

The XML builder works from XML files. The purpose of this topic is to describe how these XML files must be built so that they can be correctly decoded by the XML builder.

About XML and XSD files

Extensible Markup Language (XML) is similar to Hypertext Markup Language (HTML). An HTML file contains both data and information about how it's presented. An XML file contains data only.

XML data is embedded within tags that add meaning. For example, <price>24</price> declares the numeral 24 to be a price. In XML terms, this price is referred to as an element. Other elements might be product names, quantities, or totals. While a person can look at the XML tag and determine that 24 is a price, it's more important that software can extract price elements from the file; this isn't possible with the HTML file.

An XML file is based on an XML Schema Definition (XSD). An XSD file provides the syntax and defines the way in which elements and attributes can be represented in an XML document; it defines a type of XML document in terms of constraints on what elements and attributes may appear and their relationship to each other, what types of data may be in them, and other things.

XMLBuilderDiagram XSD file in details

The XMLBuilderDiagram XML schema definition is the XML schema that provides the syntax for the XML files that can be decoded by the ArcGIS Schematics XML Builder. This XSD file is installed by default in \ArcGIS\Schematics\XMLSchema.

Any XML file that is compatible with the XML Builder starts and ends with the Diagrams tag:

Elements within <Diagrams> tags

<?xml version="1.0" encoding="utf-8"?>
<sch:Diagrams xmlns:sch = 'http://www.esri.com/schemas/ArcGIS/10/Schematics'
              xmlns:xsi = 'http://www.w3.org/2001/XMLSchema-instance'
              xsi:schemaLocation='http://www.esri.com/schemas/ArcGIS/10/Schematics XMLBuilderDiagram.xsd'>
...
 </Diagrams>

Several diagrams can be stored in an XML file; the definition of each starts with the Diagram tag:

Elements within <Diagram> tags

<?xml version="1.0" encoding="utf-8"?>
<sch:Diagrams xmlns:sch = 'http://www.esri.com/schemas/ArcGIS/10/Schematics'
              xmlns:xsi = 'http://www.w3.org/2001/XMLSchema-instance'
              xsi:schemaLocation='http://www.esri.com/schemas/ArcGIS/10/Schematics XMLBuilderDiagram.xsd'>
  <Diagram DiagramTemplateName="All" DiagramName="All" EnforceDiagramTemplateName="false" EnforceDiagramName="false">
   ...
  </Diagram>                
 </Diagrams>

DiagramTemplateName and DiagramName are optional parameters. When the EnforceDiagramTemplateName or EnforceDiagramName parameter are False, the diagram template name and diagram name need to be redefined on the New Schematic Diagram dialog box.

The following sections are then expected for each diagram:

XMLBuilderDiagram data model

The following figure shows the XML Schema Definition of the XMLBuilderDiagram file:

XML Model Part 1

XML Model Part 2

XML file samples based on the XMLBuilderDiagram XSD file

The following figure shows a basic XML file sample that includes a description of one diagram containing a unique node schematic feature:

XML data - Sample FeatureNode extraction

The following figure shows a sample extraction of an XML file that includes a description of one diagram containing a link schematic feature:

XML data - Sample FeatureLink extraction

For a more detailed XML file sample based on the XMLBuilderDiagram XML Schema Description file, open the SampleNetworkData.xml file provided with the Tutorial setup. It should be installed in C:\ArcGIS\ArcTutor\Schematics\Schematics_Configuration\XML_Data.


1/10/2012