Class: Nokogiri::XML::Schematron::Assertion
- Defined in:
- lib/nokogiri/xml/schematron/assertion.rb
Overview
The internal representation of the <sch:assert> XML element.
For example:
assertion = Nokogiri::XML::Schematron::Assertion.new(nil, test: "not(ex:Example)", message: "element \"ex:Example\" is NOT RECOMMENDED")
# => #<Nokogiri::XML::Schematron::Assertion:0x00007fa739a55dd8 @parent=nil, @children=[], @options={:test=>"not(ex:Example)", :message=>"element \"ex:Example\" is NOT RECOMMENDED"}>
assertion.to_builder.to_xml
# => "<?xml version=\"1.0\"?>\n<sch:assert xmlns:sch=\"http://purl.oclc.org/dsdl/schematron\" test=\"not(ex:Example)\">element \"ex:Example\" is NOT RECOMMENDED</sch:assert>\n"
Instance Attribute Summary collapse
-
#message ⇒ String
The text content of the <sch:assert> XML element.
-
#test ⇒ String
The value of the @test XML attribute.
Attributes inherited from Base
Method Summary
Methods inherited from Base
attribute, element, #initialize, #to_builder
Constructor Details
This class inherits a constructor from Nokogiri::XML::Schematron::Base
Instance Attribute Details
#message ⇒ String
Returns the text content of the <sch:assert> XML element.
18 |
# File 'lib/nokogiri/xml/schematron/assertion.rb', line 18 attribute :message |
#test ⇒ String
Returns the value of the @test XML attribute.
22 |
# File 'lib/nokogiri/xml/schematron/assertion.rb', line 22 attribute :test |