Module: XX::XHTML

Includes:
Markup
Included in:
Strict, Transitional
Defined in:
lib/rcov/xx.rb

Defined Under Namespace

Modules: Strict, Transitional

Constant Summary

Constants included from Markup

Markup::XX_MARKUP_RECURSIVE_INCLUSION_PROC

Instance Method Summary collapse

Methods included from Markup

included

Methods included from Markup::ClassMethods

#xx_ancestors, #xx_config, #xx_config_for, #xx_configure, #xx_define_tag_method, #xx_define_tmp_method, #xx_remove_tag_method, #xx_tag_method_name

Methods included from Markup::InstanceMethods

#method_missing, #xx_ancestors, #xx_any_, #xx_cdata_, #xx_class, #xx_config, #xx_config_for, #xx_configure, #xx_define_tag_method, #xx_define_tmp_method, #xx_doc, #xx_markup_, #xx_parse_attributes, #xx_parse_yaml_attributes, #xx_remove_tag_method, #xx_tag_, #xx_tag_method_name, #xx_text_, #xx_which, #xx_with_doc_in_effect

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class XX::Markup::InstanceMethods

Instance Method Details

#xhtml_(which = XHTML, *a, &b) ⇒ Object



572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
# File 'lib/rcov/xx.rb', line 572

def xhtml_ which = XHTML, *a, &b
#--{{{
  xx_which(which) do
    doc = xx_with_doc_in_effect(*a, &b)
    ddoc = doc.doc
    root = ddoc.root
    if root and root.name and root.name =~ %r/^html$/i 
      if root.attribute("lang",nil).nil? or root.attribute("lang",nil).to_s.empty?
        root.add_attribute "lang", "en"
      end
      if root.attribute("xml:lang").nil? or root.attribute("xml:lang").to_s.empty?
        root.add_attribute "xml:lang", "en"
      end
      if root.namespace.nil? or root.namespace.to_s.empty?
        root.add_namespace "http://www.w3.org/1999/xhtml"
      end
    end
    doc
  end
#--}}}
end