def resource_name(resource, options = {})
      raise_unless_xpath!(resource)
      options = { return_expressions: false }.merge(options)
      if options[:return_expressions]
        name = resource.xpath("command/args_add_block")
        if name.xpath("descendant::string_add").size == 1 &&
            name.xpath("descendant::string_literal").size == 1 &&
            name.xpath(
              "descendant::*[self::call or self::string_embexpr]").empty?
          name.xpath("descendant::tstring_content/@value").to_s
        else
          name
        end
      else
        # Preserve existing behaviour
        resource.xpath("string(command//tstring_content/@value)")
      end
    end
def resource_name(resource, options = {})
      raise_unless_xpath!(resource)
      options = { return_expressions: false }.merge(options)
      if options[:return_expressions]
        name = resource.xpath("command/args_add_block")
        if name.xpath("descendant::string_add").size == 1 &&
            name.xpath("descendant::string_literal").size == 1 &&
            name.xpath(
              "descendant::*[self::call or self::string_embexpr]").empty?
          name.xpath("descendant::tstring_content/@value").to_s
        else
          name
        end
      else
        # Preserve existing behaviour
        resource.xpath("string(command//tstring_content/@value)")
      end
    end
Retrieve the name attribute associated with the specified resource.