Fixed for XSLT
This commit is contained in:
@@ -99,10 +99,11 @@ def xslt(source: str, xslt: str) -> str:
|
|||||||
:param xslt: XSLT string used to transformate XML
|
:param xslt: XSLT string used to transformate XML
|
||||||
:return: Result of transformation
|
:return: Result of transformation
|
||||||
"""
|
"""
|
||||||
xslt_transform = etree.XSLT(etree.XML(xslt))
|
xslt_input = BytesIO(xslt.encode("utf-8"))
|
||||||
|
xslt_transform = etree.XSLT(etree.parse(xslt_input).getroot())
|
||||||
|
|
||||||
xml = etree.XML(source)
|
document_input = BytesIO(source.encode("utf-8"))
|
||||||
|
xml = etree.parse(document_input).getroot()
|
||||||
|
|
||||||
transformated = xslt_transform(xml)
|
transformated = xslt_transform(xml)
|
||||||
print(transformated)
|
|
||||||
return str(transformated)
|
return str(transformated)
|
||||||
Reference in New Issue
Block a user