import os
from textwrap import dedent
from sympy.external import import_module
from sympy.testing.pytest import skip
from sympy.utilities.mathml import apply_xsl
lxml = import_module('lxml')
path = os.path.abspath(os.path.join(os.path.dirname(__file__), "test_xxe.py"))
def test_xxe():
assert os.path.isfile(path)
if not lxml:
skip("lxml not installed.")
mml = dedent(
rf"""
]>
John
&ent;
"""
)
xsl = 'mathml/data/simple_mmlctop.xsl'
res = apply_xsl(mml, xsl)
assert res == \
'\n\nJohn\n\n\n'