[Zopexmlmethods-users] How to call XSLTMethod from Python script?
Brought to you by:
arielpartners,
philikon
|
From: Phuong N. <phu...@em...> - 2004-11-07 23:32:13
|
Hi there!
I have posted the same issue in the discussion forum but receive no response. Anyway, I'd like some help for the
following problem:
I've written a Python script to call the XSLT Method to transform an existing XHTML document(comments_html) to a new
one, then I want to replace the old one with this new document (write to disk) after transforming. In my script, I
wrote:
# Locate the source XHTML file in ZODB
src_obj = context.comments_html
# Call the XSLT method
dst_tree = context.append_comment.transform('comments_html') #not working!!!
#Update the current comments_html
src_obj.manage_upload(dst_tree)
where 'append_comment' is my XSLT method that is applied to 'comments_html'. However, it doesn't work for me when I
call this XSLT method from Python. I have no idea how to get the result tree (dst_tree) out from Python so that I can
pass its content to the manage_upload(), which will replace the current document's content.
Please note: It does work for me when I call this transformation from the ZPT:
<span tal:replace="structure here/comments_html/append_comment">
The document content is replaced here!
</span>
This returns the result tree with the format I want after transforming. I love to see this result from my Python
script too.
Please help. Many thanks!
Phuong Nguyen
Research Associate
Spatial Information Architecture
School of Architecture and Design
RMIT University
email: phu...@rm...
|