Cisco XML Schemas
This chapter contains information about common XML schemas. The structure and allowable content of the 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 this URL:
This chapter contains these 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. Click this URL to display the Downloads page:
Note Select Downloads. Only customer or partner viewers can access the Download Software page. Guest users will get an error.
2. Select Cisco IOS XR Software.
3. Select IOS XR XML Schemas.
4. 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. These common XML schemas are listed:
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.