liveBook · Manning

Xml

As explained in Acing the CCNA Exam: Volume 2 Advanced Networking and Security

XML is a text-based markup language and data serialization format that represents structured information with nested elements and attributes.

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

How Acing the CCNA Exam: Volume 2 Advanced Networking and Security covers it

How deep it goes
Defines XML syntax, whitespace behavior, relative readability, REST API support, and one Cisco IOS display command.
Examples
Shows show ip interface brief output in standard tabular form and XML with nested interface entries.
What you can do after
Operate Cisco IOS show commands with the | format filter and recognize their structured XML output.
How it connects
Connects XML with data serialization, HTML, JSON, YAML, REST APIs, and Cisco IOS show commands.

Also explained in

Compare how 5 books explain xml →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Acing the CCNA Exam: Volume 2 Advanced Networking and Security. The section links point to the parts of the book it draws on.