1
2 from configParser import C3Object
3 from utils import elementType, getFirstData, verifyXPaths
4
6 sources = []
7
9 if (node.localName == "source"):
10 xpaths = []
11 for child in node.childNodes:
12 if child.nodeType == elementType:
13 if child.localName == "xpath":
14
15 data = {'schema' : '', 'xpath': None, 'maps': {}}
16
17 xp = getFirstData(child)
18 data['xpath'] = verifyXPaths([xp])[0]
19
20 for a in child.attributes.keys():
21
22 if type(a) == tuple:
23 attrNode = child.attributes[a]
24 a = attrNode.name
25 if (a[:6] == "xmlns:"):
26 pref = a[6:]
27 uri = child.getAttributeNS('http://www.w3.org/2000/xmlns/', pref)
28 if not uri:
29 uri = child.getAttribute(a)
30 data['maps'][pref] = uri
31 elif a == 'schema':
32 data['schema'] = child.getAttributeNS(None, 'schema')
33 xpaths.append(data)
34 self.sources.append(xpaths)
35
36 - def __init__(self, session, config, parent):
40