Overview : Python 에서 xslt 를 적용해 보자.
1.PyCharm
2.Source
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
import lxml.etree as ET from flask import Flask app = Flask(__name__) @app.route('/') def hello_world(): dom = ET.parse('LowFareSearchRsp.xml') xslt = ET.parse('LowFare.xslt') transform = ET.XSLT(xslt) newdom = transform(dom) return ET.tostring(newdom, method="html") if __name__ == '__main__': app.run() |