Class: Xmldsig::Transforms::XPath
- Defined in:
- lib/xmldsig/transforms/xpath.rb
Constant Summary collapse
- REC_XPATH_1991116_QUERY =
"(//. | //@* | //namespace::*)"
Instance Attribute Summary collapse
-
#xpath_query ⇒ Object
readonly
Returns the value of attribute xpath_query.
Attributes inherited from Transform
#node, #transform_node, #with_comments
Instance Method Summary collapse
-
#initialize(node, transform_node) ⇒ XPath
constructor
A new instance of XPath.
- #transform ⇒ Object
Constructor Details
#initialize(node, transform_node) ⇒ XPath
Returns a new instance of XPath.
8 9 10 11 |
# File 'lib/xmldsig/transforms/xpath.rb', line 8 def initialize(node, transform_node) @xpath_query = transform_node.at_xpath("ds:XPath", NAMESPACES).text super(node, transform_node) end |
Instance Attribute Details
#xpath_query ⇒ Object (readonly)
Returns the value of attribute xpath_query.
4 5 6 |
# File 'lib/xmldsig/transforms/xpath.rb', line 4 def xpath_query @xpath_query end |
Instance Method Details
#transform ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/xmldsig/transforms/xpath.rb', line 13 def transform node.xpath(REC_XPATH_1991116_QUERY) .reject { |n| !n.respond_to?(:xpath) } .reject { |n| n.xpath(@xpath_query, node.namespaces) } .each(&:remove) node end |