Class | Nokogiri::XSLT::Stylesheet |
In: |
lib/nokogiri/ffi/xslt/stylesheet.rb
lib/nokogiri/xslt/stylesheet.rb ext/nokogiri/xslt_stylesheet.c |
Parent: | Object |
A Stylesheet represents an XSLT Stylesheet object. Stylesheet creation is done through Nokogiri.XSLT. Here is an example of transforming an XML::Document with a Stylesheet:
doc = Nokogiri::XML(File.read('some_file.xml')) xslt = Nokogir::XSLT(File.read('some_transformer.xslt')) puts xslt.transform(doc)
See Nokogiri::XSLT::Stylesheet#transform for more transformation information.
Apply an XSLT stylesheet to an XML::Document. params is an array of strings used as XSLT parameters. returns serialized document
Apply an XSLT stylesheet to an XML::Document. params is an array of strings used as XSLT parameters. returns Nokogiri::XML::Document
Example:
doc = Nokogiri::XML(File.read(ARGV[0])) xslt = Nokogiri::XSLT(File.read(ARGV[1])) puts xslt.transform(doc, ['key', 'value'])