diff -Naur amrita-1.0.2.orig/lib/amrita/amx.rb amrita-1.0.2-cur/lib/amrita/amx.rb
--- amrita-1.0.2.orig/lib/amrita/amx.rb	2002-08-23 14:39:30.000000000 +0900
+++ amrita-1.0.2-cur/lib/amrita/amx.rb	2005-04-16 19:06:14.000000000 +0900
@@ -56,7 +56,7 @@
                raise "unknown param #{f.type}"
              end
       
-      doc = REXML::Document.new(REXML::File.new(path))
+      doc = REXML::Document.new(File.open(path))
       root = doc.elements['amx']
       req = root.attributes['require']
       require(req) if req
diff -Naur amrita-1.0.2.orig/lib/amrita/compiler.rb amrita-1.0.2-cur/lib/amrita/compiler.rb
--- amrita-1.0.2.orig/lib/amrita/compiler.rb	2003-01-05 16:54:44.000000000 +0900
+++ amrita-1.0.2-cur/lib/amrita/compiler.rb	2005-04-16 19:09:14.000000000 +0900
@@ -1,3 +1,6 @@
+
+if nil
+
 require 'amrita/format'
 
 
@@ -599,7 +602,7 @@
           e2.delete_attr!(:id)
         end
         
-        if e.no_child? and @static_formatter.can_be_single?(e)
+        if @static_formatter.empty_tag?(e)
           self << @static_formatter.format_single_tag(e)
           return
         end
@@ -652,7 +655,7 @@
           end
         end
 
-        _if("e.no_child? and #{dynamic_formatter_var_name}.can_be_single?(e)") do
+        _if("#{dynamic_formatter_var_name}.empty_tag?(e)") do
           put_src "#{@dynamic_formatter_var_name} << #{@dynamic_formatter_var_name}.format_single_tag(e)"
           _else do
             if block_given?
@@ -725,7 +728,7 @@
         else
           e.body.compile(self)
         end
-        unless e.no_child? and @static_formatter.can_be_single?(e)
+        unless @static_formatter.empty_tag?(e)
           self <<  @static_formatter.format_end_tag(e)
         end
         true
@@ -852,3 +855,5 @@
     end
   end
 end
+
+end
diff -Naur amrita-1.0.2.orig/lib/amrita/format.rb amrita-1.0.2-cur/lib/amrita/format.rb
--- amrita-1.0.2.orig/lib/amrita/format.rb	2003-01-05 16:54:44.000000000 +0900
+++ amrita-1.0.2-cur/lib/amrita/format.rb	2005-04-29 18:43:36.000000000 +0900
@@ -136,9 +136,14 @@
     # If set, text will be escaped by Sanitizer#sanitize_text
     # Default is true.
     attr_accessor :escape
+    
+    # �^‚Ì‚Æ‚«�AXMLƒ‚�[ƒh�B
+    # ‹U‚Ì‚Æ‚«�AHTMLƒ‚�[ƒh�B
+    attr_accessor :xml
 
     # If set, single tag like <tt><hr></tt> will be printed as <tt><hr /></tt>
     # Default is false
+    # xml‚ª�^‚Ì‚Æ‚«‚Í�A�í‚ÉXMLƒXƒ^ƒCƒ‹‚Å�o—Í‚·‚é�B�iasxml‘®�«‚Í–³Ž‹‚³‚ê‚é�B�j
     attr_accessor :asxml
     
     # If set, <tt><span></tt> with no attribute will be deleted.
@@ -153,7 +158,7 @@
     # All output is done by << method.
     def initialize(stream="", tagdict=DefaultHtmlTagInfo, &element_filter)
       @stream = stream
-      @tagdict = tagdict
+      @tagdict = tagdict  # validator
       @escape = true
       @asxml = false
       @delete_span = true
@@ -202,14 +207,15 @@
       self
     end
 
-    def format_attrs(attrarray, taginfo=nil) #:nodoc:
-      return nil if attrarray.size == 0
-      array = attrarray.collect do |a|
-        flag = taginfo ? taginfo.url_attr?(a.key) : false
-        format_attr(a, flag)
+    def format_attrs(element)
+      return nil if element.attrs.size == 0
+      array = element.attrs.collect do |a|
+        url_attr = !xml && @tagdict.url_attr?(element, a)
+        format_attr(a, url_attr)
       end
       array.join(" ")
     end
+    private :format_attrs
 
     def format_attr_default(a, flag) #:nodoc:
       attrval = a.value
@@ -250,8 +256,7 @@
 
     def format_start_tag(e) #:nodoc:
       e = @element_filter.call(e) if @element_filter
