Class: Nokogiri::XML::Schematron::Namespace

Inherits:
Base
  • Object
show all
Defined in:
lib/nokogiri/xml/schematron/namespace.rb

Overview

The internal representation of the <sch:ns> XML element.

For example:

namespace = Nokogiri::XML::Schematron::Namespace.new(nil, prefix: "ex", uri: "http://example.com/ns#")
# => #<Nokogiri::XML::Schematron::Namespace:0x00007f8486acd4f8 @parent=nil, @children=[], @options={:prefix=>"ex", :uri=>"http://example.com/ns#"}>
namespace.to_builder.to_xml
# => "<?xml version=\"1.0\"?>\n<sch:ns xmlns:sch=\"http://purl.oclc.org/dsdl/schematron\" prefix=\"ex\" uri=\"http://example.com/ns#\"/>\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

#prefixString

Returns the value of the @prefix XML attribute.

Returns:

  • (String)

    the value of the @prefix XML attribute.



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

attribute :prefix

#uriString

Returns the value of the @uri XML attribute.

Returns:

  • (String)

    the value of the @uri XML attribute.



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

attribute :uri