Python论坛  - 讨论区

标题:[python-chinese] 有没有比cElementTree更好支持xml解析的lib,并且对xpath也能提供很好支持的。

2006年02月15日 星期三 16:45

徐祥军 martin.xus at gmail.com
Wed Feb 15 16:45:27 HKT 2006

第一:对xpath能很好支持的,例如:
   支持任意的xpath
      /Attribute_Groups/Attribute
   支持带有attribute的xpath
     //ERwin4/Model/Entity_Groups/Entity[@id=id]


第二:运行速度越快越好,我用cElementTree解析要花十几分钟的时间,用ElementTree运行不了。

大家再帮我推荐一个,谢谢
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.exoweb.net/pipermail/python-chinese/attachments/20060215/63347a38/attachment.htm

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

2006年02月15日 星期三 16:48

Zoom Quiet zoom.quiet at gmail.com
Wed Feb 15 16:48:17 HKT 2006

On 2/15/06, 徐祥军 <martin.xus at gmail.com> wrote:
> 第一:对xpath能很好支持的,例如:
>    支持任意的xpath
>       /Attribute_Groups/Attribute
>    支持带有attribute的xpath
>      //ERwin4/Model/Entity_Groups/Entity[@id=id]
>
>
> 第二:运行速度越快越好,我用cElementTree解析要花十几分钟的时间,用ElementTree运行不了。
对于大型的XML处理,建议不用Pytohn 的了,而且,最好不要使用DOM 类型的,
事务类型的更加高效些…………

>
> 大家再帮我推荐一个,谢谢
>
> _______________________________________________
> 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
>
>


--
"""Time is unimportant, only life important!
blogging  :  http://blog.zoomquiet.org/pyblosxom/
wiki enter:   http://wiki.woodpecker.org.cn/moin/ZoomQuiet
in douban:  http://www.douban.com/people/zoomq/
"""

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

2006年02月15日 星期三 16:53

徐祥军 martin.xus at gmail.com
Wed Feb 15 16:53:16 HKT 2006

能不能具体的讲一讲。
先谢了。

On 2/15/06, Zoom Quiet <zoom.quiet at gmail.com> wrote:
>
> On 2/15/06, 徐祥军 <martin.xus at gmail.com> wrote:
> > 第一:对xpath能很好支持的,例如:
> >    支持任意的xpath
> >       /Attribute_Groups/Attribute
> >    支持带有attribute的xpath
> >      //ERwin4/Model/Entity_Groups/Entity[@id=id]
> >
> >
> > 第二:运行速度越快越好,我用cElementTree解析要花十几分钟的时间,用ElementTree运行不了。
> 对于大型的XML处理,建议不用Pytohn 的了,而且,最好不要使用DOM 类型的,
> 事务类型的更加高效些…………
>
> >
> > 大家再帮我推荐一个,谢谢
> >
> > _______________________________________________
> > 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
> >
> >
>
>
> --
> """Time is unimportant, only life important!
> blogging  :  http://blog.zoomquiet.org/pyblosxom/
> wiki enter:   http://wiki.woodpecker.org.cn/moin/ZoomQuiet
> in douban:  http://www.douban.com/people/zoomq/
> """
>
> _______________________________________________
> 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/20060215/2dbfee1c/attachment.html

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

2006年02月15日 星期三 17:45

Bruce Wang number5 at gmail.com
Wed Feb 15 17:45:30 HKT 2006

用 lxml试试看, 是基于 libxml2的, API类似ElementTree
或者直接用 libxml2 的python binding

另外, 既然对性能要求那么高, 为什么非要用python呢?

