Python论坛  - 讨论区

标题:[python-chinese] 请教关于如何生成xml

2006年08月02日 星期三 14:30

hijack9 hijack9 at gmail.com
Wed Aug 2 14:30:50 HKT 2006

用于生成XML文档的包可以用哪些啊 大家提供几个
找了很多资料 大部分都是解析xml的
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.exoweb.net/pipermail/python-chinese/attachments/20060802/c673dbfc/attachment.html

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2006年08月02日 星期三 14:40

lubiao lubiao.py at gmail.com
Wed Aug 2 14:40:07 HKT 2006

 能读的几乎都能写

On 8/2/06, hijack9 <hijack9 at gmail.com> wrote:
>
>  用于生成XML文档的包可以用哪些啊 大家提供几个
> 找了很多资料 大部分都是解析xml的
>
> _______________________________________________
> python-chinese
> Post: send python-chinese at lists.python.cn
> Subscribe: send subscribe to python-chinese-request at lists.python.cn
> Unsubscribe: send unsubscribe to  python-chinese-request at lists.python.cn
> Detail Info: http://python.cn/mailman/listinfo/python-chinese
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.exoweb.net/pipermail/python-chinese/attachments/20060802/e1aba9ab/attachment.html

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2006年08月02日 星期三 14:41

lubiao lubiao.py at gmail.com
Wed Aug 2 14:41:49 HKT 2006

用  elementtree 把,挺好用的。
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.exoweb.net/pipermail/python-chinese/attachments/20060802/e5b132e7/attachment.htm

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2006年08月02日 星期三 15:30

yi huang yi.codeplayer at gmail.com
Wed Aug 2 15:30:34 HKT 2006

生成xml比解析xml简单多了,不需要那么复杂的库,推荐py,其中有个部分是做xml/html生成的.

With ``py.xml.Namespace`` you have the basis
to generate custom xml-fragments on the fly::

    class ns(py.xml.Namespace):
        "my custom xml namespace"
    doc = ns.books(
        ns.book(
            ns.author("May Day"),
            ns.title("python for java programmers"),),
        ns.book(
            ns.author("why"),
            ns.title("Java for Python programmers"),),
        publisher="N.N",
        )
    print doc.unicode(indent=2).encode('utf8')

will give you this representation::

    
      
        May Day
        python for java programmers
      
        why
        Java for Python programmers



-- 
http://codeplayer.blogbus.com/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.exoweb.net/pipermail/python-chinese/attachments/20060802/93b7a61c/attachment.htm

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2006年08月02日 星期三 18:29

甘晖 ganhui020 at gmail.com
Wed Aug 2 18:29:13 HKT 2006

我是一个初学者,也正在用python的xml部分。
请问那个py的库是python自带的库吗?

2006/8/2, yi huang <yi.codeplayer at gmail.com>:
>
> 生成xml比解析xml简单多了,不需要那么复杂的库,推荐py,其中有个部分是做xml/html生成的.
>
> With ``py.xml.Namespace`` you have the basis
> to generate custom xml-fragments on the fly::
>
>     class ns(py.xml.Namespace):
>         "my custom xml namespace"
>     doc = ns.books(
>         ns.book(
>             ns.author("May Day"),
>             ns.title("python for java programmers"),),
>         ns.book(
>             ns.author("why"),
>             ns.title("Java for Python programmers"),),
>         publisher="N.N",
>         )
>     print doc.unicode(indent=2).encode('utf8')
>
> will give you this representation::
>
>     
>       
>         May Day
>         python for java programmers
>       
>         why
>         Java for Python programmers
>
>
>
> --
> http://codeplayer.blogbus.com/
>
> _______________________________________________
> python-chinese
> Post: send python-chinese at lists.python.cn
> Subscribe: send subscribe to python-chinese-request at lists.python.cn
> Unsubscribe: send unsubscribe to  python-chinese-request at lists.python.cn
> Detail Info: http://python.cn/mailman/listinfo/python-chinese
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.exoweb.net/pipermail/python-chinese/attachments/20060802/3bf27dac/attachment.html

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2006年08月02日 星期三 20:06

yi huang yi.codeplayer at gmail.com
Wed Aug 2 20:06:35 HKT 2006

http://codespeak.net/py/current/doc/

-- 
http://codeplayer.blogbus.com/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.exoweb.net/pipermail/python-chinese/attachments/20060802/e59ea5c1/attachment.htm

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2006年08月02日 星期三 21:48

齐辰雄 qcxhome at gmail.com
Wed Aug 2 21:48:31 HKT 2006

生成XML干脆直接print就行

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2006年08月03日 星期四 12:25

yhmin hustcnsky at 163.com
Thu Aug 3 12:25:05 HKT 2006

¹þ¹þ

"Æë³½ÐÛ" <qcxhome at gmail.com> дÈëÓʼþ
news:e03bf2360608020648k46cd391mcf279737b3cedf1c at mail.gmail.com...
> Éú³ÉXML¸É´àÖ±½Óprint¾ÍÐÐ
>


----------------------------------------------------------------------------
----


>




[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

如下红色区域有误,请重新填写。

    你的回复:

    请 登录 后回复。还没有在Zeuux哲思注册吗?现在 注册 !

    Zeuux © 2025

    京ICP备05028076号