Revision 53e1a046 ncclient/xml_.py

b/ncclient/xml_.py
17 17
from cStringIO import StringIO
18 18
from xml.etree import cElementTree as ET
19 19

  
20
# in case problems occur include the ElementTree file from the parent dir
21
# import ElementTree as ET
22

  
20 23
from ncclient import NCClientError
21 24

  
22 25
class XMLError(NCClientError): pass
......
33 36
CISCO_CPI_1_0 = "http://www.cisco.com/cpi_10/schema"
34 37
#: Namespace for Flowmon data model
35 38
FLOWMON_1_0 = "http://www.liberouter.org/ns/netopeer/flowmon/1.0"
36

  
39
#: Namespace for Juniper 9.6R4
40
JUNIPER_1_1 = "http://xml.juniper.net/xnm/1.1/xnm"
41
#
37 42
try:
38 43
    register_namespace = ET.register_namespace
39 44
except AttributeError:
......
49 54
    TAILF_EXECD_1_1: 'execd',
50 55
    CISCO_CPI_1_0: 'cpi',
51 56
    FLOWMON_1_0: 'fm',
52
}.items(): register_namespace(pre, ns)
57
    JUNIPER_1_1: 'junos',
58
}.items(): 
59
    register_namespace(pre, ns)
53 60

  
54 61
qualify = lambda tag, ns=BASE_NS_1_0: tag if ns is None else "{%s}%s" % (ns, tag)
55 62
"""Qualify a *tag* name with a *namespace*, in :mod:`~xml.etree.ElementTree` fashion i.e. *{namespace}tagname*."""

Also available in: Unified diff