|
|
|
@ -14,37 +14,61 @@
|
|
|
|
|
# See the License for the specific language governing permissions and
|
|
|
|
|
# limitations under the License.
|
|
|
|
|
|
|
|
|
|
import xml
|
|
|
|
|
from xml.etree import ElementTree as ET
|
|
|
|
|
import xml.dom.minidom as minidom
|
|
|
|
|
from calculate.lib.utils.text import _u
|
|
|
|
|
|
|
|
|
|
try:
|
|
|
|
|
if hasattr(xml, "use_pyxml"):
|
|
|
|
|
xml.use_pyxml()
|
|
|
|
|
from xml import xpath
|
|
|
|
|
except ImportError:
|
|
|
|
|
xpath = None
|
|
|
|
|
# import lxml
|
|
|
|
|
from lxml import etree as ET
|
|
|
|
|
from copy import deepcopy
|
|
|
|
|
|
|
|
|
|
ET_VERSION = ET.VERSION
|
|
|
|
|
# def appendChild(*args, **kwargs):
|
|
|
|
|
# ET._Element.append(*args, **kwargs)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# ET._Element.appendChild = appendChild
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#backwards compat
|
|
|
|
|
class xpath():
|
|
|
|
|
@staticmethod
|
|
|
|
|
def Evaluate(xpath, xml):
|
|
|
|
|
f = ET.XPath(xpath)
|
|
|
|
|
return f(xml)
|
|
|
|
|
|
|
|
|
|
#can't add methods to Cython lib. Gotta do this
|
|
|
|
|
def firstChild(element):
|
|
|
|
|
if(len(element) == 0):
|
|
|
|
|
return None
|
|
|
|
|
return element[0]
|
|
|
|
|
|
|
|
|
|
def insertBefore(elem, new_child, ref_child):
|
|
|
|
|
#don't actually need parent element, its here just so we can have structure similar to old elem.insertBefore(new_child, ref_child)
|
|
|
|
|
ref_child.addprevious(new_child)
|
|
|
|
|
return new_child
|
|
|
|
|
|
|
|
|
|
class xmlShare(object):
|
|
|
|
|
"""Общий класс для объектов XML, наследуем
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
def _createElement(self, doc, tagName, text="", attributes=None):
|
|
|
|
|
def _createElement(self, doc, tag, text="", attributes=None):
|
|
|
|
|
"""Создание нового XML элемента"""
|
|
|
|
|
if not isinstance(attributes, dict):
|
|
|
|
|
attributes = {}
|
|
|
|
|
|
|
|
|
|
element = doc.createElement(tagName)
|
|
|
|
|
element = ET.SubElement(doc, tag, attributes)
|
|
|
|
|
# print(type(element))
|
|
|
|
|
# print(dir(element))
|
|
|
|
|
# raise Exception
|
|
|
|
|
# element = doc.createElement(tag)
|
|
|
|
|
if text:
|
|
|
|
|
txtNode = doc.createTextNode(_u(text))
|
|
|
|
|
element.appendChild(txtNode)
|
|
|
|
|
for attr in attributes:
|
|
|
|
|
attribute = doc.createAttribute(attr)
|
|
|
|
|
attribute.nodeValue = attributes[attr]
|
|
|
|
|
element.setAttributeNode(attribute)
|
|
|
|
|
# txtNode = doc.createTextNode(_u(text))
|
|
|
|
|
# txtNode = doc.createTextNode(text)
|
|
|
|
|
# element.append(txtNode)
|
|
|
|
|
element.text = text
|
|
|
|
|
# for attr in attributes:
|
|
|
|
|
# attribute = doc.createAttribute(attr)
|
|
|
|
|
# attribute.text = attributes[attr]
|
|
|
|
|
# element.setAttributeNode(attribute)
|
|
|
|
|
# print("++++++")
|
|
|
|
|
# print(ET.tostring(element, pretty_print=True))
|
|
|
|
|
return element
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -55,9 +79,9 @@ class xmlNode(xmlShare):
|
|
|
|
|
def __init__(self):
|
|
|
|
|
self.node = False
|
|
|
|
|
|
|
|
|
|
def createNode(self, doc, tagName, text=""):
|
|
|
|
|
def createNode(self, doc, tag, text=""):
|
|
|
|
|
"""Создает XML элемент без аттрибутов"""
|
|
|
|
|
self.node = self._createElement(doc, tagName, text)
|
|
|
|
|
self.node = self._createElement(doc, tag, text)
|
|
|
|
|
return self.node
|
|
|
|
|
|
|
|
|
|
def getNode(self):
|
|
|
|
@ -78,13 +102,13 @@ class xmlCaption(object):
|
|
|
|
|
tmpNode = xmlNode()
|
|
|
|
|
self.caption = tmpNode.createNode(doc, "caption")
|
|
|
|
|
nameNode = tmpNode.createNode(doc, "name", name)
|
|
|
|
|
self.caption.appendChild(nameNode)
|
|
|
|
|
self.caption.append(nameNode)
|
|
|
|
|
if action:
|
|
|
|
|
actNode = tmpNode.createNode(doc, "action", action)
|
|
|
|
|
self.caption.appendChild(actNode)
|
|
|
|
|
self.caption.append(actNode)
|
|
|
|
|
for q in quotes:
|
|
|
|
|
quoteNode = tmpNode.createNode(doc, "quote", q)
|
|
|
|
|
self.caption.appendChild(quoteNode)
|
|
|
|
|
self.caption.append(quoteNode)
|
|
|
|
|
return self.caption
|
|
|
|
|
|
|
|
|
|
def getCaption(self):
|
|
|
|
@ -107,16 +131,16 @@ class xmlField(xmlShare):
|
|
|
|
|
self.field = self._createElement(doc, "field", "", {"type": typeField})
|
|
|
|
|
if name:
|
|
|
|
|
nameNode = self._createElement(doc, "name", name)
|
|
|
|
|
self.field.appendChild(nameNode)
|
|
|
|
|
self.field.append(nameNode)
|
|
|
|
|
for v in values:
|
|
|
|
|
valueNode = self._createElement(doc, "value", v)
|
|
|
|
|
self.field.appendChild(valueNode)
|
|
|
|
|
self.field.append(valueNode)
|
|
|
|
|
if action:
|
|
|
|
|
actNode = self._createElement(doc, "action", action)
|
|
|
|
|
self.field.appendChild(actNode)
|
|
|
|
|
self.field.append(actNode)
|
|
|
|
|
for q in quotes:
|
|
|
|
|
quoteNode = self._createElement(doc, "quote", q)
|
|
|
|
|
self.field.appendChild(quoteNode)
|
|
|
|
|
self.field.append(quoteNode)
|
|
|
|
|
return self.field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -151,12 +175,12 @@ class xmlArea(object):
|
|
|
|
|
"""Создание XML области"""
|
|
|
|
|
tmpNode = xmlNode()
|
|
|
|
|
self.area = tmpNode.createNode(doc, "area")
|
|
|
|
|
if xmlCaption and xmlCaption.getCaption():
|
|
|
|
|
self.area.appendChild(xmlCaption.getCaption())
|
|
|
|
|
if xmlCaption and xmlCaption.getCaption() is not None:
|
|
|
|
|
self.area.append(xmlCaption.getCaption())
|
|
|
|
|
if xmlFields:
|
|
|
|
|
fields = xmlFields.getFields()
|
|
|
|
|
for field in fields:
|
|
|
|
|
self.area.appendChild(field)
|
|
|
|
|
self.area.append(field)
|
|
|
|
|
return self.area
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -186,11 +210,20 @@ class xmlDoc(object):
|
|
|
|
|
docTxt = ('<?xml version="1.0" encoding="UTF-8"?><cxmlconf><head>'
|
|
|
|
|
'<ver>{version}</ver>'
|
|
|
|
|
'<format>{type_doc}</format>'
|
|
|
|
|
'</head><body></body></cxmlconf>'.format(version=version,
|
|
|
|
|
'</head><body> </body></cxmlconf>'.format(version=version,
|
|
|
|
|
type_doc=typeDoc))
|
|
|
|
|
self.doc = minidom.parseString(docTxt)
|
|
|
|
|
self.root = self.doc.documentElement
|
|
|
|
|
# self.doc = minidom.parseString(docTxt)
|
|
|
|
|
# self.root = self.doc.documentElement
|
|
|
|
|
# self.body = xpath.Evaluate('child::body', self.root)[0]
|
|
|
|
|
|
|
|
|
|
self.doc = ET.XML(bytes(bytearray(docTxt, encoding='utf-8')))
|
|
|
|
|
# self.doc = ET.XML(bytes(docTxt, encoding='utf8'))
|
|
|
|
|
# print(ET.tostring(self.doc, pretty_print=True))
|
|
|
|
|
self.root = self.doc
|
|
|
|
|
# print(ET.tostring(self.root, pretty_print=True))
|
|
|
|
|
self.body = xpath.Evaluate('child::body', self.root)[0]
|
|
|
|
|
# print(ET.tostring(self.doc, pretty_print=True))
|
|
|
|
|
# print(ET.tostring(self.body, pretty_print=True))
|
|
|
|
|
# установка разделителя областей
|
|
|
|
|
self.sepAreas = self.createField("br", [], "", [], False, False)
|
|
|
|
|
# установка разделителя областей разделенных списков
|
|
|
|
@ -259,24 +292,24 @@ class xmlDoc(object):
|
|
|
|
|
def setActionField(self, xmlField, actionTxt):
|
|
|
|
|
"""Устанавливает свойство action для XML поля"""
|
|
|
|
|
xmlActions = xpath.Evaluate('child::action', xmlField)
|
|
|
|
|
if xmlActions and xmlActions[0].firstChild:
|
|
|
|
|
xmlActions[0].firstChild.nodeValue = actionTxt
|
|
|
|
|
if firstChild(xmlActions and xmlActions[0]):
|
|
|
|
|
firstChild(xmlActions[0]).text = actionTxt
|
|
|
|
|
else:
|
|
|
|
|
nodeObj = xmlNode()
|
|
|
|
|
newNode = nodeObj.createNode(self.doc, "action", actionTxt)
|
|
|
|
|
xmlField.appendChild(newNode)
|
|
|
|
|
xmlField.append(newNode)
|
|
|
|
|
|
|
|
|
|
def setActionArea(self, xmlArea, actionTxt):
|
|
|
|
|
"""Устанавливает свойство action для XML области"""
|
|
|
|
|
xmlActions = xpath.Evaluate('child::caption/action', xmlArea)
|
|
|
|
|
xmlCaptions = xpath.Evaluate('child::caption', xmlArea)
|
|
|
|
|
if xmlActions and xmlActions[0].firstChild:
|
|
|
|
|
xmlActions[0].firstChild.nodeValue = actionTxt
|
|
|
|
|
if xmlActions and firstChild(xmlActions[0]):
|
|
|
|
|
firstChild(xmlActions[0]).text = actionTxt
|
|
|
|
|
else:
|
|
|
|
|
if xmlCaptions:
|
|
|
|
|
nodeObj = xmlNode()
|
|
|
|
|
newNode = nodeObj.createNode(self.doc, "action", actionTxt)
|
|
|
|
|
xmlCaptions[0].appendChild(newNode)
|
|
|
|
|
xmlCaptions[0].append(newNode)
|
|
|
|
|
|
|
|
|
|
def joinField(self, xmlArea, xmlNewField):
|
|
|
|
|
"""Объединяет XML ноду область и XML ноду поле"""
|
|
|
|
@ -290,7 +323,7 @@ class xmlDoc(object):
|
|
|
|
|
if not fieldsOldComp and typeNewField != "seplist":
|
|
|
|
|
if self.getActionField(xmlNewField) != "drop":
|
|
|
|
|
self.setActionField(xmlNewField, "append")
|
|
|
|
|
xmlArea.appendChild(xmlNewField)
|
|
|
|
|
xmlArea.append(xmlNewField)
|
|
|
|
|
return True
|
|
|
|
|
newFieldsAction = self.getActionField(xmlNewField)
|
|
|
|
|
newValues = self.getFieldValues(xmlNewField)
|
|
|
|
@ -298,15 +331,15 @@ class xmlDoc(object):
|
|
|
|
|
|
|
|
|
|
for nodeFieldOld in fieldsOldComp:
|
|
|
|
|
if newFieldsAction == "drop":
|
|
|
|
|
if nodeFieldOld.nextSibling and \
|
|
|
|
|
if nodeFieldOld.getnext() and \
|
|
|
|
|
self.getTypeField(
|
|
|
|
|
nodeFieldOld.nextSibling) == "br":
|
|
|
|
|
xmlArea.removeChild(nodeFieldOld.nextSibling)
|
|
|
|
|
elif nodeFieldOld.previousSibling and \
|
|
|
|
|
nodeFieldOld.getnext()) == "br":
|
|
|
|
|
xmlArea.remove(nodeFieldOld.getnext())
|
|
|
|
|
elif nodeFieldOld.getprevious() and \
|
|
|
|
|
self.getTypeField(
|
|
|
|
|
nodeFieldOld.previousSibling) == "br":
|
|
|
|
|
xmlArea.removeChild(nodeFieldOld.previousSibling)
|
|
|
|
|
xmlArea.removeChild(nodeFieldOld)
|
|
|
|
|
nodeFieldOld.getprevious()) == "br":
|
|
|
|
|
xmlArea.remove(nodeFieldOld.getprevious())
|
|
|
|
|
xmlArea.remove(nodeFieldOld)
|
|
|
|
|
continue
|
|
|
|
|
oldValues = self.getFieldValues(nodeFieldOld)
|
|
|
|
|
# Сравнение значений переменной шаблона и файла
|
|
|
|
@ -335,8 +368,8 @@ class xmlDoc(object):
|
|
|
|
|
flagCompareSeplist = True
|
|
|
|
|
break
|
|
|
|
|
if not flagCompareSeplist:
|
|
|
|
|
nextNode = xmlOldField.nextSibling
|
|
|
|
|
newInsNode = nodeSeplist.cloneNode(True)
|
|
|
|
|
nextNode = xmlOldField.getnext()
|
|
|
|
|
newInsNode = deepcopy(nodeSeplist)
|
|
|
|
|
self.setActionField(newInsNode, "append")
|
|
|
|
|
|
|
|
|
|
if nextNode:
|
|
|
|
@ -348,7 +381,7 @@ class xmlDoc(object):
|
|
|
|
|
False,
|
|
|
|
|
"append"))
|
|
|
|
|
else:
|
|
|
|
|
newInsNode = nodeSeplist.cloneNode(True)
|
|
|
|
|
newInsNode = deepcopy(nodeSeplist)
|
|
|
|
|
if self.getActionField(newInsNode) == "join":
|
|
|
|
|
self.setActionField(newInsNode, "append")
|
|
|
|
|
if xmlOldField:
|
|
|
|
@ -364,8 +397,8 @@ class xmlDoc(object):
|
|
|
|
|
# nodeSeplist.cloneNode(True),
|
|
|
|
|
# xmlOldField)
|
|
|
|
|
|
|
|
|
|
parentNode = nodeSeplist.parentNode
|
|
|
|
|
parentNode.removeChild(nodeSeplist)
|
|
|
|
|
parentNode = nodeSeplist.getparent()
|
|
|
|
|
parentNode.remove(nodeSeplist)
|
|
|
|
|
|
|
|
|
|
insNodesRepl = []
|
|
|
|
|
for newNode, nxtNode, app in insSplLst:
|
|
|
|
@ -384,26 +417,25 @@ class xmlDoc(object):
|
|
|
|
|
|
|
|
|
|
for newNode, nxtNode, app in insNodesRepl:
|
|
|
|
|
if app == "insert":
|
|
|
|
|
xmlArea.insertBefore(newNode, nxtNode)
|
|
|
|
|
insertBefore(xmlArea, newNode, nxtNode)
|
|
|
|
|
elif app == "append":
|
|
|
|
|
xmlArea.appendChild(newNode)
|
|
|
|
|
xmlArea.append(newNode)
|
|
|
|
|
if xmlOldField:
|
|
|
|
|
parentNode = xmlOldField.parentNode
|
|
|
|
|
parentNode = xmlOldField.getparent()
|
|
|
|
|
if parentNode and newFieldsAction != "join":
|
|
|
|
|
parentNode.removeChild(xmlOldField)
|
|
|
|
|
parentNode.remove(xmlOldField)
|
|
|
|
|
|
|
|
|
|
for newNode, nxtNode, app in appSplLst:
|
|
|
|
|
if app == "insert":
|
|
|
|
|
xmlArea.insertBefore(newNode, nxtNode)
|
|
|
|
|
insertBefore(xmlArea, newNode, nxtNode)
|
|
|
|
|
elif app == "append":
|
|
|
|
|
xmlArea.appendChild(newNode)
|
|
|
|
|
xmlArea.append(newNode)
|
|
|
|
|
|
|
|
|
|
if not flagCompare and typeNewField != "seplist":
|
|
|
|
|
# Устанавливаем action=replace
|
|
|
|
|
self.setActionField(xmlNewField, "replace")
|
|
|
|
|
# Если параметры поля не сходятся заменяем поле
|
|
|
|
|
xmlArea.replaceChild(xmlNewField.cloneNode(True),
|
|
|
|
|
fieldsOldComp[-1])
|
|
|
|
|
xmlArea.replace(fieldsOldComp[-1], deepcopy(xmlNewField))
|
|
|
|
|
|
|
|
|
|
if newFieldsAction == "join":
|
|
|
|
|
fieldsOldRemove = []
|
|
|
|
@ -415,11 +447,11 @@ class xmlDoc(object):
|
|
|
|
|
if actionOldNode == "insert" or actionOldNode == "append":
|
|
|
|
|
pass
|
|
|
|
|
else:
|
|
|
|
|
if nodeFieldOld.nextSibling and \
|
|
|
|
|
if nodeFieldOld.getnext() and \
|
|
|
|
|
self.getTypeField(
|
|
|
|
|
nodeFieldOld.nextSibling) == "br":
|
|
|
|
|
xmlArea.removeChild(nodeFieldOld.nextSibling)
|
|
|
|
|
xmlArea.removeChild(nodeFieldOld)
|
|
|
|
|
nodeFieldOld.getnext()) == "br":
|
|
|
|
|
xmlArea.remove(nodeFieldOld.getnext())
|
|
|
|
|
xmlArea.remove(nodeFieldOld)
|
|
|
|
|
return True
|
|
|
|
|
|
|
|
|
|
def getSepListToField(self, xmlField):
|
|
|
|
@ -431,7 +463,7 @@ class xmlDoc(object):
|
|
|
|
|
nameField = self.getNameField(xmlField)
|
|
|
|
|
if not nameField:
|
|
|
|
|
return []
|
|
|
|
|
parentNode = xmlField.parentNode
|
|
|
|
|
parentNode = xmlField.getparent()
|
|
|
|
|
if parentNode:
|
|
|
|
|
fieldsVal = xpath.Evaluate(
|
|
|
|
|
"child::field[attribute::type='seplist'][child::name='%s'] " \
|
|
|
|
@ -444,11 +476,11 @@ class xmlDoc(object):
|
|
|
|
|
"""Удаляет комментарии в XML области"""
|
|
|
|
|
fieldNodes = xpath.Evaluate('descendant::field', xmlArea)
|
|
|
|
|
for fieldNode in fieldNodes:
|
|
|
|
|
if fieldNode.hasAttribute("type"):
|
|
|
|
|
if fieldNode.getAttribute("type") == "comment" or \
|
|
|
|
|
fieldNode.getAttribute("type") == "br":
|
|
|
|
|
parentNode = fieldNode.parentNode
|
|
|
|
|
parentNode.removeChild(fieldNode)
|
|
|
|
|
if fieldNode.get("type"):
|
|
|
|
|
if fieldNode.get("type") == "comment" or \
|
|
|
|
|
fieldNode.get("type") == "br":
|
|
|
|
|
parentNode = fieldNode.getparent()
|
|
|
|
|
parentNode.remove(fieldNode)
|
|
|
|
|
else:
|
|
|
|
|
if self.getActionField(fieldNode) == "drop":
|
|
|
|
|
pass
|
|
|
|
@ -534,9 +566,9 @@ class xmlDoc(object):
|
|
|
|
|
removeNodes = removeNodes[:-2]
|
|
|
|
|
|
|
|
|
|
for removeNode in removeNodes:
|
|
|
|
|
xmlOldArea.removeChild(removeNode)
|
|
|
|
|
xmlOldArea.remove(removeNode)
|
|
|
|
|
for node in sepListField:
|
|
|
|
|
node.setAttribute("type", "seplist")
|
|
|
|
|
node.set("type", "seplist")
|
|
|
|
|
if not (self.getActionField(node) == "join" or
|
|
|
|
|
self.getActionField(node) == "drop"):
|
|
|
|
|
self.setActionField(node, "insert")
|
|
|
|
@ -544,7 +576,7 @@ class xmlDoc(object):
|
|
|
|
|
for node in notSepListField:
|
|
|
|
|
if self.getTypeField(node) == "seplist":
|
|
|
|
|
self.setActionField(node, "append")
|
|
|
|
|
xmlOldArea.appendChild(node)
|
|
|
|
|
xmlOldArea.append(node)
|
|
|
|
|
else:
|
|
|
|
|
self.joinField(xmlOldArea, node)
|
|
|
|
|
|
|
|
|
@ -554,10 +586,10 @@ class xmlDoc(object):
|
|
|
|
|
return False
|
|
|
|
|
areaNodes = xpath.Evaluate('descendant::area', xmlArea)
|
|
|
|
|
for areaNode in areaNodes:
|
|
|
|
|
prevNode = areaNode.previousSibling
|
|
|
|
|
prevNode = areaNode.getprevious()
|
|
|
|
|
if prevNode:
|
|
|
|
|
parentNode = areaNode.parentNode
|
|
|
|
|
parentNode.insertBefore(self.sepAreas.cloneNode(True),
|
|
|
|
|
parentNode = areaNode.getparent()
|
|
|
|
|
insertBefore(parentNode, deepcopy(self.sepAreas),
|
|
|
|
|
areaNode)
|
|
|
|
|
return True
|
|
|
|
|
|
|
|
|
@ -575,14 +607,14 @@ class xmlDoc(object):
|
|
|
|
|
dictVar = {}
|
|
|
|
|
for namesAreaCompare in namesAreaCompareAll:
|
|
|
|
|
fields = xpath.Evaluate("child::field/child::name",
|
|
|
|
|
namesAreaCompare.parentNode)
|
|
|
|
|
namesAreaCompare.getparent())
|
|
|
|
|
for fieldName in fields:
|
|
|
|
|
nodeField = fieldName.parentNode
|
|
|
|
|
nodeField = fieldName.getparent()
|
|
|
|
|
fieldValue = xpath.Evaluate("child::value", nodeField)
|
|
|
|
|
name = fieldName.firstChild.nodeValue
|
|
|
|
|
name = firstChild(fieldName).text
|
|
|
|
|
value = ""
|
|
|
|
|
if fieldValue and fieldValue[0].firstChild:
|
|
|
|
|
value = fieldValue[0].firstChild.nodeValue
|
|
|
|
|
if fieldValue and firstChild(fieldValue[0]):
|
|
|
|
|
value = firstChild(fieldValue[0]).text
|
|
|
|
|
dictVar[name] = value
|
|
|
|
|
if not allVars:
|
|
|
|
|
break
|
|
|
|
@ -600,7 +632,7 @@ class xmlDoc(object):
|
|
|
|
|
for areaComp in namesAreaComare:
|
|
|
|
|
fieldsVal = xpath.Evaluate(
|
|
|
|
|
"child::field[child::name='%s'] "
|
|
|
|
|
% nameField, areaComp.parentNode)
|
|
|
|
|
% nameField, areaComp.getparent())
|
|
|
|
|
if fieldsVal:
|
|
|
|
|
break
|
|
|
|
|
if not fieldsVal:
|
|
|
|
@ -609,8 +641,8 @@ class xmlDoc(object):
|
|
|
|
|
fieldsVal[0])
|
|
|
|
|
if not fieldValue:
|
|
|
|
|
return False
|
|
|
|
|
if fieldValue[0].firstChild:
|
|
|
|
|
return fieldValue[0].firstChild.nodeValue
|
|
|
|
|
if firstChild(fieldValue[0]):
|
|
|
|
|
return firstChild(fieldValue[0]).text
|
|
|
|
|
else:
|
|
|
|
|
return ""
|
|
|
|
|
|
|
|
|
@ -623,7 +655,7 @@ class xmlDoc(object):
|
|
|
|
|
namesAreaComare = xpath.Evaluate(
|
|
|
|
|
"child::area/child::caption[child::name='%s']" % nameArea,
|
|
|
|
|
xmlArea)
|
|
|
|
|
return map(lambda x: x.parentNode, namesAreaComare)
|
|
|
|
|
return map(lambda x: x.getparent(), namesAreaComare)
|
|
|
|
|
|
|
|
|
|
def joinArea(self, baseNode, xmlNewArea):
|
|
|
|
|
"""Объединяет область c областью Body (xmlNewArea c baseNode)"""
|
|
|
|
@ -632,26 +664,26 @@ class xmlDoc(object):
|
|
|
|
|
fieldsRemove = xpath.Evaluate(
|
|
|
|
|
"descendant::field[child::action='drop']", xmlNewArea)
|
|
|
|
|
for rmNode in fieldsRemove:
|
|
|
|
|
parentNode = rmNode.parentNode
|
|
|
|
|
parentNode.removeChild(rmNode)
|
|
|
|
|
parentNode = rmNode.getparent()
|
|
|
|
|
parentNode.remove(rmNode)
|
|
|
|
|
captionAreasRemove = xpath.Evaluate(
|
|
|
|
|
"descendant::area/child::caption[child::action='drop']",
|
|
|
|
|
xmlNewArea)
|
|
|
|
|
for rmNodeCapt in captionAreasRemove:
|
|
|
|
|
rmNode = rmNodeCapt.parentNode
|
|
|
|
|
parentNode = rmNode.parentNode
|
|
|
|
|
parentNode.removeChild(rmNode)
|
|
|
|
|
rmNode = rmNodeCapt.getparent()
|
|
|
|
|
parentNode = rmNode.getparent()
|
|
|
|
|
parentNode.remove(rmNode)
|
|
|
|
|
self.setActionArea(xmlNewArea, "append")
|
|
|
|
|
# Добавляем разделитель областей во вложенные области
|
|
|
|
|
areaNodes = xpath.Evaluate('descendant::area', xmlNewArea)
|
|
|
|
|
for areaNode in areaNodes:
|
|
|
|
|
self.setActionArea(areaNode, "append")
|
|
|
|
|
parentNode = areaNode.parentNode
|
|
|
|
|
parentNode.insertBefore(self.sepAreas.cloneNode(True),
|
|
|
|
|
parentNode = areaNode.getparent()
|
|
|
|
|
insertBefore(parentNode, deepcopy(self.sepAreas),
|
|
|
|
|
areaNode)
|
|
|
|
|
baseNode.appendChild(xmlNewArea)
|
|
|
|
|
baseNode.append(xmlNewArea)
|
|
|
|
|
# Добавляем разделитель областей
|
|
|
|
|
baseNode.insertBefore(self.sepAreas.cloneNode(True), xmlNewArea)
|
|
|
|
|
insertBefore(baseNode, deepcopy(self.sepAreas), xmlNewArea)
|
|
|
|
|
|
|
|
|
|
nodesNames = xpath.Evaluate('child::area/caption/name', baseNode)
|
|
|
|
|
nodesNewArea = xpath.Evaluate('child::caption/name', xmlNewArea)
|
|
|
|
@ -665,32 +697,32 @@ class xmlDoc(object):
|
|
|
|
|
if not nodesNames or not nodesNewArea:
|
|
|
|
|
return False
|
|
|
|
|
nameArea = ""
|
|
|
|
|
if nodesNewArea[0].firstChild:
|
|
|
|
|
nameArea = nodesNewArea[0].firstChild.nodeValue.strip()
|
|
|
|
|
if firstChild(nodesNewArea[0]):
|
|
|
|
|
nameArea = firstChild(nodesNewArea[0]).text.strip()
|
|
|
|
|
flagFindArea = False
|
|
|
|
|
newAreaAction = None
|
|
|
|
|
baseNodes = []
|
|
|
|
|
for oName in nodesNames:
|
|
|
|
|
newAreaAction = self.getActionArea(xmlNewArea)
|
|
|
|
|
oArea = oName.parentNode.parentNode
|
|
|
|
|
oArea = oName.getparent().getparent()
|
|
|
|
|
oNameTxt = ""
|
|
|
|
|
if oName.firstChild:
|
|
|
|
|
oNameTxt = oName.firstChild.nodeValue
|
|
|
|
|
if firstChild(oName):
|
|
|
|
|
oNameTxt = firstChild(oName).text
|
|
|
|
|
if nameArea == oNameTxt:
|
|
|
|
|
flagFindArea = True
|
|
|
|
|
# При использовании удаления
|
|
|
|
|
if newAreaAction == "drop":
|
|
|
|
|
prevNode = oName.parentNode.parentNode.previousSibling
|
|
|
|
|
prevNode = oName.getparent().getparent().getprevious()
|
|
|
|
|
removePrevNodes = []
|
|
|
|
|
while prevNode and self.getTypeField(prevNode) == "br":
|
|
|
|
|
removePrevNodes.append(prevNode)
|
|
|
|
|
prevNode = prevNode.previousSibling
|
|
|
|
|
prevNode = prevNode.getprevious()
|
|
|
|
|
for removeNode in removePrevNodes:
|
|
|
|
|
baseNode.removeChild(removeNode)
|
|
|
|
|
baseNode.removeChild(oName.parentNode.parentNode)
|
|
|
|
|
baseNode.remove(removeNode)
|
|
|
|
|
baseNode.remove(oName.getparent().getparent())
|
|
|
|
|
continue
|
|
|
|
|
elif newAreaAction == "replace":
|
|
|
|
|
oldAreaNode = oName.parentNode.parentNode
|
|
|
|
|
oldAreaNode = oName.getparent().getparent()
|
|
|
|
|
newAreaCaption = xpath.Evaluate('child::caption',
|
|
|
|
|
xmlNewArea)[0]
|
|
|
|
|
oldAreaCaption = xpath.Evaluate('child::caption',
|
|
|
|
@ -701,7 +733,7 @@ class xmlDoc(object):
|
|
|
|
|
baseNode.replaceChild(xmlNewArea,
|
|
|
|
|
oldAreaNode)
|
|
|
|
|
continue
|
|
|
|
|
baseNodes.append(oName.parentNode.parentNode)
|
|
|
|
|
baseNodes.append(oName.getparent().getparent())
|
|
|
|
|
newFields = xpath.Evaluate('child::field', xmlNewArea)
|
|
|
|
|
|
|
|
|
|
joinNewFields = xpath.Evaluate(
|
|
|
|
@ -722,9 +754,12 @@ class xmlDoc(object):
|
|
|
|
|
|
|
|
|
|
def joinDoc(self, xmlNewDoc):
|
|
|
|
|
"""Объединяет два документа"""
|
|
|
|
|
newRootNode = xmlNewDoc.documentElement
|
|
|
|
|
# newRootNode = xmlNewDoc.documentElement
|
|
|
|
|
newRootNode = xmlNewDoc.getroottree()
|
|
|
|
|
newBodyNode = xpath.Evaluate('child::body', newRootNode)[0]
|
|
|
|
|
newImportBodyNode = self.doc.importNode(newBodyNode, True)
|
|
|
|
|
# newImportBodyNode = self.doc.importNode(newBodyNode, True)
|
|
|
|
|
newImportBodyNode = deepcopy(newBodyNode)
|
|
|
|
|
|
|
|
|
|
# Перед объединение области с документом
|
|
|
|
|
# удаляем комментарии
|
|
|
|
|
self.removeComment(newImportBodyNode)
|
|
|
|
@ -736,45 +771,44 @@ class xmlDoc(object):
|
|
|
|
|
"""Выдает текст из поля"""
|
|
|
|
|
xmlQuotes = xpath.Evaluate('child::quote', xmlField)
|
|
|
|
|
br = ""
|
|
|
|
|
if (xmlField.hasAttribute("type") and
|
|
|
|
|
xmlField.getAttribute("type") == "br"):
|
|
|
|
|
if (xmlField.get("type") == "br"):
|
|
|
|
|
br = "\n"
|
|
|
|
|
if xmlQuotes:
|
|
|
|
|
field = xmlQuotes[0]
|
|
|
|
|
if field.firstChild:
|
|
|
|
|
return field.firstChild.nodeValue + br
|
|
|
|
|
if firstChild(field):
|
|
|
|
|
return firstChild(field).text + br
|
|
|
|
|
return "" + br
|
|
|
|
|
|
|
|
|
|
def getFieldsArea(self, xmlArea):
|
|
|
|
|
"""Выдает потомков XML области"""
|
|
|
|
|
xmlFields = []
|
|
|
|
|
childNodes = xmlArea.childNodes
|
|
|
|
|
childNodes = xmlArea.getchildren()
|
|
|
|
|
for node in childNodes:
|
|
|
|
|
if node.nodeType == node.ELEMENT_NODE:
|
|
|
|
|
if node.tagName == "area" or node.tagName == "field":
|
|
|
|
|
xmlFields.append(node)
|
|
|
|
|
# if node.nodeType == node.ELEMENT_NODE:
|
|
|
|
|
if node.tag == "area" or node.tag == "field":
|
|
|
|
|
xmlFields.append(node)
|
|
|
|
|
return xmlFields
|
|
|
|
|
|
|
|
|
|
def getTypeField(self, xmlField):
|
|
|
|
|
"""Выдает тип поля"""
|
|
|
|
|
if xmlField.hasAttribute("type"):
|
|
|
|
|
return xmlField.getAttribute("type")
|
|
|
|
|
if xmlField.get("type"):
|
|
|
|
|
return xmlField.get("type")
|
|
|
|
|
else:
|
|
|
|
|
return False
|
|
|
|
|
|
|
|
|
|
def getNameField(self, xmlField):
|
|
|
|
|
"""Выдает имя поля"""
|
|
|
|
|
xmlNameFields = xpath.Evaluate('child::name', xmlField)
|
|
|
|
|
if xmlNameFields and xmlNameFields[0].firstChild:
|
|
|
|
|
return xmlNameFields[0].firstChild.nodeValue
|
|
|
|
|
if xmlNameFields and firstChild(xmlNameFields[0]):
|
|
|
|
|
return firstChild(xmlNameFields[0]).text
|
|
|
|
|
else:
|
|
|
|
|
return False
|
|
|
|
|
|
|
|
|
|
def getNameArea(self, xmlArea):
|
|
|
|
|
"""Выдает имя области"""
|
|
|
|
|
xmlNameAreas = xpath.Evaluate('child::caption/name', xmlArea)
|
|
|
|
|
if xmlNameAreas and xmlNameAreas[0].firstChild:
|
|
|
|
|
return xmlNameAreas[0].firstChild.nodeValue
|
|
|
|
|
if xmlNameAreas and firstChild(xmlNameAreas[0]):
|
|
|
|
|
return firstChild(xmlNameAreas[0]).text
|
|
|
|
|
else:
|
|
|
|
|
return False
|
|
|
|
|
|
|
|
|
@ -785,8 +819,8 @@ class xmlDoc(object):
|
|
|
|
|
quotes = []
|
|
|
|
|
xmlQuotes = xpath.Evaluate('child::caption/quote', xmlArea)
|
|
|
|
|
for node in xmlQuotes:
|
|
|
|
|
if node.firstChild:
|
|
|
|
|
quotes.append(node.firstChild.nodeValue)
|
|
|
|
|
if firstChild(node):
|
|
|
|
|
quotes.append(firstChild(node).text)
|
|
|
|
|
if len(quotes) == 0:
|
|
|
|
|
quotes.append("")
|
|
|
|
|
quotes.append("")
|
|
|
|
@ -795,14 +829,14 @@ class xmlDoc(object):
|
|
|
|
|
return quotes
|
|
|
|
|
|
|
|
|
|
for i in xmlAreas:
|
|
|
|
|
if i.tagName == "area":
|
|
|
|
|
if i.tag == "area":
|
|
|
|
|
quotesI = getQuotesArea(i)
|
|
|
|
|
startAreaI = quotesI[0]
|
|
|
|
|
endAreaI = quotesI[1]
|
|
|
|
|
text.append(startAreaI)
|
|
|
|
|
xmlFieldsI = self.getFieldsArea(i)
|
|
|
|
|
for f in xmlFieldsI:
|
|
|
|
|
if f.tagName == "area":
|
|
|
|
|
if f.tag == "area":
|
|
|
|
|
quotesF = getQuotesArea(f)
|
|
|
|
|
startAreaF = quotesF[0]
|
|
|
|
|
endAreaF = quotesF[1]
|
|
|
|
@ -821,8 +855,8 @@ class xmlDoc(object):
|
|
|
|
|
def getActionField(self, xmlField):
|
|
|
|
|
"""Выдает свойство action XML поля"""
|
|
|
|
|
xmlActions = xpath.Evaluate('child::action', xmlField)
|
|
|
|
|
if xmlActions and xmlActions[0].firstChild:
|
|
|
|
|
return xmlActions[0].firstChild.nodeValue
|
|
|
|
|
if xmlActions and firstChild(xmlActions[0]):
|
|
|
|
|
return firstChild(xmlActions[0]).text
|
|
|
|
|
else:
|
|
|
|
|
return False
|
|
|
|
|
|
|
|
|
@ -832,24 +866,24 @@ class xmlDoc(object):
|
|
|
|
|
xmlValues = xpath.Evaluate('child::value', xmlField)
|
|
|
|
|
if xmlValues:
|
|
|
|
|
for node in xmlValues:
|
|
|
|
|
if node.firstChild:
|
|
|
|
|
vals.append(node.firstChild.nodeValue)
|
|
|
|
|
if firstChild(node):
|
|
|
|
|
vals.append(firstChild(node).text)
|
|
|
|
|
return vals
|
|
|
|
|
|
|
|
|
|
def getActionArea(self, xmlArea):
|
|
|
|
|
"""Выдает свойство action XML области"""
|
|
|
|
|
xmlActions = xpath.Evaluate('child::caption/action', xmlArea)
|
|
|
|
|
if xmlActions and xmlActions[0].firstChild:
|
|
|
|
|
return xmlActions[0].firstChild.nodeValue
|
|
|
|
|
if xmlActions and firstChild(xmlActions[0]):
|
|
|
|
|
return firstChild(xmlActions[0]).text
|
|
|
|
|
else:
|
|
|
|
|
return False
|
|
|
|
|
|
|
|
|
|
def delActionNodeArea(self, xmlArea):
|
|
|
|
|
"""Удаляет свойство action XML области"""
|
|
|
|
|
xmlActions = xpath.Evaluate('child::caption/action', xmlArea)
|
|
|
|
|
if xmlActions and xmlActions[0].firstChild:
|
|
|
|
|
parentNode = xmlActions[0].parentNode
|
|
|
|
|
parentNode.removeChild(xmlActions[0])
|
|
|
|
|
if xmlActions and firstChild(xmlActions[0]):
|
|
|
|
|
parentNode = xmlActions[0].getparent()
|
|
|
|
|
parentNode.remove(xmlActions[0])
|
|
|
|
|
return True
|
|
|
|
|
else:
|
|
|
|
|
return False
|
|
|
|
@ -857,9 +891,9 @@ class xmlDoc(object):
|
|
|
|
|
def delActionNodeField(self, xmlField):
|
|
|
|
|
"""Удаляет свойство action XML поля"""
|
|
|
|
|
xmlActions = xpath.Evaluate('child::action', xmlField)
|
|
|
|
|
if xmlActions and xmlActions[0].firstChild:
|
|
|
|
|
parentNode = xmlActions[0].parentNode
|
|
|
|
|
parentNode.removeChild(xmlActions[0])
|
|
|
|
|
if xmlActions and firstChild(xmlActions[0]):
|
|
|
|
|
parentNode = xmlActions[0].getparent()
|
|
|
|
|
parentNode.remove(xmlActions[0])
|
|
|
|
|
return True
|
|
|
|
|
else:
|
|
|
|
|
return False
|
|
|
|
@ -872,13 +906,13 @@ class xmlDoc(object):
|
|
|
|
|
# содержит списки нод полей с одинаковыми именами в одной области
|
|
|
|
|
fieldsSeplist = {}
|
|
|
|
|
for node in childNodes:
|
|
|
|
|
if node.tagName == "area":
|
|
|
|
|
if node.tag == "area":
|
|
|
|
|
self.postParserListSeplist(node)
|
|
|
|
|
else:
|
|
|
|
|
fieldName = False
|
|
|
|
|
xmlFieldNameNodes = xpath.Evaluate('child::name', node)
|
|
|
|
|
if xmlFieldNameNodes and xmlFieldNameNodes[0].firstChild:
|
|
|
|
|
fieldName = xmlFieldNameNodes[0].firstChild.nodeValue
|
|
|
|
|
if xmlFieldNameNodes and firstChild(xmlFieldNameNodes[0]):
|
|
|
|
|
fieldName = firstChild(xmlFieldNameNodes[0]).text
|
|
|
|
|
if fieldName:
|
|
|
|
|
if fieldName in fieldsSeplist:
|
|
|
|
|
fieldsSeplist[fieldName].append(node)
|
|
|
|
@ -888,7 +922,7 @@ class xmlDoc(object):
|
|
|
|
|
for listNodes in fieldsSeplist.values():
|
|
|
|
|
if len(listNodes) > 1:
|
|
|
|
|
for node in listNodes:
|
|
|
|
|
node.setAttribute("type", "seplist")
|
|
|
|
|
node.set("type", "seplist")
|
|
|
|
|
|
|
|
|
|
def insertBRtoBody(self, xmlArea):
|
|
|
|
|
"""Добавляет необходимые переводы строк
|
|
|
|
@ -904,26 +938,22 @@ class xmlDoc(object):
|
|
|
|
|
node = childNodes[i]
|
|
|
|
|
lastTmpNode = node
|
|
|
|
|
# Нода area
|
|
|
|
|
if node.tagName == "area":
|
|
|
|
|
if node.tag == "area":
|
|
|
|
|
if self.getActionArea(node) == "append" or \
|
|
|
|
|
self.getActionArea(node) == "join":
|
|
|
|
|
self.delActionNodeArea(node)
|
|
|
|
|
if lastNode and lastNode.hasAttribute("type") and \
|
|
|
|
|
lastNode.getAttribute("type") == "br" or \
|
|
|
|
|
lastNode and lastNode.hasAttribute(
|
|
|
|
|
"type") and \
|
|
|
|
|
lastNode.getAttribute(
|
|
|
|
|
"type") == "comment":
|
|
|
|
|
if lastNode and lastNode.get("type") == "br" or \
|
|
|
|
|
lastNode and lastNode.get("type") == "comment":
|
|
|
|
|
indNext = i + 1
|
|
|
|
|
if indNext == lenChildNodes:
|
|
|
|
|
xmlArea.appendChild(fieldXMLBr.cloneNode(True))
|
|
|
|
|
xmlArea.append(deepcopy(fieldXMLBr))
|
|
|
|
|
else:
|
|
|
|
|
nextNode = childNodes[indNext]
|
|
|
|
|
lastTmpNode = xmlArea.insertBefore(
|
|
|
|
|
fieldXMLBr.cloneNode(True),
|
|
|
|
|
lastTmpNode = insertBefore(xmlArea,
|
|
|
|
|
deepcopy(fieldXMLBr),
|
|
|
|
|
nextNode)
|
|
|
|
|
else:
|
|
|
|
|
xmlArea.insertBefore(fieldXMLBr.cloneNode(True),
|
|
|
|
|
insertBefore(xmlArea, deepcopy(fieldXMLBr),
|
|
|
|
|
node)
|
|
|
|
|
self.insertBRtoBody(node)
|
|
|
|
|
# Нода field
|
|
|
|
@ -931,23 +961,18 @@ class xmlDoc(object):
|
|
|
|
|
if self.getActionField(node) == "append" or \
|
|
|
|
|
self.getActionField(node) == "join":
|
|
|
|
|
self.delActionNodeField(node)
|
|
|
|
|
if lastNode and lastNode.hasAttribute("type") and \
|
|
|
|
|
lastNode.getAttribute("type") == "br" or \
|
|
|
|
|
lastNode and lastNode.hasAttribute(
|
|
|
|
|
"type") and \
|
|
|
|
|
lastNode.getAttribute(
|
|
|
|
|
"type") == "comment":
|
|
|
|
|
if lastNode is not None and lastNode.get("type") == "br" or \
|
|
|
|
|
lastNode is not None and lastNode.get("type") == "comment":
|
|
|
|
|
indNext = i + 1
|
|
|
|
|
if indNext == lenChildNodes:
|
|
|
|
|
xmlArea.appendChild(fieldXMLBr.cloneNode(True))
|
|
|
|
|
xmlArea.append(deepcopy(fieldXMLBr))
|
|
|
|
|
else:
|
|
|
|
|
nextNode = childNodes[indNext]
|
|
|
|
|
lastTmpNode = xmlArea.insertBefore(
|
|
|
|
|
fieldXMLBr.cloneNode(True),
|
|
|
|
|
lastTmpNode = insertBefore(xmlArea,
|
|
|
|
|
deepcopy(fieldXMLBr),
|
|
|
|
|
nextNode)
|
|
|
|
|
else:
|
|
|
|
|
xmlArea.insertBefore(fieldXMLBr.cloneNode(True),
|
|
|
|
|
node)
|
|
|
|
|
insertBefore(xmlArea, deepcopy(fieldXMLBr), node)
|
|
|
|
|
lastNode = lastTmpNode
|
|
|
|
|
|
|
|
|
|
def postParserList(self):
|
|
|
|
@ -964,31 +989,32 @@ class xmlDoc(object):
|
|
|
|
|
for xmlField in xmlFields:
|
|
|
|
|
xmlNames = xpath.Evaluate('child::name', xmlField)
|
|
|
|
|
xmlVals = xpath.Evaluate('child::value', xmlField)
|
|
|
|
|
if xmlField.hasAttribute("type") and \
|
|
|
|
|
xmlField.getAttribute("type") == "br":
|
|
|
|
|
# if xmlField.hasAttribute("type") and \
|
|
|
|
|
# xmlField.getAttribute("type") == "br":
|
|
|
|
|
if xmlField.get("type") == "br":
|
|
|
|
|
lenBrArea += 1
|
|
|
|
|
continue
|
|
|
|
|
if not xmlNames and not xmlVals:
|
|
|
|
|
flagListXml = False
|
|
|
|
|
break
|
|
|
|
|
if xmlNames and xmlNames[0].firstChild and \
|
|
|
|
|
xmlNames[0].firstChild.nodeValue:
|
|
|
|
|
if xmlNames and firstChild(xmlNames[0]) and \
|
|
|
|
|
firstChild(xmlNames[0]).text:
|
|
|
|
|
flagListXml = False
|
|
|
|
|
break
|
|
|
|
|
if not (xmlVals and xmlVals[0].firstChild and
|
|
|
|
|
xmlVals[0].firstChild.nodeValue):
|
|
|
|
|
if not (xmlVals and firstChild(xmlVals[0]) and
|
|
|
|
|
firstChild(xmlVals[0]).text):
|
|
|
|
|
flagListXml = False
|
|
|
|
|
break
|
|
|
|
|
else:
|
|
|
|
|
fieldValues.append(xmlVals[0].firstChild.nodeValue)
|
|
|
|
|
fieldValues.append(firstChild(xmlVals[0]).text)
|
|
|
|
|
|
|
|
|
|
if lenXmlFields == lenBrArea:
|
|
|
|
|
flagListXml = False
|
|
|
|
|
if flagListXml:
|
|
|
|
|
nameNode = xpath.Evaluate('child::caption/name', xmlArea)[0]
|
|
|
|
|
fieldName = ""
|
|
|
|
|
if nameNode.firstChild:
|
|
|
|
|
fieldName = nameNode.firstChild.nodeValue
|
|
|
|
|
if firstChild(nameNode):
|
|
|
|
|
fieldName = firstChild(nameNode).text
|
|
|
|
|
listArea = []
|
|
|
|
|
self.xmlToText([xmlArea], listArea)
|
|
|
|
|
fieldQuote = "".join(listArea)
|
|
|
|
@ -1004,8 +1030,8 @@ class xmlDoc(object):
|
|
|
|
|
areaAction = self.getActionArea(xmlArea)
|
|
|
|
|
if areaAction:
|
|
|
|
|
self.setActionField(fieldXML, areaAction)
|
|
|
|
|
parentNode = xmlArea.parentNode
|
|
|
|
|
parentNode.insertBefore(fieldXML, xmlArea)
|
|
|
|
|
parentNode = xmlArea.getparent()
|
|
|
|
|
insertBefore(parentNode, fieldXML, xmlArea)
|
|
|
|
|
if fieldXMLBr:
|
|
|
|
|
parentNode.insertBefore(fieldXMLBr, xmlArea)
|
|
|
|
|
parentNode.removeChild(xmlArea)
|
|
|
|
|
insertBefore(parentNode, fieldXMLBr, xmlArea)
|
|
|
|
|
parentNode.remove(xmlArea)
|
|
|
|
|