Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

About XML

 

XML is a language for defining a set of markers, called tags, that are applied to a data set or document to describe the function of individual elements and codify the hierarchical relationships between them. Tags look much like Hypertext Markup Language (HTML) tags, but XML is actually a metalanguage used to define tags that best suit the kind of data being marked.

The following sections discuss XML and NETCONF:

For more details about XML, see A Technical Introduction to XML at http://www.xml.com/pub/a/98/10/guide0.html and the additional reference material at the www.xml.com site. The official XML specification from the World Wide Web Consortium (W3C), Extensible Markup Language (XML) 1.0, is available at http://www.w3.org/TR/REC-xml.

XML and NETCONF Tag Elements

XML and NETCONF Tag Elements

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:

The term tag element refers to the triple of 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.

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 <eventing/> is equivalent to <eventing></eventing>.

As the preceding examples show, angle brackets enclose the name of a NETCONF or SRC 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.

NETCONF and SRC 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 SRC XML <interface> tag element indicates that it contains information about an interface on the C Series Controller, whereas the name of the <name> tag element indicates that its contents specify the identifier.

When discussing tag elements in text, the convention is to use 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 <interface> tag element” instead of “the <interface><name>name </name></interface> tag element.”

Document Type Definition

Document Type Definition

An XML-tagged document or data set is structured, because a set of rules specifies the ordering and interrelationships of the items in it. The rules define the contexts in which each tagged item can—and in some cases must—occur. A file called a document type definition, or DTD, lists every tag element that can appear in the document or data set, defines the parent-child relationships between the tags, and specifies other tag characteristics. The same DTD can apply to many XML documents or data sets.