Class: Mtk_xslt::Xalan
Direct Known Subclasses
Constant Summary collapse
- TRANSFORMER_FACTORY_IMPL =
"org.apache.xalan.processor.TransformerFactoryImpl"
Instance Method Summary collapse
-
#initialize ⇒ Xalan
constructor
A new instance of Xalan.
- #name ⇒ Object
- #transform(xslt, infile, outfile) ⇒ Object
Constructor Details
#initialize ⇒ Xalan
Returns a new instance of Xalan.
60 61 62 63 64 |
# File 'lib/ontomde-core/xslt.rb', line 60 def initialize System.setProperty("javax.xml.transform.TransformerFactory", TRANSFORMER_FACTORY_IMPL) @tf = TransformerFactory.newInstance raise Exception.new("\n*** *******\n*** ERROR loading saxon into jruby.\n*** This error may be caused by missing xalan jars in jruby lib directory\n*** *******") if @tf.nil? end |
Instance Method Details
#name ⇒ Object
56 57 58 |
# File 'lib/ontomde-core/xslt.rb', line 56 def name return "jruby/xalanl" end |
#transform(xslt, infile, outfile) ⇒ Object
52 53 54 55 |
# File 'lib/ontomde-core/xslt.rb', line 52 def transform(xslt,infile,outfile) transformer = @tf.newTransformer(StreamSource.new(xslt)) transformer.transform(StreamSource.new(infile), StreamResult.new(outfile)) end |