Edit File by line
/home/barbar84/www/wp-conte.../plugins/sujqvwi/AnonR/anonr.TX.../usr/lib64/python3..../xml/etree
File: ElementTree.py
"""Lightweight XML support for Python.
[0] Fix | Delete
[1] Fix | Delete
XML is an inherently hierarchical data format, and the most natural way to
[2] Fix | Delete
represent it is with a tree. This module has two classes for this purpose:
[3] Fix | Delete
[4] Fix | Delete
1. ElementTree represents the whole XML document as a tree and
[5] Fix | Delete
[6] Fix | Delete
2. Element represents a single node in this tree.
[7] Fix | Delete
[8] Fix | Delete
Interactions with the whole document (reading and writing to/from files) are
[9] Fix | Delete
usually done on the ElementTree level. Interactions with a single XML element
[10] Fix | Delete
and its sub-elements are done on the Element level.
[11] Fix | Delete
[12] Fix | Delete
Element is a flexible container object designed to store hierarchical data
[13] Fix | Delete
structures in memory. It can be described as a cross between a list and a
[14] Fix | Delete
dictionary. Each Element has a number of properties associated with it:
[15] Fix | Delete
[16] Fix | Delete
'tag' - a string containing the element's name.
[17] Fix | Delete
[18] Fix | Delete
'attributes' - a Python dictionary storing the element's attributes.
[19] Fix | Delete
[20] Fix | Delete
'text' - a string containing the element's text content.
[21] Fix | Delete
[22] Fix | Delete
'tail' - an optional string containing text after the element's end tag.
[23] Fix | Delete
[24] Fix | Delete
And a number of child elements stored in a Python sequence.
[25] Fix | Delete
[26] Fix | Delete
To create an element instance, use the Element constructor,
[27] Fix | Delete
or the SubElement factory function.
[28] Fix | Delete
[29] Fix | Delete
You can also use the ElementTree class to wrap an element structure
[30] Fix | Delete
and convert it to and from XML.
[31] Fix | Delete
[32] Fix | Delete
"""
[33] Fix | Delete
[34] Fix | Delete
#---------------------------------------------------------------------
[35] Fix | Delete
# Licensed to PSF under a Contributor Agreement.
[36] Fix | Delete
# See http://www.python.org/psf/license for licensing details.
[37] Fix | Delete
#
[38] Fix | Delete
# ElementTree
[39] Fix | Delete
# Copyright (c) 1999-2008 by Fredrik Lundh. All rights reserved.
[40] Fix | Delete
#
[41] Fix | Delete
# fredrik@pythonware.com
[42] Fix | Delete
# http://www.pythonware.com
[43] Fix | Delete
# --------------------------------------------------------------------
[44] Fix | Delete
# The ElementTree toolkit is
[45] Fix | Delete
#
[46] Fix | Delete
# Copyright (c) 1999-2008 by Fredrik Lundh
[47] Fix | Delete
#
[48] Fix | Delete
# By obtaining, using, and/or copying this software and/or its
[49] Fix | Delete
# associated documentation, you agree that you have read, understood,
[50] Fix | Delete
# and will comply with the following terms and conditions:
[51] Fix | Delete
#
[52] Fix | Delete
# Permission to use, copy, modify, and distribute this software and
[53] Fix | Delete
# its associated documentation for any purpose and without fee is
[54] Fix | Delete
# hereby granted, provided that the above copyright notice appears in
[55] Fix | Delete
# all copies, and that both that copyright notice and this permission
[56] Fix | Delete
# notice appear in supporting documentation, and that the name of
[57] Fix | Delete
# Secret Labs AB or the author not be used in advertising or publicity
[58] Fix | Delete
# pertaining to distribution of the software without specific, written
[59] Fix | Delete
# prior permission.
[60] Fix | Delete
#
[61] Fix | Delete
# SECRET LABS AB AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD
[62] Fix | Delete
# TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANT-
[63] Fix | Delete
# ABILITY AND FITNESS. IN NO EVENT SHALL SECRET LABS AB OR THE AUTHOR
[64] Fix | Delete
# BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
[65] Fix | Delete
# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
[66] Fix | Delete
# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
[67] Fix | Delete
# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
[68] Fix | Delete
# OF THIS SOFTWARE.
[69] Fix | Delete
# --------------------------------------------------------------------
[70] Fix | Delete
[71] Fix | Delete
__all__ = [
[72] Fix | Delete
# public symbols
[73] Fix | Delete
"Comment",
[74] Fix | Delete
"dump",
[75] Fix | Delete
"Element", "ElementTree",
[76] Fix | Delete
"fromstring", "fromstringlist",
[77] Fix | Delete
"iselement", "iterparse",
[78] Fix | Delete
"parse", "ParseError",
[79] Fix | Delete
"PI", "ProcessingInstruction",
[80] Fix | Delete
"QName",
[81] Fix | Delete
"SubElement",
[82] Fix | Delete
"tostring", "tostringlist",
[83] Fix | Delete
"TreeBuilder",
[84] Fix | Delete
"VERSION",
[85] Fix | Delete
"XML", "XMLID",
[86] Fix | Delete
"XMLParser", "XMLPullParser",
[87] Fix | Delete
"register_namespace",
[88] Fix | Delete
]
[89] Fix | Delete
[90] Fix | Delete
VERSION = "1.3.0"
[91] Fix | Delete
[92] Fix | Delete
import sys
[93] Fix | Delete
import re
[94] Fix | Delete
import warnings
[95] Fix | Delete
import io
[96] Fix | Delete
import collections
[97] Fix | Delete
import contextlib
[98] Fix | Delete
[99] Fix | Delete
from . import ElementPath
[100] Fix | Delete
[101] Fix | Delete
[102] Fix | Delete
class ParseError(SyntaxError):
[103] Fix | Delete
"""An error when parsing an XML document.
[104] Fix | Delete
[105] Fix | Delete
In addition to its exception value, a ParseError contains
[106] Fix | Delete
two extra attributes:
[107] Fix | Delete
'code' - the specific exception code
[108] Fix | Delete
'position' - the line and column of the error
[109] Fix | Delete
[110] Fix | Delete
"""
[111] Fix | Delete
pass
[112] Fix | Delete
[113] Fix | Delete
# --------------------------------------------------------------------
[114] Fix | Delete
[115] Fix | Delete
[116] Fix | Delete
def iselement(element):
[117] Fix | Delete
"""Return True if *element* appears to be an Element."""
[118] Fix | Delete
return hasattr(element, 'tag')
[119] Fix | Delete
[120] Fix | Delete
[121] Fix | Delete
class Element:
[122] Fix | Delete
"""An XML element.
[123] Fix | Delete
[124] Fix | Delete
This class is the reference implementation of the Element interface.
[125] Fix | Delete
[126] Fix | Delete
An element's length is its number of subelements. That means if you
[127] Fix | Delete
want to check if an element is truly empty, you should check BOTH
[128] Fix | Delete
its length AND its text attribute.
[129] Fix | Delete
[130] Fix | Delete
The element tag, attribute names, and attribute values can be either
[131] Fix | Delete
bytes or strings.
[132] Fix | Delete
[133] Fix | Delete
*tag* is the element name. *attrib* is an optional dictionary containing
[134] Fix | Delete
element attributes. *extra* are additional element attributes given as
[135] Fix | Delete
keyword arguments.
[136] Fix | Delete
[137] Fix | Delete
Example form:
[138] Fix | Delete
<tag attrib>text<child/>...</tag>tail
[139] Fix | Delete
[140] Fix | Delete
"""
[141] Fix | Delete
[142] Fix | Delete
tag = None
[143] Fix | Delete
"""The element's name."""
[144] Fix | Delete
[145] Fix | Delete
attrib = None
[146] Fix | Delete
"""Dictionary of the element's attributes."""
[147] Fix | Delete
[148] Fix | Delete
text = None
[149] Fix | Delete
"""
[150] Fix | Delete
Text before first subelement. This is either a string or the value None.
[151] Fix | Delete
Note that if there is no text, this attribute may be either
[152] Fix | Delete
None or the empty string, depending on the parser.
[153] Fix | Delete
[154] Fix | Delete
"""
[155] Fix | Delete
[156] Fix | Delete
tail = None
[157] Fix | Delete
"""
[158] Fix | Delete
Text after this element's end tag, but before the next sibling element's
[159] Fix | Delete
start tag. This is either a string or the value None. Note that if there
[160] Fix | Delete
was no text, this attribute may be either None or an empty string,
[161] Fix | Delete
depending on the parser.
[162] Fix | Delete
[163] Fix | Delete
"""
[164] Fix | Delete
[165] Fix | Delete
def __init__(self, tag, attrib={}, **extra):
[166] Fix | Delete
if not isinstance(attrib, dict):
[167] Fix | Delete
raise TypeError("attrib must be dict, not %s" % (
[168] Fix | Delete
attrib.__class__.__name__,))
[169] Fix | Delete
attrib = attrib.copy()
[170] Fix | Delete
attrib.update(extra)
[171] Fix | Delete
self.tag = tag
[172] Fix | Delete
self.attrib = attrib
[173] Fix | Delete
self._children = []
[174] Fix | Delete
[175] Fix | Delete
def __repr__(self):
[176] Fix | Delete
return "<%s %r at %#x>" % (self.__class__.__name__, self.tag, id(self))
[177] Fix | Delete
[178] Fix | Delete
def makeelement(self, tag, attrib):
[179] Fix | Delete
"""Create a new element with the same type.
[180] Fix | Delete
[181] Fix | Delete
*tag* is a string containing the element name.
[182] Fix | Delete
*attrib* is a dictionary containing the element attributes.
[183] Fix | Delete
[184] Fix | Delete
Do not call this method, use the SubElement factory function instead.
[185] Fix | Delete
[186] Fix | Delete
"""
[187] Fix | Delete
return self.__class__(tag, attrib)
[188] Fix | Delete
[189] Fix | Delete
def copy(self):
[190] Fix | Delete
"""Return copy of current element.
[191] Fix | Delete
[192] Fix | Delete
This creates a shallow copy. Subelements will be shared with the
[193] Fix | Delete
original tree.
[194] Fix | Delete
[195] Fix | Delete
"""
[196] Fix | Delete
elem = self.makeelement(self.tag, self.attrib)
[197] Fix | Delete
elem.text = self.text
[198] Fix | Delete
elem.tail = self.tail
[199] Fix | Delete
elem[:] = self
[200] Fix | Delete
return elem
[201] Fix | Delete
[202] Fix | Delete
def __len__(self):
[203] Fix | Delete
return len(self._children)
[204] Fix | Delete
[205] Fix | Delete
def __bool__(self):
[206] Fix | Delete
warnings.warn(
[207] Fix | Delete
"The behavior of this method will change in future versions. "
[208] Fix | Delete
"Use specific 'len(elem)' or 'elem is not None' test instead.",
[209] Fix | Delete
FutureWarning, stacklevel=2
[210] Fix | Delete
)
[211] Fix | Delete
return len(self._children) != 0 # emulate old behaviour, for now
[212] Fix | Delete
[213] Fix | Delete
def __getitem__(self, index):
[214] Fix | Delete
return self._children[index]
[215] Fix | Delete
[216] Fix | Delete
def __setitem__(self, index, element):
[217] Fix | Delete
# if isinstance(index, slice):
[218] Fix | Delete
# for elt in element:
[219] Fix | Delete
# assert iselement(elt)
[220] Fix | Delete
# else:
[221] Fix | Delete
# assert iselement(element)
[222] Fix | Delete
self._children[index] = element
[223] Fix | Delete
[224] Fix | Delete
def __delitem__(self, index):
[225] Fix | Delete
del self._children[index]
[226] Fix | Delete
[227] Fix | Delete
def append(self, subelement):
[228] Fix | Delete
"""Add *subelement* to the end of this element.
[229] Fix | Delete
[230] Fix | Delete
The new element will appear in document order after the last existing
[231] Fix | Delete
subelement (or directly after the text, if it's the first subelement),
[232] Fix | Delete
but before the end tag for this element.
[233] Fix | Delete
[234] Fix | Delete
"""
[235] Fix | Delete
self._assert_is_element(subelement)
[236] Fix | Delete
self._children.append(subelement)
[237] Fix | Delete
[238] Fix | Delete
def extend(self, elements):
[239] Fix | Delete
"""Append subelements from a sequence.
[240] Fix | Delete
[241] Fix | Delete
*elements* is a sequence with zero or more elements.
[242] Fix | Delete
[243] Fix | Delete
"""
[244] Fix | Delete
for element in elements:
[245] Fix | Delete
self._assert_is_element(element)
[246] Fix | Delete
self._children.extend(elements)
[247] Fix | Delete
[248] Fix | Delete
def insert(self, index, subelement):
[249] Fix | Delete
"""Insert *subelement* at position *index*."""
[250] Fix | Delete
self._assert_is_element(subelement)
[251] Fix | Delete
self._children.insert(index, subelement)
[252] Fix | Delete
[253] Fix | Delete
def _assert_is_element(self, e):
[254] Fix | Delete
# Need to refer to the actual Python implementation, not the
[255] Fix | Delete
# shadowing C implementation.
[256] Fix | Delete
if not isinstance(e, _Element_Py):
[257] Fix | Delete
raise TypeError('expected an Element, not %s' % type(e).__name__)
[258] Fix | Delete
[259] Fix | Delete
def remove(self, subelement):
[260] Fix | Delete
"""Remove matching subelement.
[261] Fix | Delete
[262] Fix | Delete
Unlike the find methods, this method compares elements based on
[263] Fix | Delete
identity, NOT ON tag value or contents. To remove subelements by
[264] Fix | Delete
other means, the easiest way is to use a list comprehension to
[265] Fix | Delete
select what elements to keep, and then use slice assignment to update
[266] Fix | Delete
the parent element.
[267] Fix | Delete
[268] Fix | Delete
ValueError is raised if a matching element could not be found.
[269] Fix | Delete
[270] Fix | Delete
"""
[271] Fix | Delete
# assert iselement(element)
[272] Fix | Delete
self._children.remove(subelement)
[273] Fix | Delete
[274] Fix | Delete
def getchildren(self):
[275] Fix | Delete
"""(Deprecated) Return all subelements.
[276] Fix | Delete
[277] Fix | Delete
Elements are returned in document order.
[278] Fix | Delete
[279] Fix | Delete
"""
[280] Fix | Delete
warnings.warn(
[281] Fix | Delete
"This method will be removed in future versions. "
[282] Fix | Delete
"Use 'list(elem)' or iteration over elem instead.",
[283] Fix | Delete
DeprecationWarning, stacklevel=2
[284] Fix | Delete
)
[285] Fix | Delete
return self._children
[286] Fix | Delete
[287] Fix | Delete
def find(self, path, namespaces=None):
[288] Fix | Delete
"""Find first matching element by tag name or path.
[289] Fix | Delete
[290] Fix | Delete
*path* is a string having either an element tag or an XPath,
[291] Fix | Delete
*namespaces* is an optional mapping from namespace prefix to full name.
[292] Fix | Delete
[293] Fix | Delete
Return the first matching element, or None if no element was found.
[294] Fix | Delete
[295] Fix | Delete
"""
[296] Fix | Delete
return ElementPath.find(self, path, namespaces)
[297] Fix | Delete
[298] Fix | Delete
def findtext(self, path, default=None, namespaces=None):
[299] Fix | Delete
"""Find text for first matching element by tag name or path.
[300] Fix | Delete
[301] Fix | Delete
*path* is a string having either an element tag or an XPath,
[302] Fix | Delete
*default* is the value to return if the element was not found,
[303] Fix | Delete
*namespaces* is an optional mapping from namespace prefix to full name.
[304] Fix | Delete
[305] Fix | Delete
Return text content of first matching element, or default value if
[306] Fix | Delete
none was found. Note that if an element is found having no text
[307] Fix | Delete
content, the empty string is returned.
[308] Fix | Delete
[309] Fix | Delete
"""
[310] Fix | Delete
return ElementPath.findtext(self, path, default, namespaces)
[311] Fix | Delete
[312] Fix | Delete
def findall(self, path, namespaces=None):
[313] Fix | Delete
"""Find all matching subelements by tag name or path.
[314] Fix | Delete
[315] Fix | Delete
*path* is a string having either an element tag or an XPath,
[316] Fix | Delete
*namespaces* is an optional mapping from namespace prefix to full name.
[317] Fix | Delete
[318] Fix | Delete
Returns list containing all matching elements in document order.
[319] Fix | Delete
[320] Fix | Delete
"""
[321] Fix | Delete
return ElementPath.findall(self, path, namespaces)
[322] Fix | Delete
[323] Fix | Delete
def iterfind(self, path, namespaces=None):
[324] Fix | Delete
"""Find all matching subelements by tag name or path.
[325] Fix | Delete
[326] Fix | Delete
*path* is a string having either an element tag or an XPath,
[327] Fix | Delete
*namespaces* is an optional mapping from namespace prefix to full name.
[328] Fix | Delete
[329] Fix | Delete
Return an iterable yielding all matching elements in document order.
[330] Fix | Delete
[331] Fix | Delete
"""
[332] Fix | Delete
return ElementPath.iterfind(self, path, namespaces)
[333] Fix | Delete
[334] Fix | Delete
def clear(self):
[335] Fix | Delete
"""Reset element.
[336] Fix | Delete
[337] Fix | Delete
This function removes all subelements, clears all attributes, and sets
[338] Fix | Delete
the text and tail attributes to None.
[339] Fix | Delete
[340] Fix | Delete
"""
[341] Fix | Delete
self.attrib.clear()
[342] Fix | Delete
self._children = []
[343] Fix | Delete
self.text = self.tail = None
[344] Fix | Delete
[345] Fix | Delete
def get(self, key, default=None):
[346] Fix | Delete
"""Get element attribute.
[347] Fix | Delete
[348] Fix | Delete
Equivalent to attrib.get, but some implementations may handle this a
[349] Fix | Delete
bit more efficiently. *key* is what attribute to look for, and
[350] Fix | Delete
*default* is what to return if the attribute was not found.
[351] Fix | Delete
[352] Fix | Delete
Returns a string containing the attribute value, or the default if
[353] Fix | Delete
attribute was not found.
[354] Fix | Delete
[355] Fix | Delete
"""
[356] Fix | Delete
return self.attrib.get(key, default)
[357] Fix | Delete
[358] Fix | Delete
def set(self, key, value):
[359] Fix | Delete
"""Set element attribute.
[360] Fix | Delete
[361] Fix | Delete
Equivalent to attrib[key] = value, but some implementations may handle
[362] Fix | Delete
this a bit more efficiently. *key* is what attribute to set, and
[363] Fix | Delete
*value* is the attribute value to set it to.
[364] Fix | Delete
[365] Fix | Delete
"""
[366] Fix | Delete
self.attrib[key] = value
[367] Fix | Delete
[368] Fix | Delete
def keys(self):
[369] Fix | Delete
"""Get list of attribute names.
[370] Fix | Delete
[371] Fix | Delete
Names are returned in an arbitrary order, just like an ordinary
[372] Fix | Delete
Python dict. Equivalent to attrib.keys()
[373] Fix | Delete
[374] Fix | Delete
"""
[375] Fix | Delete
return self.attrib.keys()
[376] Fix | Delete
[377] Fix | Delete
def items(self):
[378] Fix | Delete
"""Get element attributes as a sequence.
[379] Fix | Delete
[380] Fix | Delete
The attributes are returned in arbitrary order. Equivalent to
[381] Fix | Delete
attrib.items().
[382] Fix | Delete
[383] Fix | Delete
Return a list of (name, value) tuples.
[384] Fix | Delete
[385] Fix | Delete
"""
[386] Fix | Delete
return self.attrib.items()
[387] Fix | Delete
[388] Fix | Delete
def iter(self, tag=None):
[389] Fix | Delete
"""Create tree iterator.
[390] Fix | Delete
[391] Fix | Delete
The iterator loops over the element and all subelements in document
[392] Fix | Delete
order, returning all elements with a matching tag.
[393] Fix | Delete
[394] Fix | Delete
If the tree structure is modified during iteration, new or removed
[395] Fix | Delete
elements may or may not be included. To get a stable set, use the
[396] Fix | Delete
list() function on the iterator, and loop over the resulting list.
[397] Fix | Delete
[398] Fix | Delete
*tag* is what tags to look for (default is to return all elements)
[399] Fix | Delete
[400] Fix | Delete
Return an iterator containing all the matching elements.
[401] Fix | Delete
[402] Fix | Delete
"""
[403] Fix | Delete
if tag == "*":
[404] Fix | Delete
tag = None
[405] Fix | Delete
if tag is None or self.tag == tag:
[406] Fix | Delete
yield self
[407] Fix | Delete
for e in self._children:
[408] Fix | Delete
yield from e.iter(tag)
[409] Fix | Delete
[410] Fix | Delete
# compatibility
[411] Fix | Delete
def getiterator(self, tag=None):
[412] Fix | Delete
# Change for a DeprecationWarning in 1.4
[413] Fix | Delete
warnings.warn(
[414] Fix | Delete
"This method will be removed in future versions. "
[415] Fix | Delete
"Use 'elem.iter()' or 'list(elem.iter())' instead.",
[416] Fix | Delete
PendingDeprecationWarning, stacklevel=2
[417] Fix | Delete
)
[418] Fix | Delete
return list(self.iter(tag))
[419] Fix | Delete
[420] Fix | Delete
def itertext(self):
[421] Fix | Delete
"""Create text iterator.
[422] Fix | Delete
[423] Fix | Delete
The iterator loops over the element and all subelements in document
[424] Fix | Delete
order, returning all inner text.
[425] Fix | Delete
[426] Fix | Delete
"""
[427] Fix | Delete
tag = self.tag
[428] Fix | Delete
if not isinstance(tag, str) and tag is not None:
[429] Fix | Delete
return
[430] Fix | Delete
t = self.text
[431] Fix | Delete
if t:
[432] Fix | Delete
yield t
[433] Fix | Delete
for e in self:
[434] Fix | Delete
yield from e.itertext()
[435] Fix | Delete
t = e.tail
[436] Fix | Delete
if t:
[437] Fix | Delete
yield t
[438] Fix | Delete
[439] Fix | Delete
[440] Fix | Delete
def SubElement(parent, tag, attrib={}, **extra):
[441] Fix | Delete
"""Subelement factory which creates an element instance, and appends it
[442] Fix | Delete
to an existing parent.
[443] Fix | Delete
[444] Fix | Delete
The element tag, attribute names, and attribute values can be either
[445] Fix | Delete
bytes or Unicode strings.
[446] Fix | Delete
[447] Fix | Delete
*parent* is the parent element, *tag* is the subelements name, *attrib* is
[448] Fix | Delete
an optional directory containing element attributes, *extra* are
[449] Fix | Delete
additional attributes given as keyword arguments.
[450] Fix | Delete
[451] Fix | Delete
"""
[452] Fix | Delete
attrib = attrib.copy()
[453] Fix | Delete
attrib.update(extra)
[454] Fix | Delete
element = parent.makeelement(tag, attrib)
[455] Fix | Delete
parent.append(element)
[456] Fix | Delete
return element
[457] Fix | Delete
[458] Fix | Delete
[459] Fix | Delete
def Comment(text=None):
[460] Fix | Delete
"""Comment element factory.
[461] Fix | Delete
[462] Fix | Delete
This function creates a special element which the standard serializer
[463] Fix | Delete
serializes as an XML comment.
[464] Fix | Delete
[465] Fix | Delete
*text* is a string containing the comment string.
[466] Fix | Delete
[467] Fix | Delete
"""
[468] Fix | Delete
element = Element(Comment)
[469] Fix | Delete
element.text = text
[470] Fix | Delete
return element
[471] Fix | Delete
[472] Fix | Delete
[473] Fix | Delete
def ProcessingInstruction(target, text=None):
[474] Fix | Delete
"""Processing Instruction element factory.
[475] Fix | Delete
[476] Fix | Delete
This function creates a special element which the standard serializer
[477] Fix | Delete
serializes as an XML comment.
[478] Fix | Delete
[479] Fix | Delete
*target* is a string containing the processing instruction, *text* is a
[480] Fix | Delete
string containing the processing instruction contents, if any.
[481] Fix | Delete
[482] Fix | Delete
"""
[483] Fix | Delete
element = Element(ProcessingInstruction)
[484] Fix | Delete
element.text = target
[485] Fix | Delete
if text:
[486] Fix | Delete
element.text = element.text + " " + text
[487] Fix | Delete
return element
[488] Fix | Delete
[489] Fix | Delete
PI = ProcessingInstruction
[490] Fix | Delete
[491] Fix | Delete
[492] Fix | Delete
class QName:
[493] Fix | Delete
"""Qualified name wrapper.
[494] Fix | Delete
[495] Fix | Delete
This class can be used to wrap a QName attribute value in order to get
[496] Fix | Delete
proper namespace handing on output.
[497] Fix | Delete
[498] Fix | Delete
*text_or_uri* is a string containing the QName value either in the form
[499] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function