--- trunk/thuban/Extensions/wms/parser.py 2004/04/13 13:15:22 2164 +++ trunk/thuban/Extensions/wms/parser.py 2004/04/13 16:42:48 2165 @@ -52,6 +52,8 @@ from domutils import getElementsByName, getElementByName +from Thuban import _ + class WMSCapabilitiesParser: """ Thuban class to parse capabilities supplied as large string. @@ -68,6 +70,7 @@ access = None formats = None srs_discrepancies = None + error = None def __init__(self): @@ -78,7 +81,7 @@ # Note that we must not initialise internal variables of the # class in a mutable way or it will be shared among all # instances. None is immutable, [] is not. - layers = [] + self.error = [] def grok(self, data): @@ -152,6 +155,10 @@ foo = getElementByName(top, 'Title') if foo and len(foo.childNodes[0].data): self.layers[index]['title'] = foo.childNodes[0].data + else: + # A is required for each layer, <name> is optional + # See OGC 01-068r3, 7.1.4.5.1 and 7.1.4.5.2 + self.error.append(_("No title found for layer #%d") % index) foo = getElementByName(top, 'Name') if foo and len(foo.childNodes[0].data):