Class: Lutaml::Xml::NamespaceInheritanceStrategy

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

Overview

Base class for namespace inheritance strategies Determines if child elements inherit parent namespace based on W3C rules

W3C XML Schema defines elementFormDefault attribute which controls whether locally declared elements are in the target namespace by default.

  • “unqualified” (W3C default): children in blank namespace

  • “qualified”: children inherit parent namespace

Instance Method Summary collapse

Instance Method Details

#inherits?(element_type:, parent_ns_decl:, mapping:) ⇒ Boolean

Determine if child element should inherit parent namespace

Parameters:

  • element_type (Symbol)

    :model (complex type) or :native_value (simple type)

  • parent_ns_decl (NamespaceDeclaration)

    parent’s namespace declaration

  • mapping (Xml::Mapping)

    the mapping being evaluated

Returns:

  • (Boolean)

    true if child should inherit parent namespace

Raises:

  • (NotImplementedError)


21
22
23
# File 'lib/lutaml/xml/namespace_inheritance_strategy.rb', line 21

def inherits?(element_type:, parent_ns_decl:, mapping:)
  raise NotImplementedError, "#{self.class} must implement #inherits?"
end