Re: [Zope] python ques
That works beutifully, however I ran into another problem... :) I found that "page.xsl" cannot be a zope object, be it a LocalFS['filename'] or a DTML Method or DTML Doc. Is there a way using LocalFS or any other product where I can pass it the actual path rather than the object...?? TIA AM tomas@fabula.de wrote:
On Tue, Aug 20, 2002 at 11:06:33PM -0700, AM wrote:
Hi all, I realize the following is a python question but my post on comp.lang.python has been languishing there for some time now without any replies, so I just wanted to check if any of you knew a way out of my problem...
I am trying to convert XML docs to HTML docs using an XSL file on the fly. The function (external method ) that I have which does it is the following:
## code begin
import libxml2 import libxslt
styledoc = libxml2.parseFile("page.xsl") style = libxslt.parseStylesheetDoc(styledoc) doc = libxml2.parseFile("xml_file.xml") result = style.applyStylesheet(doc, None) #--- style.saveResultToFilename("-", result, 0) #--- style.freeStylesheet() doc.freeDoc() result.freeDoc()
## code end
You are looking for result.serialize(...), I think.
HTH -- tomas
-- ================================================================== Aseem Mohanty Neurobehavioral Systems Inc, 828 San Pablo Ave, Albany, CA 94706 (R) 510 7696011 (M) 510 3014871 (O) 510 5279231 ================================================================== "I saw `cout' being shifted "Hello world" times to the left and stopped right there!!" -- Steve Gonedes ==================================================================
[AM]
That works beutifully, however I ran into another problem... :)
I found that "page.xsl" cannot be a zope object, be it a LocalFS['filename'] or a DTML Method or DTML Doc. Is there a way using LocalFS or any other product where I can pass it the actual path rather than the object...??
I use an exernal method and pass it the paths. It calls the xslt code and returns a string to the dtml page. If you work this out right, you can use relative paths and have the code find its own location. Then you never have to worry about exactly where things are absolutely located. Cheers, Tom P
participants (2)
-
AM -
Thomas B. Passin