XML kann mit Python generiert werden
pip install -e git+git://github.com/5monkeys/easyxml.git@develop#egg=easyxml
Installieren Sie mit dem obigen Befehl
easyxml.py
# -*- coding: utf-8 -*-
from easyxml import EasyXML
books = EasyXML('books')
books.book(title='Example A')
books.book.author(name='John Smith', age=57)
books.book.publisher(name='Publisher A')
books.book(title='Example B')
books.book.author(name='Jane Doe', age=30)
books.book.author(name='James Cutter', age=45)
books.book.publisher(name='Publisher B')
print str(books)
# <?xml version="1.0" ?><books><book title="Example A"><author age="57" name="John Smith"/><publisher name="Publisher A"/></book><book title="Example B"><author age="30" name="Jane Doe"/><author age="45" name="James Cutter"/><publisher name="Publisher B"/></book></books>
Die Ausgabe-XML ist nicht kaputt ...
Recommended Posts