Parse a XML file in Zope, zopeXMLmethods Product not working in Zope 2.8.1
Hello, I've a xml file on the file system (the source is on an other webserver and the download is scheduled). How ca I parse this file with a xslt in Zope. ZopeXMLmethods isn't working annymore in Zope 2.8.1. Does annyone knows a Product of method to parse xml in Zope without the zopeXMLmethods product ? Regards, Martin Koekenberg
Martin Koekenberg escribió:
Hello,
I've a xml file on the file system (the source is on an other webserver and the download is scheduled). How ca I parse this file with a xslt in Zope. ZopeXMLmethods isn't working annymore in Zope 2.8.1.
Does annyone knows a Product of method to parse xml in Zope without the zopeXMLmethods product ?
Regards,
Martin Koekenberg
------------------------------------------------------------------------
_______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Hi! I use xml.dom.minidom Alternatives? Thanks! -- Mis Cosas http://blogs.sistes.net/Garito/
Am Montag, 26. September 2005 15:57 schrieb Martin Koekenberg:
Hello,
I've a xml file on the file system (the source is on an other webserver and the download is scheduled). How ca I parse this file with a xslt in Zope. ZopeXMLmethods isn't working annymore in Zope 2.8.1.
Does annyone knows a Product of method to parse xml in Zope without the zopeXMLmethods product ?
Regards,
Martin Koekenberg
I do it like this (ExternalMethod in this case): -------------------------------------------------------------------- import libxml2 import libxslt stylestring = file("/path/to/style/file.xsl").read() def xslt(data): # note: if styledoc and style are defined outside the function, # zope dumps core :-( styledoc = libxml2.parseDoc(stylestring) style = libxslt.parseStylesheetDoc(styledoc) doc = libxml2.parseDoc(data) result = style.applyStylesheet(doc, None) html = style.saveResultToString(result) style.freeStylesheet() doc.freeDoc() result.freeDoc() return html -------------------------------------------------------------------- may be not very smart, but it's working :-) Cheers, Sascha
Martin Koekenberg wrote at 2005-9-26 15:57 +0200:
... Does annyone knows a Product of method to parse xml in Zope without the zopeXMLmethods product ?
You can use any of the methods for XML parsing supported by Python, among others * MiniDOM * "[c]ElementTree" * SAX * "pyexpat" * "sgmlop" * "libxml2" Note that the listed options operate on different API levels (DOM, SAX, raw parsing events). -- Dieter
Dieter Maurer <dieter@handshake.de> wrote:
Martin Koekenberg wrote at 2005-9-26 15:57 +0200:
... Does annyone knows a Product of method to parse xml in Zope without the zopeXMLmethods product ?
You can use any of the methods for XML parsing supported by Python, among others
* MiniDOM
* "[c]ElementTree"
* SAX
* "pyexpat"
* "sgmlop"
* "libxml2"
Also, lxml (pythonic bindings based on ElementTree API for libxml2), which is quickly becoming the reference for Zope work. Florent -- Florent Guillaume, Nuxeo (Paris, France) CTO, Director of R&D +33 1 40 33 71 59 http://nuxeo.com fg@nuxeo.com
participants (5)
-
Dieter Maurer -
Florent Guillaume -
Garito -
Martin Koekenberg -
Sascha Ottolski