Class: Lutaml::Xml::BlankNamespace

Inherits:
Namespace
  • Object
show all
Defined in:
lib/lutaml/xml/blank_namespace.rb

Overview

Special namespace class representing the blank namespace (xmlns=“”)

Used when elements explicitly need to opt out of their parent’s default namespace per W3C XML namespace semantics.

When a parent element uses default namespace format (xmlns=“uri”) and a child element should be in the blank namespace, the child must explicitly declare xmlns=“” to prevent inheriting the parent’s default namespace.

Examples:

Parent with default namespace, child needs blank

<root xmlns="http://example.com/ns">
  <child xmlns="">Value</child>
</root>

Constant Summary

Constants inherited from Namespace

Namespace::W3C_RESERVED_PREFIXES, Namespace::W3C_RESERVED_URIS

Instance Attribute Summary

Attributes inherited from Namespace

#attribute_form_default, #documentation, #element_form_default, #imports, #includes, #prefix, #schema_location, #uri, #version

Class Method Summary collapse

Methods inherited from Namespace

all_uris, annotation, #attr_name, #attributes_qualified?, build, documentation, element_form_default_set?, #elements_qualified?, imports, includes, inheritance_strategy, #initialize, is_alias?, #prefixed?, schema_location, skip_w3c_reserved_check, uri, uri_aliases, version

Constructor Details

This class inherits a constructor from Lutaml::Xml::Namespace

Class Method Details

.attribute_form_defaultSymbol

Blank namespace has no attribute form default

Returns:

  • (Symbol)

    Always :unqualified



46
47
48
# File 'lib/lutaml/xml/blank_namespace.rb', line 46

def self.attribute_form_default
  :unqualified
end

.element_form_defaultSymbol

Blank namespace is always unqualified

Returns:

  • (Symbol)

    Always :unqualified



39
40
41
# File 'lib/lutaml/xml/blank_namespace.rb', line 39

def self.element_form_default
  :unqualified
end

.prefix_defaultnil

Blank namespace has no prefix

Returns:

  • (nil)

    Always nil for blank namespace



32
33
34
# File 'lib/lutaml/xml/blank_namespace.rb', line 32

def self.prefix_default
  nil
end

.to_keyString

Returns Unique key for namespace tracking.

Returns:

  • (String)

    Unique key for namespace tracking



25
26
27
# File 'lib/lutaml/xml/blank_namespace.rb', line 25

def self.to_key
  "blank"
end