-      taginfo = @tagdict.get_tag_info(e.tagname_symbol)
-      a = format_attrs(e.attrs, taginfo)
+      a = format_attrs(e)
       if a
         %Q[<#{e.tagname} #{a}>]
       else
@@ -265,8 +270,8 @@
 
     def format_single_tag(e) #:nodoc:
       e = @element_filter.call(e) if @element_filter
-      a = format_element_attrs(e)
-      if asxml
+      a = format_attrs(e)
+      if xml || asxml
         if a
           %Q[<#{e.tagname} #{a} />]
         else
@@ -287,30 +292,13 @@
       @stream << text
       text
     end
-
-    def can_be_single?(element) #:nodoc:
-      taginfo_of_element(element).can_be_empty
-    end
-
-    def format_attr_of_element(attr, element)
-      taginfo = taginfo_of_element(element)
-      format_attr(attr, taginfo && taginfo.url_attr?(attr.key))
-    end
-
-    def format_element_attrs(element)
-      format_attrs(element.attrs, taginfo_of_element(element))
-    end
-
-    def taginfo_of_element(element)
-      @tagdict.get_tag_info(element.tagname_symbol)
-    end
   end
 
   # This Formatter print out template with no change.
   class AsIsFormatter < Formatter
     def format_element(element, stream=nil, &block) #:nodoc:
       with_stream(stream) do
-        if element.no_child? and can_be_single?(element)
+        if !xml && @tagdict.empty_tag?(element) || xml && element.no_child?
           @stream << format_single_tag(element)
         else
           @stream <<  format_start_tag(element)
@@ -339,7 +327,7 @@
 
     def format_element(element, stream=nil, &block) #:nodoc:
       with_stream(stream) do
-        if element.no_child? and can_be_single?(element)
+        if !xml && @tagdict.empty_tag?(element) || xml && element.no_child?
           @stream << format_single_tag(element)
         else
           @stream <<  format_start_tag(element)
@@ -377,7 +365,11 @@
       with_stream(stream) do
         body = element.body 
         pptype = @tagdict.get_tag_info(element.tagname_symbol).pptype
-        unless element.no_child? and can_be_single?(element)
+        if !xml && @tagdict.empty_tag?(element) || xml && element.no_child?
+          s = format_single_tag(element)
+          put(s)
+          new_line unless pptype == 3
+        else
           first = format_start_tag(element)
           last = format_end_tag(element)
 
@@ -388,11 +380,6 @@
               body.format(self)
             end
           end
-
-        else
-          s = format_single_tag(element)
-          put(s)
-          new_line unless pptype == 3
         end
       end
     end
@@ -484,7 +471,7 @@
       when String
         @result_str << x
       when NodeArray
-        x.array.each do |n|
+        x.each do |n|
           n.pre_format1(self)
         end
       when Node
diff -Naur amrita-1.0.2.orig/lib/amrita/node.rb amrita-1.0.2-cur/lib/amrita/node.rb
--- amrita-1.0.2.orig/lib/amrita/node.rb	2002-12-28 16:45:50.000000000 +0900
+++ amrita-1.0.2-cur/lib/amrita/node.rb	2005-04-16 18:36:31.000000000 +0900
@@ -118,7 +118,7 @@
 
     # AttrArray#== concerns the order of Attr
     def ==(x)
-      return true if id == x.id
+      return true if object_id == x.object_id
       return false unless x.kind_of?(AttrArray)
       each_with_index do |a, n|
         return false unless a == x[n]
@@ -376,7 +376,7 @@
     # doesn't concern the order of attributes
     def ==(x)
       return false unless x.kind_of?(Element)
-      return true if x.id == id
+      return true if x.object_id == object_id
       return false unless x.tagname_symbol == @tagname
       return false unless x.attrs.size == @attrs.size
       @attrs.each do |a|
@@ -581,11 +581,10 @@
   # represents an Array of Node. It is a Node also.
   class NodeArray
     include Node
-    attr_reader :array
+
     def initialize(*elements)
       if elements.size() == 1 and elements[0].kind_of?(NodeArray)
-        a = elements[0]
-        @array = a.array.collect { |n| n.clone }
+        @array = elements[0].to_a.collect {|n| n.clone}
       else
         @array = elements.collect do |a|
           #raise "can't be a parent of me!" if a.id == self.id # no recusive check because it costs too much
@@ -595,7 +594,6 @@
     end
 
     def ==(x)
-      return false unless x.kind_of?(NodeArray)
       case x
       when NodeArray, Array
         return false unless x.size() == @array.size()
@@ -620,6 +618,14 @@
       @array.empty?
     end
 
+    def each
+      @array.each {|e| yield e}
+    end
+
+    def to_a
+      @array.dup
+    end
+
     def clone
       NodeArray.new(self)
     end
@@ -668,14 +674,14 @@
     # end tag
     def etag
       case @tag 
-      when '%=', '%'
-        '%'
       when '!'
         ''
       when '!--'
         '--'
       when '?'
         '?'
+      when '![CDATA['
+        ']]'
       else
         @tag
       end
diff -Naur amrita-1.0.2.orig/lib/amrita/node_expand.rb amrita-1.0.2-cur/lib/amrita/node_expand.rb
--- amrita-1.0.2.orig/lib/amrita/node_expand.rb	2002-10-23 22:38:08.000000000 +0900
+++ amrita-1.0.2-cur/lib/amrita/node_expand.rb	2005-04-16 18:40:44.000000000 +0900
@@ -64,7 +64,12 @@
 class String #:nodoc:
   def amrita_expand_element(e, context)
     ret = e.clone { Amrita::Node::to_node(self) }
-    context.filter_element(ret)
+    if context.expand_attr
+      context.filter_element(ret)
+    else
+      new_elem = context.filter_element(ret, false)
+      new_elem.expand_attr!({}, context)
+    end
   end
 
   def amrita_expand_node(n, context)
@@ -86,16 +91,22 @@
   end
 
   def amrita_expand_node(n, context)
-    raise Amrita::ModelMisMatch(type, n.type)
+    raise Amrita::ModelMisMatch(type, n.class)
   end
 end
 
 module Amrita 
   module DictionaryData #:nodoc:
+    # Í×ÁÇ¤òÅ¸³«¤¹¤ë¡£
+    #   e  Element¥¤¥ó¥¹¥¿¥ó¥¹
     def amrita_expand_element(e, context)
       hid = e.hid
       new_elem = context.filter_element(e.clone, false)
-      new_elem.expand_attr!(self, context) if context.expand_attr
+      if context.expand_attr
+        new_elem.expand_attr!(self, context)
+      else
+        new_elem.expand_attr!(self, context) if !hid
+      end
       if hid =~ /^\w+$/
         d = amrita_get_data(hid.intern, e, context)
         new_elem.expand1(d, context)
@@ -107,16 +118,8 @@
       end
     end
 
-    def amrita_expand_attr(e, context) #:nodoc:
-      e.attrs.each do |attr|
-        next if attr.key_symbol == :id
-        next unless attr.value
-        if attr.value[0] == ?@
-          e[attr.key_symbol] = amrita_get_data(attr.value[1..-1].intern, e, context)
-        end
-      end
-    end
-    
+    # Í×ÁÇ°Ê³°¤òÅ¸³«¤¹¤ë
+    #   n  Element°Ê³°¤ÎNode¥µ¥Ö¥¯¥é¥¹¥¤¥ó¥¹¥¿¥ó¥¹
     def amrita_expand_node(n, context)
       n.apply_to_children do |child|
         child.expand1(self, context)
@@ -128,6 +131,8 @@
 class Hash #:nodoc:
   include Amrita::DictionaryData
 
+  # key      idÂ°À­ÃÍ¤Î¥·¥ó¥Ü¥ë
+  # element  Element¥ª¥Ö¥¸¥§¥¯¥È
   def amrita_get_data(key, element, context)
     if context.hash_key_is_string
       self[key.to_s] or self[key]
@@ -256,7 +261,7 @@
     end
 
     def amrita_expand_node(n, context)
-      raise Amrita::ModelMisMatch(type, n.type)
+      raise Amrita::ModelMisMatch(type, n.class)
     end
   end
 
@@ -273,7 +278,7 @@
       when DictionaryData
         expand1(data, context)
       else
-        raise "Amrita::Node#expand accepts only Hash or ExpandByMember as model data (#{data.type} was passed)"
+        raise "Amrita::Node#expand accepts only Hash or ExpandByMember as model data (#{data.class} was passed)"
       end
     end
 
@@ -331,6 +336,7 @@
           self[attr.key_symbol] = data.amrita_get_data(attr.value[1..-1].intern, self, context)
         end
       end
+      self
     end
     
     def apply_to_children(&block)
diff -Naur amrita-1.0.2.orig/lib/amrita/parser.rb amrita-1.0.2-cur/lib/amrita/parser.rb
--- amrita-1.0.2.orig/lib/amrita/parser.rb	2002-10-15 16:48:04.000000000 +0900
+++ amrita-1.0.2-cur/lib/amrita/parser.rb	2005-04-10 14:03:35.000000000 +0900
@@ -1,4 +1,6 @@
 
+# -*- encoding:euc-jp -*-
+
 require 'strscan'
 require "amrita/node"
 require "amrita/tag"
@@ -67,6 +69,8 @@
       [:tag, ret]
     end
 
+    NAME_RE = /([A-Za-z:_][\w.:-]*)/
+
     def state_text
       t = @sc.scan(/\A[^<]*/m)
       if t
@@ -92,7 +96,7 @@
       raise "can't happen" unless l == 1
       
       @sc.skip(/\A\s+/m)
-      if t = @sc.scan(/\A[\/\w]+/)
+      if t = @sc.scan(/\A\/?#{NAME_RE}/)
 	@state = method(:state_space)
 	@tagname = t
 	nil
@@ -116,7 +120,7 @@
       if @sc.scan(/\A>|\/>/)
 	@state = method(:state_text)
 	generate_tag
-      elsif t = @sc.scan(/\A[\w-]+/m)
+      elsif t = @sc.scan(/\A#{NAME_RE}/m)
 	@attrname = t
 	@state = method(:state_attrname)
 	nil
@@ -127,7 +131,7 @@
 
     def state_attrname
       @sc.skip(/\A\s*/m)
-      if t = @sc.scan(/\A[\w-]+/m)
+      if t = @sc.scan(/\A#{NAME_RE}/m)
 	@attrname = t
 	@state = method(:state_before_equal)
 	nil
@@ -152,7 +156,7 @@
 	@attrs << [@attrname, nil]
 	@state = method(:state_text)
 	generate_tag
-      elsif t = @sc.scan(/\A\w+/)
+      elsif t = @sc.scan(/\A#{NAME_RE}/)
 	@attrs << [@attrname, nil]
 	@attrvalue = ""
 	@attrname = t
diff -Naur amrita-1.0.2.orig/lib/amrita/parts.rb amrita-1.0.2-cur/lib/amrita/parts.rb
--- amrita-1.0.2.orig/lib/amrita/parts.rb	2002-10-24 14:23:25.000000000 +0900
+++ amrita-1.0.2-cur/lib/amrita/parts.rb	2005-04-29 19:27:07.000000000 +0900
@@ -75,8 +75,8 @@
       parts_mod.module_eval {
         include Amrita
         include PartsTemplate
-        include HtmlCompiler::RuntimeRoutines
-        extend HtmlCompiler::RuntimeRoutines
+        #include HtmlCompiler::RuntimeRoutines
+        #extend HtmlCompiler::RuntimeRoutines
       }
       compile_partstemplate(parts_mod, e, cls_name)
     end
diff -Naur amrita-1.0.2.orig/lib/amrita/tag.rb amrita-1.0.2-cur/lib/amrita/tag.rb
--- amrita-1.0.2.orig/lib/amrita/tag.rb	2002-10-22 17:10:31.000000000 +0900
+++ amrita-1.0.2-cur/lib/amrita/tag.rb	2005-04-29 19:20:15.000000000 +0900
@@ -65,12 +65,12 @@
 
 
       # If true, it will be printed <hr> not <hr></hr>
-      attr_accessor :can_be_empty
+      attr_accessor :empty_tag
 
       def initialize(tagname, pptype=3)
         @pptype = pptype
         @url_attributes = nil
-        @can_be_empty = false
+        @empty_tag = false
         @tag_class = nil
       end
 
@@ -78,7 +78,7 @@
         @pptype.freeze
 
         @url_attributes.freeze
-        @can_be_empty.freeze
+        @empty_tag.freeze
         super
         self
       end
@@ -134,11 +134,20 @@
         @dict[tagname] = TagInfoItem.new(tagname)
       end
     end
-
     alias [] get_tag_info
+    
+    def empty_tag?(element)
+      raise TypeError if !element.is_a?(Element)
+      get_tag_info(element.tagname_symbol).empty_tag
+    end
+    
+    def url_attr?(element, attr)
+      raise TypeError if !element.is_a?(Element)
+      raise TypeError if !attr.is_a?(Attr)
+      get_tag_info(element.tagname_symbol).url_attr?(attr.key)
+    end
   end
 
-  # this class is used only by compiler.rb
   # but it has tag information so moved to here(tag.rb)
   class Tag	
     attr_reader :name, :attrs
@@ -158,7 +167,8 @@
     def ==(t)
       t.kind_of?(Tag) and name == t.name and attrs == t.attrs
     end
-
+    
+    # ŠJŽnƒ^ƒO‚Ü‚½‚Í‹ó—v‘fƒ^ƒO
     def start_tag?
       @name[0] != ?/
     end
@@ -171,10 +181,6 @@
       HtmlTagInfo::EMPTY.include?(@name)
     end
 
-    def block_tag?
-      HtmlTagInfo::BLOCK.include?(@name)
-    end
-
     def generate_element(parser)
       a = attrs.collect { |attr| Attr.new(attr[0], attr[1]) }
       if empty_tag?
@@ -231,6 +237,24 @@
     end
   end
 
+  class TagThTd < Tag
+    def accept_child(child_tag)
+      !["th", "td", "tr", "tfoot", "tbody"].include?(child_tag)
+    end
+  end
+
+  class TagTr < Tag
+    def accept_child(child_tag)
+      !["tr", "tfoot", "tbody"].include?(child_tag)
+    end
+  end
+
+  class TagColgroup < Tag
+    def accept_child(child_tag)
+      !["colgroup", "thead", "tfoot", "tbody", "tr"].include?(child_tag)
+    end
+  end
+
   class TagTableSection < Tag
     def accept_child(child_tag)
       case child_tag
@@ -261,6 +285,11 @@
     end
   end
 
+  class TagOption < Tag
+    def accept_child(child_tag)
+      child_tag != "option" && child_tag != "optgroup"
+    end
+  end
 
   class HtmlTagInfo < TagInfo
     include Amrita
@@ -292,7 +321,7 @@
       empty = %w(area base basefont bgsound br col frame hr img input isindex 
 	         keygen link meta nextid param spacer wbr) 
       empty.each do |name|
-        get_tag_info(name).can_be_empty = true
+        get_tag_info(name).empty_tag = true
       end
 
       get_tag_info(:a).set_url_attr(:href)
@@ -352,7 +381,11 @@
 
       get_tag_info(:pre).tag_class = TagPre
       get_tag_info(:p).tag_class = TagP
-
+      get_tag_info(:th).tag_class = TagThTd
+      get_tag_info(:td).tag_class = TagThTd
+      get_tag_info(:tr).tag_class = TagTr
+      get_tag_info(:colgroup).tag_class = TagColgroup
+      get_tag_info(:option).tag_class = TagOption
     end
   end
 
diff -Naur amrita-1.0.2.orig/lib/amrita/template.rb amrita-1.0.2-cur/lib/amrita/template.rb
--- amrita-1.0.2.orig/lib/amrita/template.rb	2003-01-05 16:58:29.000000000 +0900
+++ amrita-1.0.2-cur/lib/amrita/template.rb	2005-04-29 18:51:18.000000000 +0900
@@ -78,7 +78,10 @@
     attr_accessor :expand_attr
 
     # If Set, use compiler. 
-    attr_accessor :use_compiler
+    attr_reader :use_compiler
+    def use_compiler=(f)
+      # empty
+    end
 
     attr_accessor :cache_manager
 
@@ -95,7 +98,7 @@
       @template = nil
       @xml = @prettyprint = @compact_space = @asxml = @pre_format = @expand_attr= false
       @keep_id = false
-      @escaped_id = @dom_id = @amrita_id = nil
+      @escaped_id = @amrita_id = nil
       @parser_filter = nil
       @use_compiler = false
       @cache_manager = DummyCacheManager.new
@@ -126,8 +129,10 @@
 
     # generate Hint from data and compile template by it.
     def set_hint_by_sample_data(data)
-      hint = data.amrita_generate_hint
-      set_hint(hint)
+      if use_compiler
+        hint = data.amrita_generate_hint
+        set_hint(hint)
+      end
     end
 
     private
@@ -170,6 +175,7 @@
       end
 
       f = formatter_cls.new(stream, setup_taginfo)
+      f.xml = xml
       f.asxml = asxml
       if escaped_id
         raise "can't set escaped_id and keep_id" if keep_id
diff -Naur amrita-1.0.2.orig/lib/amrita/xml.rb amrita-1.0.2-cur/lib/amrita/xml.rb
--- amrita-1.0.2.orig/lib/amrita/xml.rb	2002-10-22 17:10:31.000000000 +0900
+++ amrita-1.0.2-cur/lib/amrita/xml.rb	2005-04-10 15:53:43.000000000 +0900
@@ -55,7 +55,8 @@
       raise "can't happen @stack.size=#{@stack.size}" unless @stack.size == 1
       top
     end
-
+    
+    # override
     def tag_start(name, attrs)
       a = attrs.collect do |key, val|
         Attr.new(key, convert(val))
@@ -64,6 +65,7 @@
       push Null
     end
 
+    # override
     def tag_end(name)
       body = pop
       element = pop
@@ -71,10 +73,27 @@
       push(pop + element)
     end
 
+    # override
     def text(text)
       push(pop + TextElement.new(convert(text)))
     end
+    
+    # override
+    def instruction(name, instruction)
+      push(pop + SpecialElement.new('?', name + instruction))
+    end
+    
+    # override
+    def comment(comment)
+      push(pop + SpecialElement.new('!--', comment))
+    end
+    
+    # override
+    def cdata(content)
+      push(pop + SpecialElement.new('![CDATA[', content))
+    end
 
+    # override
     def xmldecl(version, encoding, standalone)
       text = %Q[xml version="#{version}"]
       text += %Q[ encoding="#{encoding}"] if encoding
@@ -82,6 +101,7 @@
       push(pop + s)
     end
 
+    # override
     def doctype(name, pub_sys, long_name, uri)
       s = SpecialElement.new('!',
                              %Q[DOCTYPE #{name} #{pub_sys} #{long_name} #{uri}])
@@ -98,7 +118,7 @@
 
     def XMLParser.parse_file(fname, dummy=nil, &block)
       l = Listener.new(&block) 
-      REXML::Document.parse_stream(REXML::File.new(fname), l)
+      REXML::Document.parse_stream(File.open(fname), l)
       l.result
     end
   end
diff -Naur amrita-1.0.2.orig/test/testall.rb amrita-1.0.2-cur/test/testall.rb
--- amrita-1.0.2.orig/test/testall.rb	2002-10-21 11:35:29.000000000 +0900
+++ amrita-1.0.2-cur/test/testall.rb	2005-04-16 19:10:09.000000000 +0900
@@ -7,7 +7,7 @@
 load 'testformat.rb'
 load 'testformat2.rb'
 load 'testparser.rb'
-load 'testcompiler.rb'
+#load 'testcompiler.rb'
 load 'testtemplate.rb'
 load 'testxml.rb'
 load 'testams.rb'
@@ -22,7 +22,7 @@
   end
 end
 
-RUNIT::CUI::TestRunner.quiet_mode = true
+#RUNIT::CUI::TestRunner.quiet_mode = true
 if RUNIT::CUI::TestRunner.run(suite).succeed?
   puts "every test OK"
 else
diff -Naur amrita-1.0.2.orig/test/testams.rb amrita-1.0.2-cur/test/testams.rb
--- amrita-1.0.2.orig/test/testams.rb	2002-08-24 16:31:40.000000000 +0900
+++ amrita-1.0.2-cur/test/testams.rb	2005-04-16 19:10:46.000000000 +0900
@@ -3,7 +3,7 @@
 
 class TestAms < RUNIT::TestCase
   include Amrita
-  include HtmlCompiler
+  #include HtmlCompiler
 
   def test_ams1
     tempfile = "/tmp/amritatest#{$$}"
diff -Naur amrita-1.0.2.orig/test/testcompiler.rb amrita-1.0.2-cur/test/testcompiler.rb
--- amrita-1.0.2.orig/test/testcompiler.rb	2002-12-11 11:46:14.000000000 +0900
+++ amrita-1.0.2-cur/test/testcompiler.rb	2005-04-29 19:26:14.000000000 +0900
@@ -13,7 +13,7 @@
 
 class TestHtmlCompiler < RUNIT::TestCase
   include Amrita
-  include HtmlCompiler
+  #include HtmlCompiler
   FormatterClass = AsIsFormatter
   #FormatterClass = SingleLineFormatter  # this works
   #FormatterClass = PrettyPrintFormatter # this does not work now
@@ -604,8 +604,8 @@
   def test_generate_hint_from_template
     template = HtmlParser.parse_text  "<body><x id=aaa></x></body>"
     h = template.generate_hint_from_template
-    assert_equals(DictionaryHint, h.type)
-    assert_equals(AnyData, h.hash[:aaa].type)
+    assert_equals(DictionaryHint, h.class)
+    assert_equals(AnyData, h.hash[:aaa].class)
 
     check_compiler("<body><x id=aaa></x></body>",
                    { :aaa=>"xxx" },
@@ -614,9 +614,9 @@
 
     template = HtmlParser.parse_text'<span id=xxx></span><span id=yyy></span>'
     h = template.generate_hint_from_template
-    assert_equals(DictionaryHint, h.type)
-    assert_equals(AnyData, h.hash[:xxx].type)
-    assert_equals(AnyData, h.hash[:yyy].type)
+    assert_equals(DictionaryHint, h.class)
+    assert_equals(AnyData, h.hash[:xxx].class)
+    assert_equals(AnyData, h.hash[:yyy].class)
 
     check_compiler_all('<span id=xxx></span><span id=yyy></span>',
                    { :xxx=>"xx", :yyy=>"yy" },
diff -Naur amrita-1.0.2.orig/test/testexpand.rb amrita-1.0.2-cur/test/testexpand.rb
--- amrita-1.0.2.orig/test/testexpand.rb	2002-10-22 17:10:31.000000000 +0900
+++ amrita-1.0.2-cur/test/testexpand.rb	2005-04-16 18:59:10.000000000 +0900
@@ -114,7 +114,7 @@
   def test_attr_expand1
     e = e(:a, :href=>"@url") { e(:span, :id=>"url") }
     d = { :url=>"http://www.ruby-lang.org/" } 
-    assert_equal('e(:a,a(:href, "@url")) { e(:span) { "http://www.ruby-lang.org/" } }', e.expand(d).to_ruby)
+    assert_equal('e(:a,a(:href, "http://www.ruby-lang.org/")) { e(:span) { "http://www.ruby-lang.org/" } }', e.expand(d).to_ruby)
     context = Amrita::ExpandContext.new
     context.expand_attr = true
     assert_equal('e(:a,a(:href, "http://www.ruby-lang.org/")) { e(:span) { "http://www.ruby-lang.org/" } }', e.expand(d, context).to_ruby)
@@ -167,7 +167,7 @@
     e = e(:x, :aaa=>"@xxx") { "xyz" }
     assert(e.has_expandable_attr?)
     d = { :xxx=>"123" } 
-    assert_equal(e(:x, :aaa=>"@xxx") { "xyz" }, e.expand(d))
+    assert_equal(e(:x, :aaa=>"123") { "xyz" }, e.expand(d))
 
     context = Amrita::ExpandContext.new
     context.expand_attr = true
@@ -225,7 +225,7 @@
     assert_equal(TextElement.new("abc"), n.expand1("abc"))
     a = Node::to_node([1,2,3])
     assert_equal(a, n.expand1([1,2,3]))
-    assert_equal(ans.type, n.expand1({ :aaa=> "xyz"}).type)
+    assert_equal(ans.class, n.expand1({ :aaa=> "xyz"}).class)
     assert_equal(ans, n.expand1({ :aaa=> "xyz"}))
   end
 
diff -Naur amrita-1.0.2.orig/test/testformat.rb amrita-1.0.2-cur/test/testformat.rb
--- amrita-1.0.2.orig/test/testformat.rb	2003-01-05 16:54:45.000000000 +0900
+++ amrita-1.0.2-cur/test/testformat.rb	2005-04-29 19:25:23.000000000 +0900
@@ -37,8 +37,8 @@
   def test_formatter
     ret = ""
     f = Formatter.new(ret)
-    assert_equal('x="1"', f.format_attrs(a(:x, 1)))
-    assert_equal('x="1" y="2"', f.format_attrs(a(:x, 1, :y, 2)))
+    #assert_equal('x="1"', f.format_attrs(a(:x, 1)))
+    #assert_equal('x="1" y="2"', f.format_attrs(a(:x, 1, :y, 2)))
     e = e(:abc,a(:x, 1, :y, 2))
     assert_equal('<abc x="1" y="2">', f.format_start_tag(e))
     assert_equal('</abc>', f.format_end_tag(e))
@@ -91,7 +91,7 @@
     ret = ""
     f = SingleLineFormatter.new(ret)
     f.set_attr_filter(:__id=>:id, :klass=>:class)
-    assert_equal('id="xxx"', f.format_attrs(a(:__id=>"xxx")))
+    #assert_equal('id="xxx"', f.format_attrs(a(:__id=>"xxx")))
     f.format(tmpl)
     assert_equal('<p id="aaaa" class="xyz">xxxxx</p>', ret)
   end
@@ -196,33 +196,33 @@
     tmpl = HtmlParser.parse_text "<p id=x>xxxx</p>"
     f = AsIsFormatter.new(nil)
     r = tmpl.pre_format(f).result
-    assert_equal(Element, r.type)
+    assert_equal(Element, r.class)
     assert_equal('e(:p,a(:id, "x")) { "xxxx" }', r.to_ruby)
 
     tmpl = HtmlParser.parse_text "<p>xxxx</p><p id=x>yyyy</p>"
     f = AsIsFormatter.new(nil)
     r = tmpl.pre_format(f).result
-    assert_equal(Array, r.type)
+    assert_equal(Array, r.class)
     assert_equal('<p>xxxx</p>', r[0])
     assert_equal('e(:p,a(:id, "x")) { "yyyy" }', r[1].to_ruby)
 
     tmpl = HtmlParser.parse_text "<p id=x>xxxx</p><p>yyyy</p>"
     f = AsIsFormatter.new(nil)
     r = tmpl.pre_format(f).result
-    assert_equal(Array, r.type)
+    assert_equal(Array, r.class)
     assert_equal('e(:p,a(:id, "x")) { "xxxx" }', r[0].to_ruby)
     assert_equal('<p>yyyy</p>', r[1])
 
     tmpl = HtmlParser.parse_text "xxx<em>yyy</em>zzz"
     f = AsIsFormatter.new(nil)
     r = tmpl.pre_format(f).result
-    assert_equal(Amrita::SanitizedString, r.type)
+    assert_equal(Amrita::SanitizedString, r.class)
     assert_equal('xxx<em>yyy</em>zzz', r)
 
     tmpl = HtmlParser.parse_text "<p id=x>xxx<em>yyy</em>zzz</p>"
     f = AsIsFormatter.new(nil)
     r = tmpl.pre_format(f).result
-    assert_equal(Element, r.type)
+    assert_equal(Element, r.class)
     assert_equal('xxx<em>yyy</em>zzz', r.body.to_s)
   end
 
@@ -273,15 +273,15 @@
     tmpl = HtmlParser.parse_text '<a href="@xxx">yyy</a>'
 
     pre = tmpl.pre_format(f).result
-    assert_equal(Amrita::SanitizedString, pre.type)
+    assert_equal(Amrita::SanitizedString, pre.class)
     assert_equal('<a href="@xxx">yyy</a>', pre)
 
     pre = tmpl.pre_format(f, true).result
-    assert_equal(Amrita::Element, pre.type)
+    assert_equal(Amrita::Element, pre.class)
     assert_equal(e(:a,a(:href, "@xxx")) { "yyy" }, pre)
 
     data = { :xxx=>"http://www.ruby-lang.org/" }
-    assert_equal(e(:a,a(:href, "@xxx")) { "yyy" }, pre.expand(data))
+    assert_equal(e(:a,a(:href, "http://www.ruby-lang.org/")) { "yyy" }, pre.expand(data))
     assert_equal(tmpl.expand(data), pre.expand(data))
 
     context = Amrita::ExpandContext.new
diff -Naur amrita-1.0.2.orig/test/testformat2.rb amrita-1.0.2-cur/test/testformat2.rb
--- amrita-1.0.2.orig/test/testformat2.rb	2002-08-02 16:27:34.000000000 +0900
+++ amrita-1.0.2-cur/test/testformat2.rb	2005-04-16 18:27:30.000000000 +0900
@@ -186,7 +186,7 @@
 <li color="blue">2</li>
 <li color="red">3</li>
 <li color="blue">4</li>
-<li color="red">5</li>'.gsub("[\r\n]", ""), e.expand1(data).to_s.gsub("[\r\n]", ""))
+<li color="red">5</li>'.gsub(/[\r\n]/, ""), e.expand1(data).to_s.gsub(/[\r\n]/, ""))
   end
 
   def test_filter
diff -Naur amrita-1.0.2.orig/test/testparser.rb amrita-1.0.2-cur/test/testparser.rb
--- amrita-1.0.2.orig/test/testparser.rb	2002-10-15 16:48:04.000000000 +0900
+++ amrita-1.0.2-cur/test/testparser.rb	2005-04-16 19:01:21.000000000 +0900
@@ -51,7 +51,7 @@
 		   "\n     ", 
 		   Tag.new("a", [["name", "28077"]])
 		 ],
-		 scan(h).indexes(0,3,6))
+		 scan(h).values_at(0,3,6))
   end
 
   def parse_and_print(t)
@@ -89,10 +89,10 @@
 END
     #parse_and_print(h)
 
-    assert_equal('special_tag("%=", " Time.new ") ',
-		 parse('<%= Time.new %>').to_ruby)
-    assert_equal('<%= Time.new %>',
-		 parse('<%= Time.new %>').to_s)
+#    assert_equal('special_tag("%=", " Time.new ") ',
+#		 parse('<%= Time.new %>').to_ruby)
+#    assert_equal('<%= Time.new %>',
+#		 parse('<%= Time.new %>').to_s)
     assert_equal('<!-- comment -->',
 		 parse('<!-- comment -->').to_s)
     assert_equal('<!-- comment-with-dash -->',
diff -Naur amrita-1.0.2.orig/test/testtemplate.rb amrita-1.0.2-cur/test/testtemplate.rb
--- amrita-1.0.2.orig/test/testtemplate.rb	2003-01-05 16:54:45.000000000 +0900
+++ amrita-1.0.2-cur/test/testtemplate.rb	2005-04-29 19:03:55.000000000 +0900
@@ -3,7 +3,7 @@
 
 class TestTemplate < RUNIT::TestCase
   include Amrita
-  include HtmlCompiler
+  #include HtmlCompiler
 
   def test_template_text_direct1
     html = '<p id="a">sample_text</p>'
@@ -39,7 +39,7 @@
     t.use_compiler = true
     result = ""
     data = { :list => [1, 2, 3] }
-    t.set_hint(HashData[:list=>ArrayData[ScalarData]])
+    #t.set_hint(HashData[:list=>ArrayData[ScalarData]])
     t.expand(result, data)
     assert_equal('<ul><li>1</li><li>2</li><li>3</li></ul>', result)
   end
@@ -118,7 +118,7 @@
     t.xml = true
     result = ""
     t.expand(result, { :a=>"aaa" })
-    assert_equal("<p>aaa</p>", result)
+    assert_equal("<p>aaa</p>\n", result)
   ensure
     File::unlink(tempfile)
   end
@@ -133,7 +133,7 @@
     assert_equal('<p id="a">aaa</p>', result)
 
     result = ""
-    t.set_hint(HashData[:a=>ScalarData])
+    #t.set_hint(HashData[:a=>ScalarData])
     t.expand(result, { :a=>"aaa" })
     #puts t.src
     assert_equal('<p id="a">aaa</p>', result)
@@ -149,7 +149,7 @@
     assert_equal('<p id="realid">aaa</p>', result)
 
     result = ""
-    t.set_hint(HashData[:a=>ScalarData])
+    #t.set_hint(HashData[:a=>ScalarData])
     t.expand(result, { :a=>"aaa" })
     #puts t.src
     assert_equal('<p id="realid">aaa</p>', result)
@@ -165,7 +165,7 @@
     assert_equal('<p id="realid">aaa</p>', result)
 
     result = ""
-    t.set_hint(HashData[:a=>ScalarData])
+    #t.set_hint(HashData[:a=>ScalarData])
     t.expand(result, { :a=>"aaa" })
     #puts t.src
     assert_equal('<p id="realid">aaa</p>', result)
@@ -181,7 +181,7 @@
     assert_equal('<p id="realid">aaa</p><a href="xxx">yyy</a>', result)
 
     result = ""
-    t.set_hint(HashData[:a=>ScalarData])
+    #t.set_hint(HashData[:a=>ScalarData])
     t.expand(result, { :a=>"aaa" })
     #puts t.src
     assert_equal('<p id="realid">aaa</p><a href="xxx">yyy</a>', result)
@@ -245,7 +245,7 @@
 
 
     t = TemplateFileWithCache.new(tempfile)  
-    assert_equal(SourceCache, t.cache_manager.type)
+    assert_equal(SourceCache, t.cache_manager.class)
     t.use_compiler = true
     assert_equal(true, t.need_update?)
     result = ""
diff -Naur amrita-1.0.2.orig/test/testxml.rb amrita-1.0.2-cur/test/testxml.rb
--- amrita-1.0.2.orig/test/testxml.rb	2002-10-22 17:10:31.000000000 +0900
+++ amrita-1.0.2-cur/test/testxml.rb	2005-04-16 19:07:23.000000000 +0900
@@ -39,7 +39,17 @@
 </body>
 </html>
    END
-    assert_equal('<?xml version="1.0"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>xhtml sample</title> </head> <body> <h1 id="title">title</h1> <p id="body">body text</p> <hr> </body> </html>',
+    assert_equal('
+<?xml version="1.0"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"> 
+<head> 
+<title>xhtml sample</title> 
+</head> 
+<body> 
+<h1 id="title">title</h1> 
+<p id="body">body text</p> <hr> 
+</body> </html> '.gsub(/[\r\n]/, ''),
        rexml_to_amrita(a))
   end
 
