Cisco IOS XR XML API Guide, Release 3.2
Chapter 14 - Cisco XML Schemas
Downloads: This chapterpdf (PDF - 152.0KB) The complete bookPDF (PDF - 2.09MB) | Feedback

Cisco XML Schemas

Table Of Contents

Cisco XML Schemas

XML Schema Retrieval

Common XML Schemas

Component XML Schemas

Schema File Organization

Schema File Upgrades


Cisco XML Schemas


This chapter contains information about common XML schemas. The structure and allowable content of the extensible markup language (XML) request and response instances supported by the Cisco IOS XR XML application programming interface (API) are documented by means of XML schemas (.xsd files).

The XML schemas are documented using the standard World Wide Web Consortium (W3C) XML schema language, which provides a much more powerful and flexible mechanism for describing schemas than can be achieved using Document Type Definitions (DTDs). The set of XML schemas consists of a small set of common high-level schemas and a larger number of component-specific schemas as described in this chapter.

For more information on the W3C XML Schema standard, see http://www.w3.org/XML/Schema

This chapter contains the following sections:

XML Schema Retrieval

Common XML Schemas

Component XML Schemas

XML Schema Retrieval

The XML schemas that belong to the features in a particular package are obtained as a .tar file from cisco.com. To retrieve the XML schemas, you must:

1. To obtain Cisco IOS XR software and version information, use the Cisco IOS XR Software Selector tool, available by selecting Cisco IOS XR Software under Software Tools at the following website:
http://www.cisco.com/public/sw-center/


Note Only customer/partner viewers can access the IOS XR Software Selector page. Guest users will get an error.


2. Select the platform from the Select Platform column.

3. Select the XML schema for your platform.

Once untarred, all the XML schema files appear as a flat directory of .xsd files and can be opened with any XML schema viewing application, such as XMLSpy.

Common XML Schemas

Among the .xsd files that belong to a BASE package are the common Cisco IOS XR XML schemas that include definitions of the high-level XML request and response instances, operations, and common datatypes. The following common XML schemas are listed:

alarm_operations.xsd

config_services_operations.xsd

cli_operations.xsd

common_datatypes.xsd

xml_api_common.xsd

xml_api_protocol.xsd

native_data_common.xsd

native_data_operations.xsd

Component XML Schemas

In addition to the common XML schemas, component XML schemas (such as native data) are provided and contain the data model for each feature. There is typically one component XML schema for each major type of data supported by the component—configuration, operational, action, administration operational, and administration action data—plus any complex data type definitions in the operational space.


Note Sometimes common schema files exist for a component that contain resources used by the component's other schema files (for example, the data types to be used by both configuration data and operational data).


You should use only the XML objects that are defined in the XML schema files. You should not use any unpublished objects that may be shown in the XML returned from the router.

Schema File Organization

There is no hard link from the high-level XML request schemas (namespace_types.xsd) and the component schemas. Instead, links appear in the component schemas in the form of include elements that specify the file in which the parent element exists. The name of the component .xsd file also indicates where in the hierarchy the file's contents reside. If the file ends with _cfg.xsd, it appears as a child of "Configuration"; if it ends with _if_cfg.xsd, it appears as a child of "InterfaceConfiguration", and so on. In addition, the comment header in each .xsd file names the parent object of each top level object in the schema.

Schema File Upgrades

If a new version of a schema file becomes available (or has to be uploaded to the router as part of an upgrade), the new version of the file can replace the old version of the file in a straight swap. All other files are unaffected. Therefore, if a component is replaced, only the .xsd files pertaining to that component is replaced.