Class: Nokogiri::XML::Schematron::Rule
- Defined in:
- lib/nokogiri/xml/schematron/rule.rb
Overview
The internal representation of the <sch:rule> XML element.
For example:
rule = Nokogiri::XML::Schematron::Rule.new(nil, id: "rule1", context: "//ex:Example")
# => #<Nokogiri::XML::Schematron::Rule:0x00007fa1fb9e8410 @parent=nil, @children=[], @options={:id=>"rule1", :context=>"//ex:Example"}>
rule.to_builder.to_xml
# => "<?xml version=\"1.0\"?>\n<sch:rule xmlns:sch=\"http://purl.oclc.org/dsdl/schematron\" id=\"rule1\" context=\"//ex:Example\"/>\n"
Instance Attribute Summary collapse
-
#context ⇒ String
The value of the @context XML attribute.
-
#id ⇒ String
The value of the @id XML attribute.
Attributes inherited from Base
Instance Method Summary collapse
-
#assert(**options) {|assert| ... } ⇒ Nokogiri::XML::Schematron::Assertion
Create a new
Assertion
object.
Methods inherited from Base
attribute, element, #initialize, #to_builder
Constructor Details
This class inherits a constructor from Nokogiri::XML::Schematron::Base
Instance Attribute Details
#context ⇒ String
Returns the value of the @context XML attribute.
19 |
# File 'lib/nokogiri/xml/schematron/rule.rb', line 19 attribute :context |
#id ⇒ String
Returns the value of the @id XML attribute.
23 |
# File 'lib/nokogiri/xml/schematron/rule.rb', line 23 attribute :id |
Instance Method Details
#assert(**options) {|assert| ... } ⇒ Nokogiri::XML::Schematron::Assertion
Create a new Assertion
object.
33 |
# File 'lib/nokogiri/xml/schematron/rule.rb', line 33 element :assert, Nokogiri::XML::Schematron::Assertion |