XML is the oldest of the three formats.
Each value sits between an opening tag and a closing tag:
Figure 1 - The Tags of an XML File
One tag holds all the others. It is called the root.
In the lab, add the tag
modelwith the value C9300 toswitch.xml.
Runshow.pyto get the flag.Answer the question below
Enter the flag you obtained.
Python does not turn XML into a dictionary.
You get the root tag, then you find each value by the name of its tag:
Figure 2 - From an XML File to a Value
In a script, it takes three lines:
import xml.etree.ElementTree as ET tree = ET.parse("switch.xml") root = tree.getroot() print(root.find("name").text) # Output: SW1In the lab, the script
read.pyprints the name of the switch.
Change it to print the address of the switch to get the flag.Answer the question below
Enter the flag you obtained.