Re: libxml2 and XPath - Iterate through repeating elements?
Le Vendredi 2 Décembre 2005 18:31, [EMAIL PROTECTED] a écrit : I'm trying to iterate through repeating elements to extract data using libxml2 but I'm having zero luck - any help would be appreciated. My XML source is similar to the following - I'm trying to extract the line number and product code from the repeating line elements: order xmlns=some-ns header orderno123456/orderno /header lines line lineno1/lineno productcodePENS/productcode /line line lineno2/lineno productcodeSTAPLER/productcode /line line lineno3/lineno productcodeRULER/productcode /line /lines /order The result of an xpath evaluation is a list of node, which you can perform another xpatheval() on : import libxml2 doc = libxml2.parseFile(XmlFile) root = doc.getRootElement() line_nodes = root.xpathEval('lines/line') for line_node in line_nodes: print line_node.xpathEval('lineno')[0].content print line_node.xpathEval('productcode')[0].content doc.freeDoc() -- Cordially Jean-Roch SOTTY -- http://mail.python.org/mailman/listinfo/python-list
Re: Ajax for the Developers
Le Vendredi 18 Novembre 2005 10:08, Sabin.A.K, Bangalore a écrit : 1. Changing state with links (GET requests) 2.Asynchronously performing batch operations 3.Breaking the back button I'm looking for a response with Python MVC frameworks -- django, turbogears, etc. But you could consider looking at seaside[1] or wee[2] which are based on continuations. [1] http://seaside.st/ [2] http://rubyforge.org/projects/wee Jean-Roch SOTTY -- http://mail.python.org/mailman/listinfo/python-list