Class: Lutaml::Xml::BlankNamespaceStrategy
- Inherits:
-
NamespaceResolutionStrategy
- Object
- NamespaceResolutionStrategy
- Lutaml::Xml::BlankNamespaceStrategy
- Defined in:
- lib/lutaml/xml/namespace_resolution_strategy.rb
Overview
Strategy for elements that should be in blank namespace
Used for native types (‘:string`, `:integer`, etc.) WITHOUT explicit `xml_namespace` declaration. These elements should serialize in the blank namespace even when their parent uses a namespace.
W3C Compliance:
-
If parent uses PREFIX format: no xmlns needed
-
If parent uses DEFAULT format: xmlns=“” must be added to prevent inheritance
Instance Attribute Summary
Attributes inherited from NamespaceResolutionStrategy
#namespace_uri, #prefix, #requires_blank_xmlns, #use_prefix
Instance Method Summary collapse
-
#initialize(parent_uses_default: false) ⇒ BlankNamespaceStrategy
constructor
Initialize with blank namespace settings.
Methods inherited from NamespaceResolutionStrategy
Constructor Details
#initialize(parent_uses_default: false) ⇒ BlankNamespaceStrategy
Initialize with blank namespace settings
75 76 77 78 79 80 81 82 |
# File 'lib/lutaml/xml/namespace_resolution_strategy.rb', line 75 def initialize(parent_uses_default: false) super( use_prefix: false, prefix: nil, namespace_uri: nil, requires_blank_xmlns: parent_uses_default ) end |