Class: Nokogiri::XML::Schematron::Assertion

Inherits:
Base
  • Object
show all
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

Attributes inherited from Base

#children, #options, #parent

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

#messageString

Returns the text content of the <sch:assert> XML element.

Returns:

  • (String)

    the text content of the <sch:assert> XML element.



18
# File 'lib/nokogiri/xml/schematron/assertion.rb', line 18

attribute :message

#testString

Returns the value of the @test XML attribute.

Returns:

  • (String)

    the value of the @test XML attribute.



22
# File 'lib/nokogiri/xml/schematron/assertion.rb', line 22

attribute :test