From adrian at haqa.co.uk Fri Aug 2 08:56:37 2002 From: adrian at haqa.co.uk (Adrian Hungate) Date: Sun Aug 10 16:54:51 2008 Subject: [Zope-xml] How to use XML in zope Message-ID: <01a201c23a24$09ec4cf0$0280a8c0@armadillo> I notice that there were a couple of questions a month or so ago about how to use XML in zope, and they mentioned XMLKit. I am the author of that product, and I would be happy to answer any questions anyone has about it. (Sorry it took so long to reply) Adrian... -- Adrian Hungate EMail: adrian@haqa.co.uk Web: http://www.haqa.co.uk From christophe.robert at culture.gouv.fr Fri Aug 2 13:27:19 2002 From: christophe.robert at culture.gouv.fr (christophe robert) Date: Sun Aug 10 16:54:51 2008 Subject: [Zope-xml] How to use XML in zope In-Reply-To: <01a201c23a24$09ec4cf0$0280a8c0@armadillo> References: <01a201c23a24$09ec4cf0$0280a8c0@armadillo> Message-ID: <1028309239.1823.9.camel@pc004cyr2.culture.fr> Le ven 02/08/2002 ? 14:56, Adrian Hungate a ?crit : > I notice that there were a couple of questions a month or so ago about how > to use XML in zope, and they mentioned XMLKit. I am the author of that > product, and I would be happy to answer any questions anyone has about it. > > Hello haga I seek to index elements with the catalog on a set of XML document. is it possible to do it very simply with XMLKit Thank and A++ in french ;) (Sorry it took so long to reply) > > Adrian... > > -- > Adrian Hungate > EMail: adrian@haqa.co.uk > Web: http://www.haqa.co.uk > > > > _______________________________________________ > Zope-xml mailing list > Zope-xml@zope.org > http://lists.zope.org/mailman/listinfo/zope-xml > From adrian at haqa.co.uk Fri Aug 2 09:43:22 2002 From: adrian at haqa.co.uk (Adrian Hungate) Date: Sun Aug 10 16:54:51 2008 Subject: [Zope-xml] How to use XML in zope References: <01a201c23a24$09ec4cf0$0280a8c0@armadillo> <1028309239.1823.9.camel@pc004cyr2.culture.fr> Message-ID: <021901c23a2a$91bc0110$0280a8c0@armadillo> No, XMLKit does not currently have the ability to catalog the elements of an XML file. I am not sure that any of the current XML products do. In theory it is possible, but I am not sure what you would hope to achive. The best way is probably to have a script process the XML into separate objects in the ZODB and catalog them. I know it is possible to catalog objects that are not in the ZODB, but I can't see what you would be able to do with the catalog entries. Adrian... -- Adrian Hungate EMail: adrian@haqa.co.uk Web: http://www.haqa.co.uk ----- Original Message ----- From: "christophe robert" To: "Adrian Hungate" Cc: Sent: Friday, August 02, 2002 6:27 PM Subject: Re: [Zope-xml] How to use XML in zope Le ven 02/08/2002 ? 14:56, Adrian Hungate a ?crit : > I notice that there were a couple of questions a month or so ago about how > to use XML in zope, and they mentioned XMLKit. I am the author of that > product, and I would be happy to answer any questions anyone has about it. > > Hello haga I seek to index elements with the catalog on a set of XML document. is it possible to do it very simply with XMLKit Thank and A++ in french ;) (Sorry it took so long to reply) > > Adrian... > > -- > Adrian Hungate > EMail: adrian@haqa.co.uk > Web: http://www.haqa.co.uk > > > > _______________________________________________ > Zope-xml mailing list > Zope-xml@zope.org > http://lists.zope.org/mailman/listinfo/zope-xml > From kra at monkey.org Sun Aug 4 17:16:54 2002 From: kra at monkey.org (Karl Anderson) Date: Sun Aug 10 16:54:51 2008 Subject: [Zope-xml] How to use XML in zope In-Reply-To: "Adrian Hungate"'s message of "Fri, 2 Aug 2002 14:43:22 +0100" References: <01a201c23a24$09ec4cf0$0280a8c0@armadillo> <1028309239.1823.9.camel@pc004cyr2.culture.fr> <021901c23a2a$91bc0110$0280a8c0@armadillo> Message-ID: "Adrian Hungate" writes: > No, XMLKit does not currently have the ability to catalog the elements of an > XML file. I am not sure that any of the current XML products do. You can catalog Parsed XML nodes - there's instructions in the wiki. > In theory it is possible, but I am not sure what you would hope to achive. > The best way is probably to have a script process the XML into separate > objects in the ZODB and catalog them. I know it is possible to catalog > objects that are not in the ZODB, but I can't see what you would be able to > do with the catalog entries. Lots of things! For example, a Parsed XML Zope proxy node isn't in the ZODB - every time you're getting a node you're creating a new proxy object - but you can catalog that traversal path and get a new proxy object from that. More probably, use the catalog to not have to get to the object at all. Think of the catalog as a fast read interface - a BTree for finding, and LazyLists for displaying. -- Karl Anderson kra@monkey.org http://www.monkey.org/~kra/ From adrian at haqa.co.uk Sun Aug 4 17:19:27 2002 From: adrian at haqa.co.uk (Adrian Hungate) Date: Sun Aug 10 16:54:51 2008 Subject: [Zope-xml] How to use XML in zope References: <01a201c23a24$09ec4cf0$0280a8c0@armadillo> <1028309239.1823.9.camel@pc004cyr2.culture.fr> <021901c23a2a$91bc0110$0280a8c0@armadillo> Message-ID: <00b601c23bfc$9d1ebd30$0280a8c0@armadillo> If your XML is virtually static then yes, but XML Kit was written specifically for the case of rapidly changing XML sources (Inside and outsite Zope). In this case the catalog would (could) contain references to non-existant nodes. Adrian... -- Adrian Hungate EMail: adrian@haqa.co.uk Web: http://www.haqa.co.uk ----- Original Message ----- From: "Karl Anderson" To: "Adrian Hungate" Cc: "christophe robert" ; Sent: Sunday, August 04, 2002 10:16 PM Subject: Re: [Zope-xml] How to use XML in zope > "Adrian Hungate" writes: > > > No, XMLKit does not currently have the ability to catalog the elements of an > > XML file. I am not sure that any of the current XML products do. > > You can catalog Parsed XML nodes - there's instructions in the wiki. > > > In theory it is possible, but I am not sure what you would hope to achive. > > The best way is probably to have a script process the XML into separate > > objects in the ZODB and catalog them. I know it is possible to catalog > > objects that are not in the ZODB, but I can't see what you would be able to > > do with the catalog entries. > > Lots of things! For example, a Parsed XML Zope proxy node isn't in > the ZODB - every time you're getting a node you're creating a new > proxy object - but you can catalog that traversal path and get a new > proxy object from that. > > More probably, use the catalog to not have to get to the object at > all. Think of the catalog as a fast read interface - a BTree for > finding, and LazyLists for displaying. > > -- > Karl Anderson kra@monkey.org http://www.monkey.org/~kra/ > > _______________________________________________ > Zope-xml mailing list > Zope-xml@zope.org > http://lists.zope.org/mailman/listinfo/zope-xml > From sean.upton at uniontrib.com Sun Aug 4 17:31:01 2002 From: sean.upton at uniontrib.com (sean.upton@uniontrib.com) Date: Sun Aug 10 16:54:51 2008 Subject: [Zope-xml] ParsedXML and Python DOM implementations in general... Message-ID: A question for those that know... I'm writing some implementation components for reading and writing different News formats (there are reader and writer components respectively, and different reader or writer plugins can work with XML and legacy text formats). One of the goals of these components is to have an interface compatible set of components both inside and outside of Zope; of the XML reader and writer components, in Zope, the plan is to use ParsedXML; outside of Zope, I've been using 4Suite's 4DOM (which, I think is totally retarded, in that its getAttribute() methods are not compliant, forcing you to use getAttributeNS(), which is total bloat if you are not using namespaces). I recently noticed that under Debian installation of 4Suite (via apt-get) removed PyXML, which breaks ParsedXML 1.3 (since it needs PyExpat from PyXML). So, since I was sufficiently pissed off at 4Suite, I uninstalled it, and reinstalled PyXML (since I needed it anyway for ParsedXML). My impression, however, is that the DOM implementation I am using with PyXML is not totally L2 compliant, since all the getAttributeNS() methods I had had to be changed to getAttribute() to work correctly (no big deal, I'm not using namespaces). I should mention I am using Python 2.1.3. An example of the kind of code I am using (non-Zope, but I plan to create a similar component that is part of a Python product using ParsedXML): from xml.dom.ext.reader.Sax2 import FromXmlStream,FromXml class NITFTestReader(ArticleReaderBase): def __init__(self,filename=None): if filename is not None: self._doc = FromXmlStream(filename) else: self._doc = FromXml('') def getPrintedHeadline(self): """Get original headline, as it appeared in print""" #obtained through custom NITF meta element nitfnode = self._doc.getElementsByTagName('nitf')[0] try: headnode = nitfnode.getElementsByTagName('head')[0] allMetaNodes = headnode.getElementsByTagName('meta') #nodeList for metaNode in allMetaNodes: #OLD/4Suite==>#if metaNode.getAttributeNS('', 'name') == 'original-print-headline': if metaNode.getAttribute('name') == 'original-print-headline': textval = metaNode.getAttribute('content') except: return '' return textval So my question is this: I am not using XML namespaces now, but might in the future, so I think I want to use a DOM L2 implementation. I would like to be able to have relatively the same code (or at least subclass the non-Zope reader and writer components and override their __init__() to instantiate a DOM document object differently). So, here goes my questions... 1 - Is there a way to use ParsedXML outside of Zope/ZODB? If I could just unify on using ParsedXML, I would in a heartbeat! 2 - If not, is there a DOM L2 implementation in PyXML or another package that folks on this list are aware of that would work suitably without having package conflicts with PyXML? Anyone's thoughts on the matter would be appreciated... Sean +----------------------------------------------------------- | Sean Upton | Site Technology Supervisor SignOnSanDiego.com | Development & Integration The San Diego Union-Tribune | 619.718.5241 sean.upton@uniontrib.com | PATH_TO_THE_DARK_SIDE = 'c:\winnt\system32' +----------------------------------------------------------- From ed at greengraphics.net Sun Aug 4 12:08:44 2002 From: ed at greengraphics.net (Ed Colmar) Date: Sun Aug 10 16:54:51 2008 Subject: [Zope-xml] Images through XML-RPC Message-ID: Anyone know if it is possible to send images, or other file data through xml-rpc? I've been working a lot with the xml-rpc funtionality of zope and it's a lot of fun. I have some seperate python/Tkinter scripts that I'm playing with that all communicate using it. Can I wrap files somehow and work with them in ZODB using xml-rpc? For example, a client has an image on the local machine. Can I make a rpc call to a python method and save it in the zodb as a zope image? I would probably need PIL on both sides? Any thoughts on this? thx -ed- -- Green Graphics ::: Print and Web Design ::: 510.923.0000 From andy at agmweb.ca Sun Aug 4 20:19:51 2002 From: andy at agmweb.ca (Andy McKay) Date: Sun Aug 10 16:54:51 2008 Subject: [Zope-xml] Re: [Zope] Images through XML-RPC References: Message-ID: <000d01c23c15$d2135fa0$89505018@cr582427a> > Anyone know if it is possible to send images, or other file data through > xml-rpc? Yep just base64 encode / decode it at either end. -- Andy McKay @gmweb Consulting http://www.agmweb.ca From christophe.robert at culture.gouv.fr Mon Aug 5 12:03:57 2002 From: christophe.robert at culture.gouv.fr (christophe robert) Date: Sun Aug 10 16:54:51 2008 Subject: [Zope-xml] How to use XML in zope In-Reply-To: References: <01a201c23a24$09ec4cf0$0280a8c0@armadillo> <1028309239.1823.9.camel@pc004cyr2.culture.fr> <021901c23a2a$91bc0110$0280a8c0@armadillo> Message-ID: <1028563441.1585.32.camel@pc004cyr2.culture.fr> Le dim 04/08/2002 ? 23:16, Karl Anderson a ?crit : > "Adrian Hungate" writes: > > > No, XMLKit does not currently have the ability to catalog the elements of an > > XML file. I am not sure that any of the current XML products do. > > You can catalog Parsed XML nodes - there's instructions in the wiki. > I have read "ParsedXMLCatalog", but i don't know where i put this code http://www.zope.org//Wikis/DevSite/Projects/ParsedXML/ParsedXMLCatalog app.catalogtest.catalog._product_meta_types = ( {'permission': 'Dummy', 'name': 'Manageable Element', 'action':'pass'},) there is a more explicit document thanks > > In theory it is possible, but I am not sure what you would hope to achive. > > The best way is probably to have a script process the XML into separate > > objects in the ZODB and catalog them. I know it is possible to catalog > > objects that are not in the ZODB, but I can't see what you would be able to > > do with the catalog entries. > > Lots of things! For example, a Parsed XML Zope proxy node isn't in > the ZODB - every time you're getting a node you're creating a new > proxy object - but you can catalog that traversal path and get a new > proxy object from that. > > More probably, use the catalog to not have to get to the object at > all. Think of the catalog as a fast read interface - a BTree for > finding, and LazyLists for displaying. > > -- > Karl Anderson kra@monkey.org http://www.monkey.org/~kra/ > > _______________________________________________ > Zope-xml mailing list > Zope-xml@zope.org > http://lists.zope.org/mailman/listinfo/zope-xml > From kra at monkey.org Tue Aug 6 19:06:40 2002 From: kra at monkey.org (Karl Anderson) Date: Sun Aug 10 16:54:51 2008 Subject: [Zope-xml] How to use XML in zope In-Reply-To: christophe robert's message of "05 Aug 2002 18:03:57 +0200" References: <01a201c23a24$09ec4cf0$0280a8c0@armadillo> <1028309239.1823.9.camel@pc004cyr2.culture.fr> <021901c23a2a$91bc0110$0280a8c0@armadillo> <1028563441.1585.32.camel@pc004cyr2.culture.fr> Message-ID: christophe robert writes: > Le dim 04/08/2002 à 23:16, Karl Anderson a écrit : > > You can catalog Parsed XML nodes - there's instructions in the wiki. > > I have read "ParsedXMLCatalog", but i don't know where i put this code > > http://www.zope.org//Wikis/DevSite/Projects/ParsedXML/ParsedXMLCatalog > > app.catalogtest.catalog._product_meta_types = ( {'permission': > 'Dummy', 'name': 'Manageable Element', 'action':'pass'},) > > there is a more explicit document Hint: grep for _product_meta_types in your Zope tree or collection of example Zope products, or Google it. Run the code from anywhere - probably an External Method, but a Python product could be setting it up somewhere. Or test it by mounting the ZODB in an interactive python session. app.catalogtest.catalog is a ZCatalog in the example. -- Karl Anderson kra@monkey.org http://www.monkey.org/~kra/ From christophe.robert at culture.gouv.fr Wed Aug 7 09:34:19 2002 From: christophe.robert at culture.gouv.fr (christophe robert) Date: Sun Aug 10 16:54:52 2008 Subject: [Zope-xml] How to use XML in zope In-Reply-To: References: <01a201c23a24$09ec4cf0$0280a8c0@armadillo> <1028309239.1823.9.camel@pc004cyr2.culture.fr> <021901c23a2a$91bc0110$0280a8c0@armadillo> <1028563441.1585.32.camel@pc004cyr2.culture.fr> Message-ID: <1028727259.1587.9.camel@pc004cyr2.culture.fr> Le mer 07/08/2002 ? 01:06, Karl Anderson a ?crit : > christophe robert writes: > > > Le dim 04/08/2002 ? 23:16, Karl Anderson a ?crit : > > > You can catalog Parsed XML nodes - there's instructions in the wiki. > > > > I have read "ParsedXMLCatalog", but i don't know where i put this code > > > > http://www.zope.org//Wikis/DevSite/Projects/ParsedXML/ParsedXMLCatalog > > > > app.catalogtest.catalog._product_meta_types = ( {'permission': > > 'Dummy', 'name': 'Manageable Element', 'action':'pass'},) > > > > there is a more explicit document > > Hint: grep for _product_meta_types in your Zope tree or collection of > example Zope products, or Google it. > > Run the code from anywhere - probably an External Method, but a Python > product could be setting it up somewhere. Or test it by mounting the > ZODB in an interactive python session. > It s Ok. Thanks karl . > app.catalogtest.catalog is a ZCatalog in the example. > > -- > Karl Anderson kra@monkey.org http://www.monkey.org/~kra/ > From tdickenson at geminidataloggers.com Fri Aug 9 05:30:48 2002 From: tdickenson at geminidataloggers.com (Toby Dickenson) Date: Sun Aug 10 16:54:52 2008 Subject: [Zope-xml] Re: [Zope] Images through XML-RPC In-Reply-To: <000d01c23c15$d2135fa0$89505018@cr582427a> References: <000d01c23c15$d2135fa0$89505018@cr582427a> Message-ID: <200208091030.48179.tdickenson@geminidataloggers.com> On Monday 05 Aug 2002 1:19 am, Andy McKay wrote: > > Anyone know if it is possible to send images, or other file data through > > xml-rpc? > > Yep just base64 encode / decode it at either end. You might be interested in a patch in the collector to do this automatically for Zope File/Image objects. This patch will be considered for Zope 2.7 From chrisw_88 at hotmail.com Wed Aug 14 12:47:23 2002 From: chrisw_88 at hotmail.com (chrisw_88) Date: Sun Aug 10 16:54:52 2008 Subject: [Zope-xml] RE: The DevXML Project Message-ID: XML is just a file format used to store information. DevXML is a way of sharing information about an interface and eventually a class definition amongst many languages and platforms. Its just data. I wrote one utility in vb to parse the DevXML and generate the interface in vb, but you can use the parsers that already exist on different platforms to parse the file and generate the source in whatever language you work with. This comes in handy if you have development teams working on the same product but for different platforms, eg c++ or vb on nt and java on linux. You wish for the interfaces to be the same and eventually you would wish to share the same basic logic, the only difference is the parts that are specific to c++ or java. This helps resolve problems of inconsistant functionality between the product on one platform vs the other. It also helps resolve the problem of the c++ and java versions having drastically different behavior. That is a developer who is working on the c++ side can more easily transfer his knowledge of the interface and class design to a java developer without either developer having to understand both languages. It could potentially save you some time when porting from one platform to another as you can generate a shell on the new platform by parsing the DevXML files. Then you just need to fill in the platform specific stuff. So far I have a little group that is reviewing my research and providing feedback if you or anyone in your group would like to take part please let me know. The more feedback the more likely it is that we will be successful. My research is being posted at http://www.clinch.netfirms.com/subpages/projects/devxml/index.htm If you have any feedback or wish to be updated when this site is updated please email me at chrisw_new@hotmail.com thanks chris williams -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.zope.org/pipermail/zope-xml/attachments/20020814/0ba22ad5/attachment.html From jean at upfrontsystems.co.za Thu Aug 29 11:51:56 2002 From: jean at upfrontsystems.co.za (Jean Jordaan) Date: Sun Aug 10 16:54:52 2008 Subject: [Zope-xml] Is there an easy way of using DocBook documents in Zope yet? Message-ID: <3D6E431C.4060609@upfrontsystems.co.za> Hi all I've done http://www.google.com/search?q=site:lists.zope.org+docbook and didn't come up with anything conclusive. Is there anyone using DocBook XML documents in Zope, and rendering them to HTML? Using the DocBook XSL stylesheets? After looking around a bit, it seems as if XMLTransform http://www.zope.org/Members/arielpartners/XMLTransform would be a good place to start. ParsedXML looks more like what one would need to treat XML as datastore. Any opinions? TIA, -- Jean Jordaan Upfront Systems http://www.upfrontsystems.co.za From cstrong at arielpartners.com Thu Aug 29 13:03:50 2002 From: cstrong at arielpartners.com (Craeg K Strong) Date: Sun Aug 10 16:54:52 2008 Subject: [Zope-xml] Is there an easy way of using DocBook documents in Zope yet? References: <3D6E431C.4060609@upfrontsystems.co.za> Message-ID: <3D6E53F6.80103@arielpartners.com> Heh. I would tend to agree, but then again, I am the one who posted XMLTransform :) Using XMLTransform for this should be a no brainer. This is what it was designed for. It still, however, gives you a choice of which kind of object you use to store the actual XML and XSLT documents in. I don't yet know how to grab an entire well-formed XML document as a string from a ParsedXML object, but maybe others can enlighten me... However, as I note in the docs, many other choices exist including XMLFile from XMLKit. It all depends on your requirements. If you don't really care about manipulating the XML as NodeSets but rather want to treat them more like documents, then one of the Zope builtin object like DTMLDocument or PageTemplate might be more appropriate... Hope this helps, --Craeg Jean Jordaan wrote: > Hi all > > I've done > http://www.google.com/search?q=site:lists.zope.org+docbook > and didn't come up with anything conclusive. Is there anyone using > DocBook XML documents in Zope, and rendering them to HTML? Using the > DocBook XSL stylesheets? After looking around a bit, it seems as if > XMLTransform http://www.zope.org/Members/arielpartners/XMLTransform > would be a good place to start. ParsedXML looks more like what one > would need to treat XML as datastore. Any opinions? > > TIA, From cnd at ecn.purdue.edu Thu Aug 29 14:56:12 2002 From: cnd at ecn.purdue.edu (Christopher N. Deckard) Date: Sun Aug 10 16:54:52 2008 Subject: [Zope-xml] Is there an easy way of using DocBook documents in Zope yet? In-Reply-To: <3D6E53F6.80103@arielpartners.com> References: <3D6E431C.4060609@upfrontsystems.co.za> <3D6E53F6.80103@arielpartners.com> Message-ID: <20020829135612.68836159.cnd@ecn.purdue.edu> On Thu, 29 Aug 2002 13:03:50 -0400, Craeg K Strong spoke forth: > I don't yet know how to grab an entire well-formed XML document as > a string from a ParsedXML object, but maybe others can enlighten > me... The 'index_html' method of ParsedXML returns the XML as a string. Have you tried that? -Chris From cstrong at arielpartners.com Thu Aug 29 15:17:36 2002 From: cstrong at arielpartners.com (Craeg K Strong) Date: Sun Aug 10 16:54:52 2008 Subject: [Zope-xml] Is there an easy way of using DocBook documents in Zope yet? References: <3D6E431C.4060609@upfrontsystems.co.za> <3D6E53F6.80103@arielpartners.com> <20020829135612.68836159.cnd@ecn.purdue.edu> Message-ID: <3D6E7350.2000402@arielpartners.com> Christopher N. Deckard wrote: > On Thu, 29 Aug 2002 13:03:50 -0400, Craeg K Strong spoke forth: > > >>I don't yet know how to grab an entire well-formed XML document as >>a string from a ParsedXML object, but maybe others can enlighten >>me... > > > The 'index_html' method of ParsedXML returns the XML as a string. > Have you tried that? > > -Chris > I just did, and you are quite right! So if your docbook format XML document was contained in a ParsedXML object called foo, you would create a DTMLDocument called, for example, bar with the contents: And then list "bar" as the sourceID of the XMLTransform. A bit clunky, but it works! I am hoping the authors of ParsedXML add a __call__() method in their next release that does the same thing as index_html() which would obviate the extra DTMLDocument step. I will update the README file accordingly. Thanks, --Craeg From cnd at ecn.purdue.edu Thu Aug 29 15:26:27 2002 From: cnd at ecn.purdue.edu (Christopher N. Deckard) Date: Sun Aug 10 16:54:52 2008 Subject: [Zope-xml] Is there an easy way of using DocBook documents in Zope yet? In-Reply-To: <3D6E7350.2000402@arielpartners.com> References: <3D6E431C.4060609@upfrontsystems.co.za> <3D6E53F6.80103@arielpartners.com> <20020829135612.68836159.cnd@ecn.purdue.edu> <3D6E7350.2000402@arielpartners.com> Message-ID: <20020829142627.385d96da.cnd@ecn.purdue.edu> On Thu, 29 Aug 2002 15:17:36 -0400, Craeg K Strong spoke forth: > I just did, and you are quite right! Cool! > So if your docbook format XML document was contained in > a ParsedXML object called foo, you would create a DTMLDocument > called, for example, bar with the contents: > > > > And then list "bar" as the sourceID of the XMLTransform. > > A bit clunky, but it works! I am hoping the authors of > ParsedXML add a __call__() method in their next release > that does the same thing as index_html() > which would obviate the extra DTMLDocument step. Really, I am not quite sure why Martijn originally overrided index_html for ParsedXML. Once you know it works that way, it's possible to get around it. I tried to make a Product that subclassed ParsedXML and could not every figure out how to get to an index_html to parse and render the XML document as I wanted it to. If renamed index_html in the ParsedXML product, I could get it to work. -Chris From kra at monkey.org Thu Aug 29 17:51:24 2002 From: kra at monkey.org (Karl Anderson) Date: Sun Aug 10 16:54:52 2008 Subject: [Parsed-XML-Dev] Re: [Zope-xml] Is there an easy way of using DocBook documents in Zope yet? In-Reply-To: Craeg K Strong's message of "Thu, 29 Aug 2002 15:17:36 -0400" References: <3D6E431C.4060609@upfrontsystems.co.za> <3D6E53F6.80103@arielpartners.com> <20020829135612.68836159.cnd@ecn.purdue.edu> <3D6E7350.2000402@arielpartners.com> Message-ID: Craeg K Strong writes: > So if your docbook format XML document was contained in > a ParsedXML object called foo, you would create a DTMLDocument > called, for example, bar with the contents: > > > > And then list "bar" as the sourceID of the XMLTransform. > > A bit clunky, but it works! I am hoping the authors of > ParsedXML add a __call__() method in their next release > that does the same thing as index_html() > which would obviate the extra DTMLDocument step. Well, to be Zopish, XSLTransform should try index_html if __call__ isn't there (actually, before __call__). And to be flexible, XSLTransform should let you specify the method used to get XML from the source and sheet object(s), so you can feed it objects for which XML isn't their main reason for living (ZDOM, StructuredText, whatever). Anyway, unless you're caching, you don't want to render the top ParsedXML object if you're using it in plumbing, because that's expensive. You want to get the proxied DOM object with getDOMObj() and render that. -- Karl Anderson kra@monkey.org http://www.monkey.org/~kra/ From cstrong at arielpartners.com Thu Aug 29 19:09:33 2002 From: cstrong at arielpartners.com (Craeg K Strong) Date: Sun Aug 10 16:54:52 2008 Subject: [Parsed-XML-Dev] Re: [Zope-xml] Is there an easy way of using DocBook documents in Zope yet? References: <3D6E431C.4060609@upfrontsystems.co.za> <3D6E53F6.80103@arielpartners.com> <20020829135612.68836159.cnd@ecn.purdue.edu> <3D6E7350.2000402@arielpartners.com> Message-ID: <3D6EA9AD.8080206@arielpartners.com> See comments embedded below: Karl Anderson wrote: > Craeg K Strong writes: > > >>So if your docbook format XML document was contained in >>a ParsedXML object called foo, you would create a DTMLDocument >>called, for example, bar with the contents: >> >> >> >>And then list "bar" as the sourceID of the XMLTransform. >> >>A bit clunky, but it works! I am hoping the authors of >>ParsedXML add a __call__() method in their next release >>that does the same thing as index_html() >>which would obviate the extra DTMLDocument step. > > > Well, to be Zopish, XSLTransform should try index_html if __call__ > isn't there (actually, before __call__). And to be flexible, > XSLTransform should let you specify the method used to get XML from the > source and sheet object(s), so you can feed it objects for which XML > isn't their main reason for living (ZDOM, StructuredText, whatever). OK. Let me repeat back to you what I think I heard: The Source ID should accept either a Zope ID or a Python expression of the form "Zope ID".method() So you could enter things like: foo foo.index_html() bar.getDOMObj().serialize("ascii") Hmmm. Maybe what I do is simply treat the result as an expression and see if it evaluates to a well-formed XML document? But I still have to put in "magic" such that if I get only a bare object ID ("foo" above) I have to append ".index_html()" to it. OK. That shouldn't be too hard. I will put it in the Todo. > > Anyway, unless you're caching, you don't want to render the top > ParsedXML object if you're using it in plumbing, because that's > expensive. You want to get the proxied DOM object with getDOMObj() > and render that. > XMLTransform supports caching, but with the above capabilities you could do it however you wanted. --Craeg From cstrong at arielpartners.com Thu Aug 29 19:24:25 2002 From: cstrong at arielpartners.com (Craeg K Strong) Date: Sun Aug 10 16:54:52 2008 Subject: [Zope-xml] Re: XMLTransform References: <20011101205505.A4724@vet.uu.nl> <3D6C508C.5020109@arielpartners.com> <20020828184650.GB19710@vet.uu.nl> <3D6D3DCE.3040002@arielpartners.com> <20020829220121.GB24788@vet.uu.nl> Message-ID: <3D6EAD29.60801@arielpartners.com> Hello: I have belatedly realized that we should have had this conversation on the mailing list, as I am now repeating information in emails to you and to zope-xml! :-} Martijn Faassen wrote: > Craeg K Strong wrote: > > I'll try to add a __call__() method that does this and work out a new > release. :) That will be very useful. But Karl Anderson recommended that I add the ability to specify full Python expressions to XMLTransform instead of bare object IDs. That way, one could specify something like: context.doc.writeStream("ascii").read() and get the right thing. I think enhancing both products is the Right Thing. > I'll talk to Jim Fulton about it when I see him online in IRC. :) ok > My main interest would lie in implementing a framework for things like this > in Zope 3, hidden behind a set of clear interfaces so it's easy to plug in > all kinds of XML/XPath/XSLT/etc engines. That sounds right to me. > > I also need to play with this in Zope 2 some more as it'll be around for > quite a while yet, but my main development target would be Zope 3. Agreed. I expect all of our stuff to evolve quite a bit. We can take advantage of these learnings for Zope 3. > It's quite possible for you to get parts of XMLTransform included into a > Zope release; get CVS checkin rights, write a proposal and discuss it > with other Zope developers. (though this process takes a lot of > persistence :) That would be nice. But I think it first probably has to sit for a few months and see how people use it and where it needs to be improved. Kind of like a fine wine :-) > I haven't played with FOP technologies yet, but am very interested in these. > Right now we use a custom python script to generate PDFs using ReportLab, > but a more general XSLT and Formatting Object technology approach is > interesting to me. Yes. ReportLab does not support CSS, right? It seems fairly limited to me. With Fop we have produced professional-looking tri-fold brochures, whitepapers, etc. I think the FO standard in general is gathering steam and is the way to go for the future. HEY! I just had a thought. How about this for a goal: including a full Docbook-lite example in Zope out of the box? It would include - sample docbook XML documents (obtained/assembled through various means) - sample docbook XSLT transforms - multiple output types (simple HTML, fancy HTML, STX, and FO) - a FO to PDF technology So you have a professional Docbook compliant XML publishing system right out of the box! The challenges would be: - need the XMLDocumentAssembler - need the Fopper - need a decent set of docbook-lite sample XML docs and XSLTs We could rustle those up within the next 3-4 months, dontcha think? Another idea: should this be in any way associated with Silva? At the very least, maybe there are some pieces of silva that we can incorporate. I am very interested in how it allows the user to edit in structured text and then turns the result into XML. What if it turned the result into *docbook-lite* XML, and then it all plugged into the same system. Yikes! Then you get a system that accepts multiple formats and can produce multiple formats. You have a publishing powerhouse.... > I think it would be relatively straightforward to use PyXML's XPath engine > with ParsedXML to create an XMLDocumentAssembler. (though there are some > bugs with PyXML XPath's interaction with ParsedXML, at least with XPath unions) > > We should gather some people on the zope-xml list to discuss > issues like this. I'd like to design some set of interfaces together > and consider various architectural options for Zope 3. yes. > > (this may also see fruitition in Zope 2.7, which is supposed to carry some > of Zope 3's component architecture) Absolutely. > > Regards, > > Martijn > --Craeg From kra at monkey.org Thu Aug 29 20:28:44 2002 From: kra at monkey.org (Karl Anderson) Date: Sun Aug 10 16:54:52 2008 Subject: [Parsed-XML-Dev] Re: [Zope-xml] Is there an easy way of using DocBook documents in Zope yet? In-Reply-To: Craeg K Strong's message of "Thu, 29 Aug 2002 19:09:33 -0400" References: <3D6E431C.4060609@upfrontsystems.co.za> <3D6E53F6.80103@arielpartners.com> <20020829135612.68836159.cnd@ecn.purdue.edu> <3D6E7350.2000402@arielpartners.com> <3D6EA9AD.8080206@arielpartners.com> Message-ID: Craeg K Strong writes: > See comments embedded below: > > Karl Anderson wrote: > > Well, to be Zopish, XSLTransform should try index_html if __call__ > > isn't there (actually, before __call__). And to be flexible, > > XSLTransform should let you specify the method used to get XML from the > > source and sheet object(s), so you can feed it objects for which XML > > isn't their main reason for living (ZDOM, StructuredText, whatever). > > OK. Let me repeat back to you what I think I heard: > > The Source ID should accept either a Zope ID > > or a Python expression of the form "Zope ID".method() > > So you could enter things like: > > foo > foo.index_html() > bar.getDOMObj().serialize("ascii") no way - you want this to be configurable TTW, and you don't want to exec python code that can be gotten TTW, even if you think you're secure. Let people use a python script if they need to do that. I recommend accepting an optional method name, having to write a script skin to handle parameters isn't so bad for users. It's just an organizational issue, really. You did crib off of XSLTemplate, right? ;) > But I still have to put in "magic" such that if I get only a bare > object ID ("foo" above) I have to append ".index_html()" to it. Looking at my old cruft, what I did was str(source) if no method name was given, which should work for ParsedXML. -- Karl Anderson kra@monkey.org http://www.monkey.org/~kra/ From cstrong at arielpartners.com Thu Aug 29 20:54:35 2002 From: cstrong at arielpartners.com (Craeg K Strong) Date: Sun Aug 10 16:54:52 2008 Subject: [Parsed-XML-Dev] Re: [Zope-xml] Is there an easy way of using DocBook documents in Zope yet? References: <3D6E431C.4060609@upfrontsystems.co.za> <3D6E53F6.80103@arielpartners.com> <20020829135612.68836159.cnd@ecn.purdue.edu> <3D6E7350.2000402@arielpartners.com> <3D6EA9AD.8080206@arielpartners.com> Message-ID: <3D6EC24B.8000402@arielpartners.com> Karl Anderson wrote: > Craeg K Strong writes: >>See comments embedded below: >>Karl Anderson wrote: >>So you could enter things like: >> >>foo >>foo.index_html() >>bar.getDOMObj().serialize("ascii") > > no way - you want this to be configurable TTW, and you don't want to > exec python code that can be gotten TTW, even if you think you're > secure. Let people use a python script if they need to do that. > > I recommend accepting an optional method name, having to write a > script skin to handle parameters isn't so bad for users. It's just an > organizational issue, really. Oh yeah, security So the enhancement is a) have an optional method name that b) defaults to __str__ > You did crib off of XSLTemplate, right? ;) Oh crap. I wish I had seen that. I would most certainly have cribbed. No, I can honestly say that this was a case of great minds thinking alike ;-) In any event, XMLTransform.py was the easiest part. The things that consumed many hours were a) Coming up with the architecture: separating out CacheManager and TransformerRegistry and how transformers could be organized in a way that is policy neutral. That is, a design that would allow people to organize their XSLTs any way they wanted. b) Porting to multiple XSLT libraries. *Especially* supporting URI resolution. Every library has their own way of doing it, and it seems to change all the time. For example, between 0.11 and 0.12 the 4Suite URI resolver API changed radically. (For the better) In the end I only packaged up support for libxslt, 4suite 11 and 4suite 12, although I tried out several others... > Looking at my old cruft, what I did was str(source) if no method name > was given, which should work for ParsedXML. Yep. Seems like the right thing to do. --Craeg From jean at upfrontsystems.co.za Fri Aug 30 03:02:56 2002 From: jean at upfrontsystems.co.za (Jean Jordaan) Date: Sun Aug 10 16:54:52 2008 Subject: [Zope-xml] Re: XMLTransform References: <20011101205505.A4724@vet.uu.nl> <3D6C508C.5020109@arielpartners.com> <20020828184650.GB19710@vet.uu.nl> <3D6D3DCE.3040002@arielpartners.com> <20020829220121.GB24788@vet.uu.nl> <3D6EAD29.60801@arielpartners.com> Message-ID: <3D6F18A0.9010908@upfrontsystems.co.za> Craeg K Strong wrote: > Yikes! Then you get a system that accepts multiple formats and > can produce multiple formats. You have a publishing powerhouse.... Yes! That's the idea :)) -- Jean Jordaan Upfront Systems http://www.upfrontsystems.co.za From christophe.robert at culture.gouv.fr Fri Aug 30 10:42:40 2002 From: christophe.robert at culture.gouv.fr (christophe robert) Date: Sun Aug 10 16:54:52 2008 Subject: [Zope-xml] How to use XML in zope In-Reply-To: <3D6C55D6.2090608@arielpartners.com> References: <01a201c23a24$09ec4cf0$0280a8c0@armadillo> <1028309239.1823.9.camel@pc004cyr 2.culture.fr> <021901c23a2a$91bc0110$0280a8c0@armadillo> <1028563441.1585.32.camel@pc004cyr2.culture.fr> <3D6C55D6.2090608@arielpartners.com> Message-ID: <1030718561.1938.17.camel@pc004cyr2.culture.fr> Le mer 28/08/2002 ? 06:47, Craeg K Strong a ?crit : > Hello: > > > At long last, we have released XMLTransform > http://www.zope.org/Members/arielpartners/XMLTransform > Do you think to use an XML database with XMLTransform ?? > also see > http://www.zope.org/Members/arielpartners/ExternalFile > http://www.zope.org/Members/arielpartners/CVSFile > > This completes the puzzle. With > - ExternalFile, CVSFile, and XMLTransform > you can finally do CVS-versioned > XML-XSLT based Zope development. > > (phew!) > > Hope this is helpful/relevant, > > --Craeg Strong > > christophe robert wrote: > > Le dim 04/08/2002 ? 23:16, Karl Anderson a ?crit : > > > >>"Adrian Hungate" writes: > >> > >> > >>>No, XMLKit does not currently have the ability to catalog the elements of an > >>>XML file. I am not sure that any of the current XML products do. > >> > >>You can catalog Parsed XML nodes - there's instructions in the wiki. > >> > > > > > > I have read "ParsedXMLCatalog", but i don't know where i put this code > > > > http://www.zope.org//Wikis/DevSite/Projects/ParsedXML/ParsedXMLCatalog > > > > app.catalogtest.catalog._product_meta_types = ( {'permission': > > 'Dummy', 'name': 'Manageable Element', 'action':'pass'},) > > > > there is a more explicit document > > > > thanks > > > > > >>>In theory it is possible, but I am not sure what you would hope to achive. > >>>The best way is probably to have a script process the XML into separate > >>>objects in the ZODB and catalog them. I know it is possible to catalog > >>>objects that are not in the ZODB, but I can't see what you would be able to > >>>do with the catalog entries. > >> > >>Lots of things! For example, a Parsed XML Zope proxy node isn't in > >>the ZODB - every time you're getting a node you're creating a new > >>proxy object - but you can catalog that traversal path and get a new > >>proxy object from that. > >> > >>More probably, use the catalog to not have to get to the object at > >>all. Think of the catalog as a fast read interface - a BTree for > >>finding, and LazyLists for displaying. > >> > >>-- > >>Karl Anderson kra@monkey.org http://www.monkey.org/~kra/ > >> > >>_______________________________________________ > >>Zope-xml mailing list > >>Zope-xml@zope.org > >>http://lists.zope.org/mailman/listinfo/zope-xml > >> > > > > > > > > > > _______________________________________________ > > Zope-xml mailing list > > Zope-xml@zope.org > > http://lists.zope.org/mailman/listinfo/zope-xml > > > -- > Craeg K Strong, General Partner > Ariel Partners LLC > http://www.arielpartners.com > voice 781-647-2425 > fax 781-647-9690 > > NOTICE: This message is for the sole use of the intended recipient(s) > and may contain confidential and privileged information. Any review, > retransmission, dissemination or other use of, or taking of any action > in reliance upon, this information by persons or entities other than > the intended recipient is prohibited. If you are not the intended > recipient, please contact the sender by reply email and destroy all > copies -- including electronic copies -- of the original message. > From jean at upfrontsystems.co.za Fri Aug 30 11:41:24 2002 From: jean at upfrontsystems.co.za (Jean Jordaan) Date: Sun Aug 10 16:54:52 2008 Subject: [Zope-xml] From STX to DocBook References: <3D6E431C.4060609@upfrontsystems.co.za> Message-ID: <3D6F9224.2070808@upfrontsystems.co.za> Karl Anderson wrote: > IIRC Amos & Michel wrote The Zope Book in StructuredText, rendered to > Docbook and HTML. StructuredText isn't DOM, though, and I don't think > any transforms were used, just having the nodes output the relevent > tags. Yes, I recall this too. That route might come in useful for us .. (Hmm .. I just checked out cvs ... cvs.backtalk.sourceforge.net:/cvsroot/backtalk co BackTalk and it doesn't have any trace of DocBook .. ) Our project is a CMS where we have to do the usual: 1 pull in a lot of legacy docs 2 pull in new content as it gets done 3 allow collaborative online creation of new content (possibly) The legacy docs are currently '.doc', some '.ppt', some '.html', and many of them have embedded OLE stuff from the rest of M$ Office. For option 3 the StructuredText -> DocBook route would be good. Option 1 will probably involve a lot of manual editing followed by http://wvware.sourceforge.net , followed by munging to DocBook, and option 2 will entail getting the client to use a standard stylesheet -> wvware -> DocBook .. -- Jean Jordaan Upfront Systems http://www.upfrontsystems.co.za From paul at eurozope.org Fri Aug 30 12:06:34 2002 From: paul at eurozope.org (Paul Everitt) Date: Sun Aug 10 16:54:52 2008 Subject: [Zope-xml] From STX to DocBook In-Reply-To: <3D6F9224.2070808@upfrontsystems.co.za> Message-ID: <745640A5-BC32-11D6-9256-003065C7DEAE@eurozope.org> The Docbook stuff Amos did was in the SourceForge project for the Zope Book. --Paul On Friday, August 30, 2002, at 05:41 PM, Jean Jordaan wrote: > Karl Anderson wrote: >> IIRC Amos & Michel wrote The Zope Book in StructuredText, rendered to >> Docbook and HTML. StructuredText isn't DOM, though, and I don't think >> any transforms were used, just having the nodes output the relevent >> tags. > > Yes, I recall this too. That route might come in useful for us .. (Hmm > .. I just checked out > cvs ... cvs.backtalk.sourceforge.net:/cvsroot/backtalk co BackTalk > and it doesn't have any trace of DocBook .. ) > > Our project is a CMS where we have to do the usual: > 1 pull in a lot of legacy docs > 2 pull in new content as it gets done > 3 allow collaborative online creation of new content (possibly) > > The legacy docs are currently '.doc', some '.ppt', some '.html', and > many of them have embedded OLE stuff from the rest of M$ Office. > > For option 3 the StructuredText -> DocBook route would be good. > > Option 1 will probably involve a lot of manual editing followed by > http://wvware.sourceforge.net , followed by munging to DocBook, and > option 2 will entail getting the client to use a standard stylesheet > -> wvware -> DocBook .. > > -- Jean Jordaan > Upfront Systems http://www.upfrontsystems.co.za > > > _______________________________________________ > Zope-xml mailing list > Zope-xml@zope.org > http://lists.zope.org/mailman/listinfo/zope-xml > > --Paul OSCOM - Open Source Content Management Conference September 25th - 27th 2002, Berkeley, California http://www.oscom.org/conferences/berkeley2002/ From jean at upfrontsystems.co.za Fri Aug 30 12:58:38 2002 From: jean at upfrontsystems.co.za (Jean Jordaan) Date: Sun Aug 10 16:54:52 2008 Subject: [Zope-xml] From STX to DocBook References: <745640A5-BC32-11D6-9256-003065C7DEAE@eurozope.org> Message-ID: <3D6FA43E.3000508@upfrontsystems.co.za> Paul Everitt wrote: > The Docbook stuff Amos did was in the SourceForge project for the Zope > Book. Scrabble, scrabble, scrabble .. zopebook-jp.sourceforge.net .. nah .. ah! http://zope-book.sourceforge.net/ and http://sourceforge.net/cvs/?group_id=21038 :)) Thank you Paul! -- Jean Jordaan Upfront Systems http://www.upfrontsystems.co.za From cstrong at arielpartners.com Fri Aug 30 19:45:50 2002 From: cstrong at arielpartners.com (Craeg Strong) Date: Sun Aug 10 16:54:52 2008 Subject: [Zope-xml] XMLTransform interface alternatives References: <3D6E431C.4060609@upfrontsystems.co.za> <3D6E53F6.80103@arielpartners.com> <20020829135612.68836159.cnd@ecn.purdue.edu> <3D6E7350.2000402@arielpartners.com> Message-ID: <3D7003AE.7050002@arielpartners.com> See below: Karl Anderson wrote: >Craeg K Strong writes: > >>So if your docbook format XML document was contained in >>a ParsedXML object called foo, you would create a DTMLDocument >>called, for example, bar with the contents: >> >> >> >>And then list "bar" as the sourceID of the XMLTransform. >> >>A bit clunky, but it works! I am hoping the authors of >>ParsedXML add a __call__() method in their next release >>that does the same thing as index_html() >>which would obviate the extra DTMLDocument step. >> >> >Well, to be Zopish, XSLTransform should try index_html if __call__ >isn't there (actually, before __call__). And to be flexible, >XSLTransform should let you specify the method used to get XML from the >source and sheet object(s), so you can feed it objects for which XML >isn't their main reason for living (ZDOM, StructuredText, whatever). > >Anyway, unless you're caching, you don't want to render the top >ParsedXML object if you're using it in plumbing, because that's >expensive. You want to get the proxied DOM object with getDOMObj() >and render that. > After a good nights' sleep, I am thinking more clearly. There is a very good reason I want/need to use __call__() Here is the reason. I am assuming that the Zope object does its own evaluation, and that the RESULTS of this evaluation is what I actually want. For example, if the Zope object is some kind of ZSQL object (hypothetical example, not sure if such a product exists) then the text of the object might be some kind of SQL query. I *don't* want the SQL query, rather the *results* of running the SQL query (expressed as XML, of course). By calling __call__() I am more clearly communicating this semantic IMHO. Same thing with DTML. Imagine the following document: Hello, world Calling __call__() makes the dtml-var get evaluated correctly *before* XMLTransform sees it. IMHO, Neither __str__ nor index_html() implies this semantic the way __call__ does (obviously, since its Python code, you can code these methods however you want) For example, I could see where __str__ could return a string representation of an object "as is" without processing. I could see index_html() calling __call__() and then wrapping the results in to make a w3c compliant HTML 4.0 document. I am aware that such conventions don't really exist (or aren't enforced), but in my opinion the above seems intuitively correct to me. Anyway, perhaps the thing to do is to leave__call__ as the default, but allow folks to specify alternative method names if they want. That way they can use __str__ or index_html if the situation calls for it.... --Craeg