Automation · Data Formats
XML
Cheat sheet · https://pcornel.dk/topic.php?topic=5830
Answer
XML is a markup format with nested elements and attributes, used by NETCONF, SOAP, Windows configs and many enterprise systems. It supports schemas and namespaces but is verbose.
Remember
- XML has elements, attributes and namespaces.
- NETCONF and many enterprise APIs use XML.
- Never parse XML with regex.
First checks
xmllint --noout file.xml— well-formedxmllint --schema schema.xsd --noout file.xml— XSD validationxmllint --xpath '//interface/name/text()' file.xml— XPath query
Verify in this order
XML → safe parser → tree → XPath
Where it usually breaks
Input/desired state → request accepted → job/task terminal status → target object read-back → effective runtime state → original workload → regression/rollback readiness.
Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=5830