se extendie NominaIndividualDeAjuste de NominaIndividual
FossilOrigin-Name: 10b3af439bee9b932e4f5067bec0768af60e514f595e00ecb1bdf7c88c39afc1
This commit is contained in:
@@ -455,5 +455,16 @@ class FachoXML:
|
||||
def tostring(self, **kw):
|
||||
return self.builder.tostring(self.root, **kw)
|
||||
|
||||
def xpath_from_root(self, xpath):
|
||||
nsmap = {}
|
||||
ns = ''
|
||||
|
||||
if isinstance(self.nsmap, dict):
|
||||
nsmap = dict(map(reversed, self.nsmap.items()))
|
||||
ns = nsmap[etree.QName(self.root).namespace] + ':'
|
||||
|
||||
new_xpath = '/' + ns + etree.QName(self.root).localname + '/' + xpath.lstrip('/')
|
||||
return new_xpath
|
||||
|
||||
def __str__(self):
|
||||
return self.tostring()
|
||||
|
||||
Reference in New Issue
Block a user