irc::logger::apply_xslt (public)
irc::logger::apply_xslt -rdf_log rdf_log -xsl_style xsl_style \ [ -package_id package_id ]
Defined in packages/irc-logger/tcl/irc-logger-procs.tcl
Transform the RDF IRC log to HTML using passed XSL stylesheet.
- Switches:
- -rdf_log (required)
- The full path to the IRC log in RDF format
- -xsl_style (required)
- The full path to the XSL stylesheet to transform the RDF log into HTML with.
- -package_id (optional)
- Returns:
- The transformed IRC log in HTML.
- Error:
- Return the empty string.
- Author:
- Bart Teeuwisse <bart.teeuwisse@thecodemill.biz>
- Created:
- 2003-01-27
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
Source code: # Parse the RDF log and the XSL style sheet into DOM trees. # Return the empty string if the XSL style could not be applied. set text "" # Return the empty string if the XSL style could not be applied. set text "" if {![catch {set rdf [dom parse [read [open $rdf_log r]]]} error_msg]} { if {![catch {set xsl [dom parse [read [open $xsl_style r]]]} error_msg]} { # Transform the RDF DOM tree to an HTML DOM tree if {![catch {set html [$rdf xslt $xsl]} error_msg]} { # Serialize the HTML DOM tree as HTML text set text [$html asHTML] } else { ns_log warning "irc::logger::apply_xslt - Could not transform RDF log '$rdf_log' to HTML with XSL sheet '$xsl_style': $error_msg" } } else { ns_log warning "irc::logger::apply_xslt - Could not parse $xsl_style: $error_msg" } $rdf delete } else { ns_log warning "irc::logger::apply_xslt - Could not parse $rdf_log: $error_msg" } # clean up the dom references, otherwise we have a mem leak. if {[info exists rdf]} { $rdf delete } if {[info exists xsl]} { $xsl delete } if {[info exists html]} { $html delete } return $textXQL Not present: Oracle Generic XQL file: packages/irc-logger/tcl/irc-logger-procs.xql
PostgreSQL XQL file: packages/irc-logger/tcl/irc-logger-procs-postgresql.xql