From plone at aexl.de Sun Sep 14 17:40:25 2003 From: plone at aexl.de (Axel Rutz) Date: Sun Aug 10 16:54:54 2008 Subject: [Zope-xml] LibXML2 Parse Error in CMFOODocument Message-ID: hi all, short version: how can i track down a libxml2 parse error? (i?m totally new to libxml2 language binding...) long version: when trying cmfoodocument 1.2 and adding a new doc i get this traceback (doing a webdav put test.sxw gives the same...) as the source shows: - the doc is *successfolly* parsed - only after serializing the result gives a parse error... what can this be??? any hints appreciated! (i hope this is the most appropriate group for this question.) axel >Traceback (innermost last): > Module ZPublisher.Publish, line 98, in publish > Module ZPublisher.mapply, line 88, in mapply > Module ZPublisher.Publish, line 39, in call_object > Module webdav.NullResource, line 108, in PUT > Module Products.CMFCore.PortalFolder, line 335, in PUT_factory > Module Products.CMFCore.PortalFolder, line 362, in invokeFactory > Module Products.CMFCore.TypesTool, line 824, in constructContent > Module Products.CMFCore.TypesTool, line 513, in constructInstance > Module Products.CMFOODocument.OODocument, line 259, in addOODocument > Module Products.CMFOODocument.OODocument, line 329, in edit > Module Products.CMFOODocument.OODocument, line 343, in _edit > Module Products.CMFOODocument.OODocument, line 392, in _cook > Module Products.CMFOODocument.OODocument, line 461, in _storeCooked > Module Products.CMFOODocument.OODocument, line 406, in _parseImages > Module libxml2, line 696, in parseDoc >parserError: xmlParseDoc() failed From OODocument.py: def _cook(self): ... # libxml2 encoding translation xmlOutEnc=self.getOutEncoding(default='utf8') # read the content xml thisdoc=document.read('content.xml') # parse the content doc=libxml2.parseDoc(thisdoc) # this parse gives no errors... # apply the stylesheet (xslt transformation) result=_style.applyStylesheet(doc, params) # write html to string html=result.serialize(encoding=xmlOutEnc) # but this serialized one will give an error # free memory result.freeDoc() doc.freeDoc() # write rendered document to zodb self._storeCooked(body=html) #where _storeCooked calls self._parseImages(body) ... def _parseImages(self, html): ... doc=libxml2.parseDoc(html) ... From plone at aexl.de Thu Sep 18 18:25:42 2003 From: plone at aexl.de (Axel Rutz) Date: Sun Aug 10 16:54:54 2008 Subject: [Zope-xml] Re: LibXML2 Parse Error in CMFOODocument In-Reply-To: References: Message-ID: Axel Rutz schrieb: ... > when trying cmfoodocument 1.2 and adding a new doc i get this traceback > (doing a webdav put test.sxw gives the same...) ... > > Module libxml2, line 696, in parseDoc > >parserError: xmlParseDoc() failed hi all, i debugged it down: my plonesite/portal_properties/site_properties/default_charset was "iso8859-1". now it is "iso-8859-1" and everything works! when libxml2 does a serialize() with the "malformed"(?) "iso8859-1" encoding, it does not throw an exception. instead it serializes an empty document. this empty document later generates a xmlParseDoc() parserError. best! aexl From cfne72 at bigfoot.com Mon Sep 22 15:13:32 2003 From: cfne72 at bigfoot.com (Danial Vazquez) Date: Sun Aug 10 16:54:54 2008 Subject: [Zope-xml] Attract men or women easily d Message-ID: <6i17p5v$6j0t@056i00qvyt> An HTML attachment was scrubbed... URL: http://mail.zope.org/pipermail/zope-xml/attachments/20030922/21cac020/attachment.html