Handling An Error Or Warning - Juniper JUNOS OS 10.3 - XML MANAGEMENT PROTOCOL GUIDE 6-30-2010 Manual

Junos xml management protocol guide
Hide thumbs Also See for JUNOS OS 10.3 - XML MANAGEMENT PROTOCOL GUIDE 6-30-2010:
Table of Contents

Advertisement

Handling an Error or Warning

Copyright © 2010, Juniper Networks, Inc.
API for XML (SAX). Describing how to implement and use a parser is beyond the scope
of this document.
Routines in the DOM accept incoming XML and build a tag hierarchy in the client
application's memory. There are also DOM routines for manipulating an existing hierarchy.
DOM implementations are available for several programming languages, including C,
C++, Perl, and Java. For detailed information, see the Document Object Model (DOM)
Level 1 Specification from the World Wide Web Consortium (W3C) at
http://www.w3.org/TR/REC-DOM-Level-1/
Comprehensive Perl Archive Network (CPAN) at
http://search.cpan.org/~tjmather/XML-DOM/lib/XML/DOM.pm
One potential drawback with DOM is that it always builds a hierarchy of tag elements,
which can become very large. If a client application needs to handle only one subhierarchy
at a time, it can use a parser that implements SAX instead. SAX accepts XML and feeds
the tag elements directly to the client application, which must build its own tag hierarchy.
For more information, see the official SAX website at
If the Junos XML protocol server encounters an error condition, it emits an
tag element, which encloses child tag elements that describe the nature of the error.
Client applications must be prepared to receive and handle an
at any time. The information in any response tag elements already received and related
to the current request might be incomplete. The client application can include logic for
deciding whether to discard or retain the information.
The syntax of the
<xnm:error>
multiple lines only for legibility:
<xnm:error xmlns="http://xml.juniper.net/xnm/1.1/xnm" \
xmlns:xnm="http://xml.juniper.net/xnm/1.1/xnm">
<!-- tag elements describing the error -->
</xnm:error>
The attributes are as follows:
xmlns
—The XML namespace for the tag elements enclosed by the
element that do not have a prefix in their names (that is, the default namespace for
Junos XML tag elements). The value is a URL of the form
http://xml.juniper.net/xnm/version/xnm
xmlns:xnm
—The XML namespace for the
tag elements that have the
http://xml.juniper.net/xnm/version/xnm
The set of child tag elements enclosed in the
operation that server was performing when the error occurred. An error can occur while
the server is performing any of the following operations, and the server can send a different
combination of child tag elements in each case:
Processing an operational request submitted by a client application (discussed in
"Requesting Information" on page 61)
Chapter 3: Controlling the Junos XML Management Protocol Session
. Additional information is available from the
http://sax.sourceforge.net/
tag element is as follows. The opening tag appears on
, where
version
<xnm:error>
tag element and for the enclosed
prefix in their names. The value is a URL of the form
xnm:
, where
version
<xnm:error>
.
.
<xnm:error>
<xnm:error>
tag element
<xnm:error>
tag
is a string such as
.
1.1
is a string such as
.
1.1
tag element depends on the
51

Advertisement

Table of Contents
loading

This manual is also suitable for:

Junos os

Table of Contents