From zoper at disturbance.dhs.org Tue Jul 1 11:20:56 2003 From: zoper at disturbance.dhs.org (zoper@disturbance.dhs.org) Date: Sun Aug 10 16:54:53 2008 Subject: [Zope-xml] Re: [Zope] ParsedXML Documentation / Examples? In-Reply-To: <3F001D8C.90607@adytumsolutions.com> Message-ID: Duncan, Thanks for the response. I guess I should clarify a bit: I am looking for tools to aid in the creation of XML from a large, heierarchical set of data (well, large here = ~300 nodes) produced dynamically from an RDBMS, then store this XML document in a single text blob in the database - kind of a 'snapshot' of the current set of data. Later, the system will need to read, parse and display this data, and allow changes to specific nodes to be made, and then re-store the XML in the database. The reason for using XML here is that the creation of this data set is only complex the FIRST time it is generated (it will be generated per-user in the system I am working on), and so I want to avoid the nastiness of flattening the data for re-store in the DB. My thinking here is that once the original per-user complex generation is done, I just hang each user's data in a single XML set and manipulate that for the user's customizations going forward. What I do NOT need to do is have a ZMI interface to the XML, store the XML in the ZODB, and though it may be needed later, I also do not currently need to do XSLT transforms on the data. ZopeXMLMethods looks to be very specific to handling XSL transforms; ParsedXML, now that I have looked more deeply at it, seems focused on a ZMI interface to XML documents (though documentation indicates that it should be possible to use DTML to create and manipulate XML data). Anyone, please correct me if I am mistaken in the above statements. At this point, the shortest route to get what I want appears to be to use TTW Python Scripts and just deal with Python's native XML capabilities... comments? Any advice and / or personal anecdotes about what has worked for you and what hasn't would be appreciated. As with many projects, I am up against a deadline already passed. On Mon, 30 Jun 2003, Duncan M. McGreggor wrote: > zoper@disturbance.dhs.org wrote: > > >Hello, > > > >After searching all afternoon, I have found a ton of periphery 'about' > >type information re: ParsedXML, but I am having trouble locating any > >substantive documentation, or in particular, examples. I'm interested in > >DTML examples, PythonScript examples, anything. > > > >Any pointers appreciated. > > > >-Bryan > > > > > > > > Have you checked out ZopeXMLMethods instead? It's the latest/greatest > XML Parser for zope. Works beautifully with 4Suite... or are you using > ParsedXML for specific reasons? > > There's a great ZopeXMLMethods tutorial that gives you examples; it also comes with ready-to-go xml and xsl (the tutorial uses these). > > HTH, > > duncan > > From giuseppe.bonelli at tiscalinet.it Tue Jul 1 12:37:05 2003 From: giuseppe.bonelli at tiscalinet.it (Giuseppe Bonelli) Date: Sun Aug 10 16:54:53 2008 Subject: [Zope-xml] RE: [Zope] ParsedXML Documentation / Examples? In-Reply-To: Message-ID: > -----Original Message----- > From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of > zoper@disturbance.dhs.org > Sent: martedi 1 luglio 2003 17.21 > To: Duncan M. McGreggor > Cc: zope-xml@zope.org; Zope > Subject: Re: [Zope] ParsedXML Documentation / Examples? > > > Duncan, > > Thanks for the response. I guess I should clarify a bit: I am > looking for > tools to aid in the creation of XML from a large, heierarchical set of > data (well, large here = ~300 nodes) produced dynamically > from an RDBMS, > then store this XML document in a single text blob in the > database - kind > of a 'snapshot' of the current set of data. I would write a simple product defining: 1. a folderish container class 2. a dtml-like class for storing the xml, something like: from somewhereInYourPythonPath import allTheNecessaryModules def addMyXMLFile(self, id, title='', REQUEST=None): "too lazy to use a docstring here" ob=myXMLFile(id, title, XMLStringContent) self._setObject(id, ob) self._getOb(id).reindex_object() message = """A new xmlFile as been added and the project schedule is back on track\n""" return MessageDialog(title = 'XML added', message = message.replace('\n','
'), action = ".") class myXMLFile(CatalogAware, DTMLDocument.DTMLDocument) """you want a docstring, don't you?""" meta_type = 'My XML File' manage_options=DTMLDocument.DTMLDocument.manage_options def __init__(self, id, title, XMLContent): "initialise a new istance" DTMLDocument.DTMLDocument.__init__(self, XMLContent) self.id=id self.title=title Globals.default__class_init__(editableEoloXMLFile) Note that you have to supply the xml from your RDBMS as a string (in the correct encoding). From briansullivan at coursesbywire.com Fri Jul 11 12:24:33 2003 From: briansullivan at coursesbywire.com (Brian Sullivan) Date: Sun Aug 10 16:54:53 2008 Subject: [Zope-xml] XML options Message-ID: I am looking into what I have to do to maniuplate XML in Zope. What are my options? What documents should I be reading? Any information, urls you can supply appreciated. -- Brian Sullivan Courses by Wire ( http://www.coursesbywire.com) From v.barone at cib.na.cnr.it Fri Jul 11 17:00:24 2003 From: v.barone at cib.na.cnr.it (v.barone@cib.na.cnr.it) Date: Sun Aug 10 16:54:53 2008 Subject: [Zope-xml] XML options In-Reply-To: References: Message-ID: <1057957224.3f0f256836c57@webmail.ais.cib.na.cnr.it> Scrive Brian Sullivan : > I am looking into what I have to do to maniuplate XML in Zope. > > What are my options? What documents should I be reading? Any information, > urls you can supply appreciated. > > -- > Brian Sullivan > Courses by Wire ( http://www.coursesbywire.com) > > > > _______________________________________________ > Zope-xml mailing list > Zope-xml@zope.org > http://mail.zope.org/mailman/listinfo/zope-xml > You could read a documentation about ParsedXML and download it from Zope.org. It represents an object that implements the DOM's API. If you create a ParsedXML object you can manipulate and transfer XML with Zope. I hope that this will be useful for you. From cstrong at arielpartners.com Sat Jul 12 16:05:21 2003 From: cstrong at arielpartners.com (Craeg K Strong) Date: Sun Aug 10 16:54:53 2008 Subject: [Zope-xml] XML options In-Reply-To: References: Message-ID: <3F106A01.6030402@arielpartners.com> You might try http://zopexmlmethods.sourceforge.net It provides XSLT, XPath, and DTD Validation via applying methods to Zope objects whose contents can be rendered (somehow) into XML. It has a full set of documentation and tutorials (I spent almost as much time on that as on the code!) It is nearing a 1.1 release. The only major thing left is documentation updates for the new XPath and DTD validation features. However, you can get the latest code via anonymous CVS download. Or you can start off with the 1.0 release. Hope this helps, --Craeg Brian Sullivan wrote: >I am looking into what I have to do to maniuplate XML in Zope. > >What are my options? What documents should I be reading? Any information, >urls you can supply appreciated. > > > From f.tedesco at easynet.be Wed Jul 23 19:29:07 2003 From: f.tedesco at easynet.be (Frederic Tedesco) Date: Sun Aug 10 16:54:53 2008 Subject: [Zope-xml] Xslt conversion on ZOPE3 security error Message-ID: <3F1F1A43.8080903@easynet.be> Hello everybody, When I try to use the "FourSuiteTransformer()" module to process the conversion of a XML file using a XSLT file I have this kind of error. Here you will find the code that I use: xslt = """\ Coucou Gamin """ xml = "" xslfile = XMLDocument(xslt) xmlfile = XMLDocument(xml) transformer = FourSuiteTransformer() transformer = removeAllProxies(transformer) return transformer.transform(xslfile,xmlfile) Thanks in advance for your help and have a nice day, Frederic From philipp at weitershausen.de Wed Jul 23 19:58:17 2003 From: philipp at weitershausen.de (Philipp von Weitershausen) Date: Sun Aug 10 16:54:53 2008 Subject: [Zope-xml] Re: Xslt conversion on ZOPE3 security error In-Reply-To: <3F1F1A43.8080903@easynet.be> References: <3F1F1A43.8080903@easynet.be> Message-ID: <3F1F2119.8040604@weitershausen.de> Frederic Tedesco wrote: > Hello everybody, > When I try to use the "FourSuiteTransformer()" module to process the > conversion of a XML file using a XSLT file I have this kind of error. ... Thanks for this error report. I have fixed this. The class was missing a ZCML security assertion. > transformer = removeAllProxies(transformer) Note that removeAllProxies is extremely discouraged as it disables all security checks. Best regards, Phil From burton at artificiel.org Sat Jul 26 13:51:20 2003 From: burton at artificiel.org (Alex Burton) Date: Sun Aug 10 16:54:53 2008 Subject: [Zope-xml] posting XML with zope Message-ID: hello! i'm looking for a way of doing an HTTP POST in zope with XML format. it is to integrate an already existing system. i've looked around but haven't found the right combination of keywords to find something (lots of XML-RPClib things are in the way!) i guess my questions is not as much XML as external http access but... my POST should look something like this: POST /rsffm.exe HTTP/1.0 Content-type: text/xml Content-length: [AUTOMATIC?] xxx yyy A B how would i do this? basically, the user fills a form, which is processed by zope, and based on the result of the form, calls SQL methods and constructs an XML document like the above, and finally posts it. what gets returned is not super important, but the more info about the transaction i can get back into zope the better of course... can do with DTML or External methods or Products. alex. From jean at upfrontsystems.co.za Wed Jul 30 09:57:21 2003 From: jean at upfrontsystems.co.za (Jean Jordaan) Date: Sun Aug 10 16:54:53 2008 Subject: [Zope-xml] Getting the XML representation of a proxy-less ParsedXML Document? Message-ID: <3F27CEC1.1060209@upfrontsystems.co.za> Hi all I do this:: from Products.ParsedXML.ParsedXML import createDOMDocument dom = createDOMDocument() dom.appendChild( ... etc ) From jean at upfrontsystems.co.za Wed Jul 30 10:10:39 2003 From: jean at upfrontsystems.co.za (Jean Jordaan) Date: Sun Aug 10 16:54:54 2008 Subject: [Zope-xml] Getting the XML representation of a proxy-less ParsedXML Document? In-Reply-To: <3F27CEC1.1060209@upfrontsystems.co.za> References: <3F27CEC1.1060209@upfrontsystems.co.za> Message-ID: <3F27D1DF.8050302@upfrontsystems.co.za> It seems like this does the trick:: >>> dom >>> from Products.ParsedXML.ExtraDOM import writeStream >>> writeStream(dom) >>> writeStream(dom).getvalue() u'\n<... etc Is this a Right Way, or am I offending sensibilities? -- Jean Jordaan http://www.upfrontsystems.co.za From giuseppe.bonelli at tiscali.it Wed Jul 30 11:45:41 2003 From: giuseppe.bonelli at tiscali.it (Giuseppe Bonelli) Date: Sun Aug 10 16:54:54 2008 Subject: [Zope-xml] Getting the XML representation of a proxy-less ParsedXML Document? In-Reply-To: <3F27D1DF.8050302@upfrontsystems.co.za> Message-ID: Hi jean, I am not offended at all, but why don't you use the print/prettyprint machinery (either in ParsedXML or in pyXML/4Suite depending on your setup)? I guess you'll soon have to manage text node other than plain dumb elements. --peppo > -----Original Message----- > From: zope-xml-admin@zope.org > [mailto:zope-xml-admin@zope.org]On Behalf > Of Jean Jordaan > Sent: mercoledi 30 luglio 2003 16.11 > To: zope-xml@zope.org > Subject: Re: [Zope-xml] Getting the XML representation of a proxy-less > ParsedXML Document? > > > It seems like this does the trick:: > > >>> dom > > >>> from Products.ParsedXML.ExtraDOM import writeStream > >>> writeStream(dom) > > >>> writeStream(dom).getvalue() > u'\n<... etc > > Is this a Right Way, or am I offending sensibilities? > > -- > Jean Jordaan > http://www.upfrontsystems.co.za > > > _______________________________________________ > Zope-xml mailing list > Zope-xml@zope.org > http://mail.zope.org/mailman/listinfo/zope-xml > From jean at upfrontsystems.co.za Wed Jul 30 12:11:40 2003 From: jean at upfrontsystems.co.za (Jean Jordaan) Date: Sun Aug 10 16:54:54 2008 Subject: [Zope-xml] Getting the XML representation of a proxy-less ParsedXML Document? In-Reply-To: References: Message-ID: <3F27EE3C.2010703@upfrontsystems.co.za> > why don't you use the print/prettyprint machinery writeStream is just a wrapper around PrettyPrint:: def writeStream(node, stream = None, encoding = None, html = 0, contentType = None, prettyPrint = 0): "Write the XML representation of node to stream." if stream is None: stream = StringIO() PrettyPrinter.PrintVisitor(node, stream, encoding, html, contentType, prettyPrint=prettyPrint)() return stream -- Jean Jordaan http://www.upfrontsystems.co.za