XML (Extensible Markup Language) is a data serialization format for storing or transmitting structured information. Its HTML-like opening and closing tags represent key-value pairs, such as <key>value</key>. XML is commonly supported by REST APIs, although JSON and YAML are generally more common and XML is considered less human-readable than JSON. section 24.1 section 24.3.1
Use these operational characteristics to recognize XML:
- Treat whitespace as insignificant, while normally formatting it to improve human readability. section 24.3.1
- Interpret nested elements as structured data that applications can store, transmit, and reconstruct. section 24.1 section 24.3.1
Display Cisco IOS output as XML
Run show ip interface brief | format. IOS returns XML elements such as <Interface>, <IP-Address>, <Status>, and <Protocol>, allowing the displayed interface data to be processed as structured records. section 24.3.1
R1# show ip interface brief
Interface IP-Address OK? Method Status Protocol
GigabitEthernet0/0 192.168.1.1 YES manual up up
GigabitEthernet0/1 unassigned YES unset down down
. . .
R1# show ip interface brief | format
<?xml version="1.0" encoding="UTF-8"?>
<ShowIpInterfaceBrief xmlns="ODM://built-in//show_ip_interface_brief">
<SpecVersion>built-in</SpecVersion>
<IPInterfaces>
<entry> #1
<Interface>GigabitEthernet0/0</Interface>
<IP-Address>192.168.1.1</IP-Address>
<OK>YES</OK>
<Method>manual</Method>
<Status>up</Status>
<Protocol>up</Protocol>
</entry> #1
<entry> #2
<Interface>GigabitEthernet0/1</Interface>
<OK>YES</OK>
<Method>unset</Method>
<Status>down</Status>
<Protocol>down</Protocol>
</entry> #2
. . .
</IPInterfaces>
</ShowIpInterfaceBrief>
#1 Beginning and end of R1’s G0/0 interface
#2 Beginning and end of R1’s G0/1 interface
Compare the standard tabular command output with its XML representation, including repeated interface entry elements. section 24.3.1




