<div dir="ltr">I am trying to merge two xmls using xslt in python but the content of first xml is not getting copied. The rules written in xsl file created are correct because if I am executing it without python (directly from eclipse as I have xslt plugin installed) it is getting merged fine. Can anybody help me? I am pasting my code snippet below:<div>
<br></div><div><div><b><font color="#cc0000">import lxml.etree as ET</font></b></div><div><b><font color="#cc0000"><br></font></b></div><div><b><font color="#cc0000">dom = ET.parse(r'test_file_2.xml')</font></b></div>
<div><b><font color="#cc0000">xslt = ET.parse(r'TestMergeRules.xsl')</font></b></div><div><b><font color="#cc0000">transform = ET.XSLT(xslt)</font></b></div><div><b><font color="#cc0000">print transform</font></b></div>
<div><b><font color="#cc0000">newdom = transform(dom)</font></b></div><div><b><font color="#cc0000">print(ET.tostring(newdom, pretty_print=True))</font></b></div><div><br></div><div>I am opening other xml file (test_file_1.xml) in xsl file using "document()" function.</div>
<div>Once this code is executed I can see only the content of test_file_2.xml.</div><div>Am I doing something wrong? Is there any other way to do this because my xslt rules are working fine without python.<br></div></div>
<div><br></div><div>Thanks,</div><div>BR,</div><div>Varun</div><div><br></div><div><br></div></div>