Skip to main content

set_attributes_wild

Function set_attributes_wild 

Source
pub fn set_attributes_wild(
    document: &mut Document,
    attrs: &FxHashMap<String, String>,
    nodes: Vec<Node>,
    _nmatched: usize,
) -> Result<()>
Expand description

Set attributes on a tree containing wildcards, creating XMDual wrappers. Perl: setAttributes_wild($document, $attributes, @nodes) — Rewrite.pm L195-217

Faithfully translated from Perl. The structure created is:

<XMDual role="...">
  <XMApp>                    <!-- content arm -->
    <XMTok decl_id="..." />  <!-- semantic operator -->
    <XMRef idref="..." />    <!-- references to wildcards -->
  </XMApp>
  <XMWrap>                   <!-- presentation arm -->
    [original nodes]         <!-- with _wildcard markers -->
  </XMWrap>
</XMDual>