Exercise 5: Quick-start guide for configuring the XML builder
Schematic diagrams can be generated from .xml files or .xml streams that follow the XML Schema definition for a Schematic Diagram. This XML Schema, XMLBuilderDiagram.xsd, can be found in the Schematics\XMLSchema folder in your ArcGIS installation directory. The XML Builder is very useful for system integration situations where abstraction is needed between two systems or the data is not in a standard format and requires processing logic to retrieve. The data is simply passed to Schematics following the XML Schema definition, and Schematics is then responsible for storage and display of the diagram. During this exercise, you are going to learn how to create and configure a schematic diagram template to generate diagrams from an XML file that is stored on the local machine. The configuration is going to be done using the SchematicBuilder Samples schematic dataset created during exercise 1.
-
Edit the SchematicBuilderSamples schematic dataset stored in the C:\ArcGIS\ArcTutor\Schematics\TutorialSchematicDB geodatabase by browsing to this database using ArcCatalog, then right-clicking the dataset and choosing the Edit menu option .
Note:
The screen shots in this exercise show configuration parameters created during the previous exercises. Those exercises are not a prerequisite for this exercise. You can follow the steps explained in this exercise without having completed the previous exercises.
Creating a schematic diagram template based on the XML Builder
The first phase consists of creating the schematic diagram template that will be used to generate diagrams from XML files stored on the local machine.
-
Right-click the SchematicBuilderSamples entry in the Dataset Editor tree and click the New Schematic Diagram Template menu item.
A Properties tab for the new schematic diagram template automatically displays on the right side of the Editor Window.
- Type DiagramsFromXMLData in the Name text box.
- Choose XML Builder in the Schematic Builder section.
-
Click OK.
An entry for the DiagramsFromXMLData diagram template now displays in the Dataset Editor tree. Three new tabs (Associations, Layouts, and Rules) display on the right side of the Editor Window.
-
Click the Schematic Builder Properties button on the Properties tab to open the Builder Properties dialog box for the XML builder.
-
Check the Automatic schematic feature class creation check box .
This tells the system to automatically create all the configuration items necessary to display the data that will be found in the XML files.
- Click OK on the Builder Properties dialog box.
-
Check the Automatic schematic feature class creation check box .
- Click Save on the Schematic Dataset Editor toolbar.
- Close the Schematic Dataset Editor.
Generating a schematic diagram from an XML file
In this section, you are going to generate your first schematic diagram based on the newly created DiagramsFromXMLData diagram template.
- Start ArcMap with a blank map document.
- Click the Generate New Schematic Diagram button on the Schematic toolbar to open the New Schematic Diagram dialog box.
-
Click the browse button on the right side of the Schematic Dataset or Folder field to open the Select schematic dataset or schematic folder dialog box.
- Browse to and select the TutorialSchematicDB geodatabase that was created in C:\ArcGIS\ArcTutor\Schematics during exercise 1.
-
Double-click this geodatabase and select the SchematicBuilderSamples schematic dataset.
- Click the Add button.
- Choose DiagramsFromXMLData in the Schematic Diagram Template drop-down list.
-
We need to point to an XML file that has data. Click the ellipses button in the Specify the input XML file section to open the Select XML file dialog box.
- Browse to and select the SampleNetworkData.xml file located in the C:\ArcGIS\ArcTutor\Schematics\Schematics_Configuration\XML_Data folder.
- Click the Add button.
-
Type FirstDiagram_FromXML in the Schematic Diagram Name field.
At the end of this step, the New Schematic Diagram dialog box displays as follows:
-
Click OK.
The generation process starts, and the generated diagram displays in a new data frame, which is automatically added to the map document: