Class: Nokogiri::XML::Schematron::Schema
- Defined in:
- lib/nokogiri/xml/schematron/schema.rb
Overview
The internal representation of the <sch:schema> XML element.
For example:
schema = Nokogiri::XML::Schematron::Schema.new(id: "schema1", title: "Example schema")
# => #<Nokogiri::XML::Schematron::Schema:0x00007fa1fb9e3b68 @parent=nil, @children=[], @options={:id=>"schema1", :title=>"Example schema"}>
schema.to_builder.to_xml
# => "<?xml version=\"1.0\"?>\n<sch:schema xmlns:sch=\"http://purl.oclc.org/dsdl/schematron\" id=\"schema1\">\n <sch:title>Example schema</sch:title>\n</sch:schema>\n"
Instance Attribute Summary collapse
-
#id ⇒ String
The value of the @id XML attribute.
-
#title ⇒ String
The value of the @title XML element.
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(**options) {|schema| ... } ⇒ Schema
constructor
Create a new
Schema
object. -
#ns(**options) {|ns| ... } ⇒ Nokogiri::XML::Schematron::Namespace
Create a new
Namespace
object. -
#p(**options) {|p| ... } ⇒ Nokogiri::XML::Schematron::Paragraph
Create a new
Paragraph
object. -
#pattern(**options) {|pattern| ... } ⇒ Nokogiri::XML::Schematron::Pattern
Create a new
Pattern
object.
Methods inherited from Base
attribute, element, #to_builder
Constructor Details
#initialize(**options) {|schema| ... } ⇒ Schema
Create a new Schema
object.
63 64 65 |
# File 'lib/nokogiri/xml/schematron/schema.rb', line 63 def initialize(**, &block) super(nil, **, &block) end |
Instance Attribute Details
#id ⇒ String
Returns the value of the @id XML attribute.
21 |
# File 'lib/nokogiri/xml/schematron/schema.rb', line 21 attribute :id |
#title ⇒ String
Returns the value of the @title XML element.
25 |
# File 'lib/nokogiri/xml/schematron/schema.rb', line 25 attribute :title |
Instance Method Details
#ns(**options) {|ns| ... } ⇒ Nokogiri::XML::Schematron::Namespace
Create a new Namespace
object.
35 |
# File 'lib/nokogiri/xml/schematron/schema.rb', line 35 element :ns, Nokogiri::XML::Schematron::Namespace |
#p(**options) {|p| ... } ⇒ Nokogiri::XML::Schematron::Paragraph
Create a new Paragraph
object.
44 |
# File 'lib/nokogiri/xml/schematron/schema.rb', line 44 element :p, Nokogiri::XML::Schematron::Paragraph |
#pattern(**options) {|pattern| ... } ⇒ Nokogiri::XML::Schematron::Pattern
Create a new Pattern
object.
54 |
# File 'lib/nokogiri/xml/schematron/schema.rb', line 54 element :pattern, Nokogiri::XML::Schematron::Pattern |