Forum OpenACS Q&A: Anybody have the code to apply_xsl?

Collapse
Posted by Barry Books on
In the original 4.0 version from aD there was a java function that could apply a stylesheet to an XML clob field. I dug thru my old code and CVS and I can find the docs but not the code.

If you hava a copy can you either post it or send it to me.

thanks

Collapse
Posted by Dave Bauer on
You can use ns_xml or tDOM (whichever you are using) to apply XSL stylesheets. Maybe we can add that to the XML abstraction procedures.
Collapse
Posted by Barry Books on
I'm trying to build a pdf from xml in the database and put it back into the database. It seems a bit silly to pull it out and then put it back in because I need to batch about 20,000 of them every night.
Collapse
Posted by Bart Teeuwisse on
Barry,

if you find yourself taking the tDOM road, you can find an example of using tDOM for XSL conversion in http://cvs.openacs.org/cvs/openacs-4/contrib/packages/irc-logger/tcl/irc-logger-procs.tcl?view=auto&rev=1.6.

Including a custom Tcl function used in the transformation.

/Bart

Collapse
Posted by Andrei Popov on
As long as XML that is being pulled out is a valid one, yes...  Otherwise it might be advisable to pipe it through something like Tidy to at least close out tags and replace &'s <'s, >'s, etc. with named entities.  If that "XML" is user-drivven, there might be a problem.