用Python解析XML(1)
One of the common tasks I am given in my day job is to take some data format input and parse it to create a report or some other document. Today we'll look at taking some XML input, parsing it with the Python programming language and then creating a letter in PDF format using Reportlab, a 3rd party package for Python. Let's say my company receives an order for three items that I need to fulfill.
The XML for that could look like the following code:
02.
03.456789
04.789654
05.John Doe
06.123 Dickens Road
07.Johnston, IA 55555
08.
09.
10.
11.11123
12.Expo Dry Erase Pen
13.1.99
14.5
15.
16.
17.22245
18.Cisco IP Phone 7942
19.300
20.1
21.
22.
23.33378
24.Waste Basket
25.9.99
26.1
27.
28.
29.
The XML for that could look like the following code:
CODE:
01.02.
03.
04.
05.
06.
07.
08.
09.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/301743/viewspace-736308/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 用Python解析XML(2)PythonXML
- 用Python解析XML(3)PythonXML
- Python解析xml[xml.dom]PythonXML
- python之XML解析PythonXML
- python 的xml解析PythonXML
- Python XML解析之DOMPythonXML
- python使用SAX解析xmlPythonXML
- python XML 檔案解析PythonXML
- XML的JAVA 解析(一)(1) (轉)XMLJava
- 用c#生成xml字串及解析xml字串C#XML字串
- Python解析XML檔案生成HTMLPythonXMLHTML
- python 解析xml 檔案: SAX方式PythonXML
- python 解析xml 檔案: DOM 方式PythonXML
- Python解析xml大檔案(sax)PythonXML
- python 解析xml 檔案: Element Tree 方式PythonXML
- Xml解析XML
- iOS – XML解析iOSXML
- go 解析xmlGoXML
- xml php 解析XMLPHP
- iOS - XML解析iOSXML
- 【Java】解析xmlJavaXML
- Java解析XMLJavaXML
- jaxb解析xmlXML
- DOM解析XMLXML
- solrconfig.xml 應用解析調優SolrXML
- 用dom4j,解析xml 最好、最方便!XML
- 用Java結合SAX 2.0 解析XML文件 (轉)JavaXML
- 曹工說Tomcat1:從XML解析說起TomcatXML
- 175.XML解析XML
- C# XML解析C#XML
- 使用jdom解析XMLXML
- 解析xml筆記XML筆記
- XML解析技術XML
- xml解析之domXML
- XML資料解析XML
- 關於xml解析XML
- 用Python解析XMindPython
- 讀取xml檔案 解析雙層xmlXML