像Python一样阅读XML! [英] Reading XML like Python!

查看:82
本文介绍了像Python一样阅读XML!的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我必须为即将推出的项目阅读大量的XML。

XML很难在我眼前。

是否有某种转换器将XML转换为某种东西更多

眼睛友好?也许像Python一样?我见过重组文本。那里有
是EuroPython 2004上的一篇论文,似乎做了类似的事情。


" Pythonic Alternatives for declarative XML-based

机器人行为


任何人都知道这些线路上的任何工具吗?


谢谢。

I have to read a lot of XML for my upcoming project.
XML is hard on my eyes.
Is there some sort of converter that converts XML to something more
eye friendly? maybe like Python? I have seen restructured text. There
is a paper at EuroPython 2004 that seems to do something similar.

"Pythonic Alternatives for declarative XML-based specifications of
robot behavior"

Anyone know of any tools along these lines?

Thanks.

推荐答案

在文章< ba ************************** @ posting.google.com> ;,
jo*******@rediffmail.com (约翰)写道:
In article <ba**************************@posting.google.com >,
jo*******@rediffmail.com (John) wrote:
我必须为即将推出的项目阅读大量的XML。
XML很难在我眼前。
是否有某种转换器可以将XML转换为更多内容
眼睛友好?也许像Python一样?我见过重组文本。有一篇论文在EuroPython 2004上似乎做了类似的事情。

Pythonic替代方案,用于基于声明的基于XML的机器人行为规范

任何人都知道这些方面的工具吗?

谢谢。
I have to read a lot of XML for my upcoming project.
XML is hard on my eyes.
Is there some sort of converter that converts XML to something more
eye friendly? maybe like Python? I have seen restructured text. There
is a paper at EuroPython 2004 that seems to do something similar.

"Pythonic Alternatives for declarative XML-based specifications of
robot behavior"

Anyone know of any tools along these lines?

Thanks.




我最近遇到了同样的问题。我使用标准的xml.dom.minidom

模块来解析XML,以及关于一页Python代码的漂亮打印

它。不幸的是,我无法发布代码,但是如果你熟悉DOM的工作方式,你应该可以在

下复制它。一小时。如果你不熟悉DOM,它会花费你更长的时间,但是它还会让你有机会熟悉:-)


您是否尝试过DAGS forxml pretty-print?



I had the same problem recently. I used the standard xml.dom.minidom
module to parse the XML, and about a page of Python code to pretty-print
it. Unfortunately, I''m not able to release the code, but if you''re
familiar with how DOM works, you should be able to replicate it in under
an hour. If you''re not familiar with DOM, it''ll take you longer, but
it''ll also give you a chance to get familiar :-)

Have you tried DAGS for "xml pretty-print"?


>我最近遇到了同样的问题。我使用标准的xml.dom.minidom
> I had the same problem recently. I used the standard xml.dom.minidom
模块来解析XML,以及关于一页Python代码来完美地打印它。不幸的是,我无法发布代码,但如果你熟悉DOM的工作原理,你应该能够在一小时内复制它。如果你不熟悉DOM,它会花费你更长的时间,但是它也会给你一个熟悉的机会:-)

你有没有尝试过DAGS forxml pretty-print?
module to parse the XML, and about a page of Python code to pretty-print
it. Unfortunately, I''m not able to release the code, but if you''re
familiar with how DOM works, you should be able to replicate it in under
an hour. If you''re not familiar with DOM, it''ll take you longer, but
it''ll also give you a chance to get familiar :-)

Have you tried DAGS for "xml pretty-print"?




我想我自己可以编写一个简单的解析器,但我想知道是否

这是一个问题已经被其他已经拥有所有

铃声和口哨的人解决了。


什么是DAGS? Google搜索出现了Directed Acyclic Graphs。

不是CS家伙,我不确定打印漂亮的关系。任何链接?


谢谢。



I suppose I could write a simple parser myself but I was wondering if
this was a problem well solved by someone else already with all the
bells and whistles.

What is DAGS? A Google search came up with "Directed Acyclic Graphs".
Not being a CS guy, I am not sure about the relationship to pretty
printing. Any link?

Thanks.


John写道:
John wrote:
我必须为我即将开展的项目阅读了大量的XML。
XML很难在我眼前。
是否有某种转换器可以将XML转换为更友好的东西?也许像Python一样?我见过重组文本。那里有一篇EuroPython 2004的论文似乎做了类似的事情。
I have to read a lot of XML for my upcoming project.
XML is hard on my eyes.
Is there some sort of converter that converts XML to something more
eye friendly? maybe like Python? I have seen restructured text. There
is a paper at EuroPython 2004 that seems to do something similar.




我用的是yaml - 实际上它并不完全是你要求的,而是一个不同的

生成标记的方式,这对眼睛来说更友好,并且因为空白很重要,在这方面类似于python。我不知道

的xml2yaml转换器,但是我没看过所以可能有一些。


-

问候,


Diez B. Roggisch



I used yaml - actually its not exactly what you asked for, but a different
way of producing markup, which is much more friendly to the eye, and as
whitespace is significant, resembles python in that respect. I''m not aware
of xml2yaml converters, but I haven''t looked so there might be some.

--
Regards,

Diez B. Roggisch


这篇关于像Python一样阅读XML!的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