49 |
# $Id$ |
# $Id$ |
50 |
|
|
51 |
import xml.dom.minidom |
import xml.dom.minidom |
52 |
|
from xml.dom import Node |
53 |
|
|
54 |
from domutils import getElementsByName, getElementByName |
from domutils import getElementsByName, getElementByName |
55 |
|
|
119 |
and foo.childNodes[0].data.lower() != 'none': |
and foo.childNodes[0].data.lower() != 'none': |
120 |
self.access = foo.childNodes[0].data |
self.access = foo.childNodes[0].data |
121 |
|
|
122 |
# Extract output format information |
foo = getElementByName(getElementByName( |
123 |
foo = getElementsByName( |
root, 'Capability'), 'Request') |
124 |
getElementByName(getElementByName(getElementByName( |
|
125 |
root, 'Capability'), 'Request'), 'GetMap'), 'Format') |
# Need to distinguish between Map and GetMap for v1.0 and v1.1 |
126 |
self.formats = map((lambda i: i.childNodes[0].data), foo) |
bar = getElementByName(foo, 'GetMap') |
127 |
|
if bar: |
128 |
|
# WMS 1.1 |
129 |
|
foo = getElementsByName(bar, 'Format') |
130 |
|
self.formats = map((lambda i: i.childNodes[0].data), foo) |
131 |
|
else: |
132 |
|
# WMS 1.0 |
133 |
|
foo = getElementByName(getElementByName( |
134 |
|
foo, 'Map'), 'Format') |
135 |
|
for node in foo.childNodes: |
136 |
|
if node.nodeType == Node.ELEMENT_NODE: |
137 |
|
try: |
138 |
|
self.formats.append(node.nodeName) |
139 |
|
except AttributeError: |
140 |
|
self.formats = [node.nodeName] |
141 |
|
|
142 |
# Extract layer names |
# Extract layer names |
143 |
self.layers = [] |
self.layers = [] |