On 2/15/06, 徐祥军 <martin.xus at gmail.com> wrote:
>
> 能不能具体的讲一讲。
> 先谢了。
>
> On 2/15/06, Zoom Quiet <zoom.quiet at gmail.com> wrote:
> >
> > On 2/15/06, 徐祥军 <martin.xus at gmail.com> wrote:
> > > 第一:对xpath能很好支持的,例如:
> > >    支持任意的xpath
> > >       /Attribute_Groups/Attribute
> > >    支持带有attribute的xpath
> > >      //ERwin4/Model/Entity_Groups/Entity[@id=id]
> > >
> > >
> > > 第二:运行速度越快越好,我用cElementTree解析要花十几分钟的时间,用ElementTree运行不了。
> > 对于大型的XML处理,建议不用Pytohn 的了,而且,最好不要使用DOM 类型的,
> > 事务类型的更加高效些…………
> >
> > >
> > > 大家再帮我推荐一个,谢谢
> > >
> > > _______________________________________________
> > > 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
> > >
> > >
> >
> >
> > --
> > """Time is unimportant, only life important!
> > blogging  :  http://blog.zoomquiet.org/pyblosxom/
> > wiki enter:   http://wiki.woodpecker.org.cn/moin/ZoomQuiet
> > in douban:  http://www.douban.com/people/zoomq/
> > """
> >
> > _______________________________________________
> > 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
> >
> >
>
> _______________________________________________
> 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
>
>


--
simple is good
http://datastrategy.org/number5
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.exoweb.net/pipermail/python-chinese/attachments/20060215/493feb67/attachment-0001.html

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

2006年02月15日 星期三 17:48

清风 paradise.qingfeng at gmail.com
Wed Feb 15 17:48:54 HKT 2006

ElementTree不是有一个CElementTree吗?那个性能应该不错吧

On 2/15/06, Bruce Wang <number5 at gmail.com> wrote:
> 用 lxml试试看, 是基于 libxml2的, API类似ElementTree
> 或者直接用 libxml2 的python binding
>
> 另外, 既然对性能要求那么高, 为什么非要用python呢?
>
>
> On 2/15/06, 徐祥军 < martin.xus at gmail.com> wrote:
> >
> > 能不能具体的讲一讲。
> > 先谢了。
> >
> >
> >
> > On 2/15/06, Zoom Quiet <zoom.quiet at gmail.com > wrote:
> > > On 2/15/06, 徐祥军 <martin.xus at gmail.com> wrote:
> > > > 第一:对xpath能很好支持的,例如:
> > > >    支持任意的xpath
> > > >       /Attribute_Groups/Attribute
> > > >    支持带有attribute的xpath
> > > >      //ERwin4/Model/Entity_Groups/Entity[@id=id]
> > > >
> > > >
> > > >
> 第二:运行速度越快越好,我用cElementTree解析要花十几分钟的时间,用ElementTree运行不了。
> > > 对于大型的XML处理,建议不用Pytohn 的了,而且,最好不要使用DOM 类型的,
> > > 事务类型的更加高效些…………
> > >
> > > >
> > > > 大家再帮我推荐一个,谢谢
> > > >
> > > > _______________________________________________
> > > > 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
> > > >
> > > >
> > >
> > >
> > > --
> > > """Time is unimportant, only life important!
> > > blogging  :   http://blog.zoomquiet.org/pyblosxom/
> > > wiki enter:
> http://wiki.woodpecker.org.cn/moin/ZoomQuiet
> > > in douban:   http://www.douban.com/people/zoomq/
> > > """
> > >
> > > _______________________________________________
> > > 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
> > >
> > >
> >
> >
> > _______________________________________________
> > 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
> >
> >
>
>
>
> --
> simple is good
> http://datastrategy.org/number5
> _______________________________________________
> 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
>
>


--
Blog:http://qingfeng.ushared.com/blog/

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

2006年02月15日 星期三 18:00

徐祥军 martin.xus at gmail.com
Wed Feb 15 18:00:36 HKT 2006

我用java解析花了近半个小时才解析完一小部分文件,慢的不可想象。

并不是我不采用更好的方法,而是除了java,我只想到了python来做,我没处理过这么大的xml文件。

