大家好, 最后以编程方式深入研究XML。有没有人有最好的 练习建议,以编程方式通过Python发现任意XML文档的结构 ? 似乎喜欢它是一个普通的轮子我会重新发明。 谢谢和欢呼 EP
Hi all, Finally diving into XML programmatically. Does anyone have a best practice recommendation for programmatically discovering the structure of an arbitrary XML document via Python? It seems like it is a common wheel I''d be re-inventing. Thanks and cheers EP
推荐答案呃********** *@gmail 写道: er***********@gmail wrote: 最后以编程方式深入研究XML。有没有人有最好的实践建议,通过Python以编程方式发现任意XML文档的结构? 看起来这是一个普通的轮子我会被重新-inventing。 Finally diving into XML programmatically. Does anyone have a best practice recommendation for programmatically discovering the structure of an arbitrary XML document via Python? It seems like it is a common wheel I''d be re-inventing.
它是。查找XML DOM。 - Erik Max Francis&& ma*@alcyone && www.alcyone/max/ 美国加利福尼亚州圣何塞市&& 37 20 N 121 53 W&& AIM erikmaxfrancis 一盎司的伪善值得一磅野心。 - Michael Korda
It is. Look up XML DOM. -- Erik Max Francis && ma*@alcyone && www.alcyone/max/ San Jose, CA, USA && 37 20 N 121 53 W && AIM erikmaxfrancis An ounce of hypocrisy is worth a pound of ambition. -- Michael Korda
"以编程方式深入研究XML。有没有人有最好的 练习建议,通过Python以编程方式发现任意XML文档的结构? 您可以使用DOM或SAX,或任何更友好的XML 处理库来完成此操作。你可能想要更具体一点。 你想从这个发现中得到什么样的输出? - Uche Ogbuji Fourthought,Inc。 uche.ogbuji fourthought copia.ogbuji 4Suite 文章: uche.ogbuji/tech/publications/ "inally diving into XML programmatically. Does anyone have a best practice recommendation for programmatically discovering the structure of an arbitrary XML document via Python?" You can do this with DOM or SAX, or any of the many more friendly XML processing libraries out there. You might want to be more specific. What sort of output do you want from this discovery? -- Uche Ogbuji Fourthought, Inc. uche.ogbuji fourthought copia.ogbuji 4Suite Articles: uche.ogbuji/tech/publications/
我正在考虑的输出是一个DOMDNA ; - 这是DOM 没有元素或其数据的实例,一棵光秃秃的树,一个基于文档中的内容的原型树(而不是什么是 合法包括在文件中。 足够的数据,我知道任意元素: 1)元素是否在文件中 2)在哪里找到它(父母的链子) 如我所说,我刚刚开始想想这个主题,所以也许 最好的做法就是将完整的DOM加载到 内存中。我仍然在制造一个模式。一个模式。 EP The output I was contemplating was a DOM "DNA" - that is the DOM without the instances of the elements or their data, a bare tree, a prototype tree based on what is in the document (rather than what is legal to include in the document). Just enough data that for an arbitrary element I would know: 1) whether the element was in a document 2) where to find it (the chain of parents) As I mentioned, I''m just starting to think about the subject, so maybe the best practice is something else like loading the full DOM into memory. I''m still in the make one to throw away one mode. EP
更多推荐
XML树发现(脚本,工具,
发布评论