Class: Xmldsign::Algorithms::XSLT
- Inherits:
-
Object
- Object
- Xmldsign::Algorithms::XSLT
- Defined in:
- lib/xmldsign/algorithms.rb
Instance Attribute Summary collapse
-
#transform_node ⇒ Object
readonly
Returns the value of attribute transform_node.
Instance Method Summary collapse
- #execute(doc) ⇒ Object
-
#initialize(transform_node) ⇒ XSLT
constructor
A new instance of XSLT.
- #stylesheet ⇒ Object
Constructor Details
#initialize(transform_node) ⇒ XSLT
Returns a new instance of XSLT.
33 34 35 |
# File 'lib/xmldsign/algorithms.rb', line 33 def initialize(transform_node) @transform_node = transform_node end |
Instance Attribute Details
#transform_node ⇒ Object (readonly)
Returns the value of attribute transform_node.
31 32 33 |
# File 'lib/xmldsign/algorithms.rb', line 31 def transform_node @transform_node end |
Instance Method Details
#execute(doc) ⇒ Object
43 44 45 |
# File 'lib/xmldsign/algorithms.rb', line 43 def execute(doc) stylesheet.apply doc end |
#stylesheet ⇒ Object
37 38 39 40 41 |
# File 'lib/xmldsign/algorithms.rb', line 37 def stylesheet doc = LibXML::XML::Document.new doc.root = transform_node.find('*[1]').first.copy(true) LibXSLT::XSLT::Stylesheet.new(doc) end |