Install
sudo gem install nokogiri
Contribute
github.com/tenderlove/nokogiri

An HTML, XML, SAX, & Reader parser with the ability to search documents via XPath or CSS3 selectors… and much more

Nokogiri

Module Nokogiri::XSLT

 

See Nokogiri::XSLT::Stylesheet for creating and maniuplating Stylesheet object.

Public Class Methods

parse(string) Show Source
 

Parse the stylesheet in string

# File lib/nokogiri/xslt.rb, line 24 24: def parse string 25: Stylesheet.parse_stylesheet_doc(XML.parse(string)) 26: end
quote_params(params) Show Source
 

Quote parameters in params for stylesheet safety

# File lib/nokogiri/xslt.rb, line 30 30: def quote_params params 31: parray = (params.instance_of?(Hash) ? params.to_a.flatten : params).dup 32: parray.each_with_index do |v,i| 33: if i % 2 > 0 34: parray[i]= 35: if v =~ /'/ 36: "concat('#{ v.gsub(/'/, %q{', "'", '}) }')" 37: else 38: "'#{v}'"; 39: end 40: else 41: parray[i] = v.to_s 42: end 43: end 44: parray.flatten 45: end