On 2/15/06, Bruce Wang <number5 at gmail.com> wrote:
>
> 用 lxml试试看, 是基于 libxml2的, API类似ElementTree
> 或者直接用 libxml2 的python binding
>
> 另外, 既然对性能要求那么高, 为什么非要用python呢?
>
> On 2/15/06, 徐祥军 < martin.xus at gmail.com> wrote:
>
> > 能不能具体的讲一讲。
> > 先谢了。
> >
> > On 2/15/06, Zoom Quiet <zoom.quiet at gmail.com > wrote:
> > >
> > > On 2/15/06, 徐祥军 <martin.xus at gmail.com> wrote:
> > > > 第一:对xpath能很好支持的,例如:
> > > >    支持任意的xpath
> > > >       /Attribute_Groups/Attribute
> > > >    支持带有attribute的xpath
> > > >      //ERwin4/Model/Entity_Groups/Entity[@id=id]
> > > >
> > > >
> > > > 第二:运行速度越快越好,我用cElementTree解析要花十几分钟的时间,用ElementTree运行不了。
> > > 对于大型的XML处理,建议不用Pytohn 的了,而且,最好不要使用DOM 类型的,
> > > 事务类型的更加高效些…………
> > >
> > > >
> > > > 大家再帮我推荐一个,谢谢
> > > >
> > > > _______________________________________________
> > > > 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
> > > >
> > > >
> > >
> > >
> > > --
> > > """Time is unimportant, only life important!
> > > blogging  :   http://blog.zoomquiet.org/pyblosxom/
> > > wiki enter:   http://wiki.woodpecker.org.cn/moin/ZoomQuiet
> > > in douban:   http://www.douban.com/people/zoomq/
> > > """
> > >
> > > _______________________________________________
> > > 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
> > >
> > >
> >
> > _______________________________________________
> > 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
> >
> >
>
>
> --
> simple is good
> http://datastrategy.org/number5
> _______________________________________________
> 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/20060215/74be25f1/attachment.htm

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

2006年02月15日 星期三 18:01

徐祥军 martin.xus at gmail.com
Wed Feb 15 18:01:59 HKT 2006

对,我就是采用cElementTree来做的,ElementTree跑不动的。
我是想找个更好一点的来出来xml文件。

On 2/15/06, 清风 <paradise.qingfeng at gmail.com> wrote:
>
> ElementTree不是有一个CElementTree吗?那个性能应该不错吧
>
> On 2/15/06, Bruce Wang <number5 at gmail.com> wrote:
> > 用 lxml试试看, 是基于 libxml2的, API类似ElementTree
> > 或者直接用 libxml2 的python binding
> >
> > 另外, 既然对性能要求那么高, 为什么非要用python呢?
> >
> >
> > On 2/15/06, 徐祥军 < martin.xus at gmail.com> wrote:
> > >
> > > 能不能具体的讲一讲。
> > > 先谢了。
> > >
> > >
> > >
> > > On 2/15/06, Zoom Quiet <zoom.quiet at gmail.com > wrote:
> > > > On 2/15/06, 徐祥军 <martin.xus at gmail.com> wrote:
> > > > > 第一:对xpath能很好支持的,例如:
> > > > >    支持任意的xpath
> > > > >       /Attribute_Groups/Attribute
> > > > >    支持带有attribute的xpath
> > > > >      //ERwin4/Model/Entity_Groups/Entity[@id=id]
> > > > >
> > > > >
> > > > >
> > 第二:运行速度越快越好,我用cElementTree解析要花十几分钟的时间,用ElementTree运行不了。
> > > > 对于大型的XML处理,建议不用Pytohn 的了,而且,最好不要使用DOM 类型的,
> > > > 事务类型的更加高效些…………
> > > >
> > > > >
> > > > > 大家再帮我推荐一个,谢谢
> > > > >
> > > > > _______________________________________________
> > > > > 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
> > > > >
> > > > >
> > > >
> > > >
> > > > --
> > > > """Time is unimportant, only life important!
> > > > blogging  :   http://blog.zoomquiet.org/pyblosxom/
> > > > wiki enter:
> > http://wiki.woodpecker.org.cn/moin/ZoomQuiet
> > > > in douban:   http://www.douban.com/people/zoomq/
> > > > """
> > > >
> > > > _______________________________________________
> > > > 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
> > > >
> > > >
> > >
> > >
> > > _______________________________________________
> > > 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
> > >
> > >
> >
> >
> >
> > --
> > simple is good
> > http://datastrategy.org/number5
> > _______________________________________________
> > 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
> >
> >
>
>
> --
> Blog:http://qingfeng.ushared.com/blog/
>
> _______________________________________________
> 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/20060215/c8275cc3/attachment-0001.html

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

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

    你的回复:

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

    Zeuux © 2025

    京ICP备05028076号