Forum OpenACS Development: Converting XinHA HTML into OpenOffice using xslt

I have the following challenge. For mass mailings in contacts we allow the user to write HTML in the XinHA editor, which then is parsed rudamentally (only <p> and <br>) for preparation with openoffice.

I now stumbled upon an XSLT Stylesheet (http://xml.openoffice.org/servlets/ReadMsg?list=dev&msgNo=2776) which would allow the transformation of the HTML into OO. Luckily for us, we do not need the HEAD and HTML part with the method used by contacts (and probalby soon its own OO Package).

But how would I parse the HTML created by XinHA with the stylesheet? I think tclxslt (http://tclxml.sourceforge.net/tclxslt/3.1/README.html) might be the answer here.

My questions:

- Has anyone worked with tclxslt before?
- Is the approach with the stylesheet a good idea or should I just do a regsub with contact::oo::convert like

regsub -all -nocase "<p>" $content "<text:line-break/>" content
regsub -all -nocase "&nbsp;" $content " " content
regsub -all -nocase "</p>" $content "<text:line-break/>" content

Collapse
Posted by Gustaf Neumann on
tdom supports xslt.