Items in an XML-compliant document or data set are always enclosed in paired opening and closing tags. XML is stricter in this respect than HTML, which sometimes uses only opening tags. The following examples show paired opening and closing tags enclosing a value:
<interface-state>enabled</interface-state>
<input-bytes>25378</input-bytes>
The term tag element refers to a three-part set: opening tag, contents, and closing tag. The content can be an alphanumeric character string as in the preceding examples, or can itself be a container tag element, which contains other tag elements. For simplicity, the term tag is often used interchangeably with tag element or element.
If a tag element is empty—has no contents—it can be represented either as paired opening and closing tags with nothing between them, or as a single tag with a forward slash after the tag name. For example, the notation <snmp-trap-flag/> is equivalent to <snmp-trap-flag></snmp-trap-flag>.
As the preceding examples show, angle brackets enclose the name of a JUNOScript or JUNOS XML tag element in its opening and closing tags. This is an XML convention, and the brackets are a required part of the complete tag element name. They are not to be confused with the angle brackets used in Juniper Networks documentation to indicate optional parts of CLI command strings.
JUNOScript and JUNOS XML tag elements obey the XML convention that the tag element name indicates the kind of information enclosed by the tag element. For example, the name of the JUNOS XML <interface-state> tag element indicates that it contains a description of the current status of an interface on the routing platform, whereas the name of the <input-bytes> tag element indicates that its contents specify the number of bytes received.
When discussing tag elements in text, this manual conventionally uses just the name of the opening tag to represent the complete tag element (opening tag, contents, and closing tag). For example, it usually refers to the <input-bytes> tag element instead of the <input-bytes>number-of-bytes</input-bytes> tag element.