(self, prefix_root)
return out_string
Generates the XML string if this is a reference to a defaults class.

    To prevent global defaults from clashing, we turn all global defaults
    into a properly named defaults class. Therefore, care must be taken when
    this attribute is not explicitly defined. If the parent element can be
    traced up to a body with a nontrivial 'childclass' then must continue to
    leave this attribute undefined.

    Args:
      prefix_root: A `NameScope` object to be treated as root
        for the purpose of calculating the prefix.

    Returns:
      A string to be used in the generated XML.
Generates the XML string if this is a reference to a defaults class.
Generates the XML string if this is a reference to a defaults class .
def _defaults_string(self, prefix_root):
    """Generates the XML string if this is a reference to a defaults class.

    To prevent global defaults from clashing, we turn all global defaults
    into a properly named defaults class. Therefore, care must be taken when
    this attribute is not explicitly defined. If the parent element can be
    traced up to a body with a nontrivial 'childclass' then must continue to
    leave this attribute undefined.

    Args:
      prefix_root: A `NameScope` object to be treated as root
        for the purpose of calculating the prefix.

    Returns:
      A string to be used in the generated XML.
    """
    self._check_dead_reference()
    prefix = self._parent.namescope.full_prefix(prefix_root)
    if not self._value:
      defaults_root = self._parent.parent
      while defaults_root is not None:
        if (hasattr(defaults_root, constants.CHILDCLASS)
            and defaults_root.childclass):
          break
        defaults_root = defaults_root.parent
      if defaults_root is None:
        # This element doesn't belong to a childclass'd body.
        global_class = self._parent.root.default.dclass or ''
        out_string = (prefix + global_class) or constants.PREFIX_SEPARATOR
      else:
        out_string = None
    else:
      out_string = prefix + self._value
    return out_string
def _defaults_string ( self , prefix_root ) : self . _check_dead_reference ( ) prefix = self . _parent . namescope . full_prefix ( prefix_root ) if not self . _value : defaults_root = self . _parent . parent while defaults_root is not None : if ( hasattr ( defaults_root , constants . CHILDCLASS ) and defaults_root . childclass ) : break defaults_root = defaults_root . parent if defaults_root is None : # This element doesn't belong to a childclass'd body. global_class = self . _parent . root . default . dclass or '' out_string = ( prefix + global_class ) or constants . PREFIX_SEPARATOR else : out_string = None else : out_string = prefix + self . _value return out_string