diff --git a/ChangeLog b/ChangeLog index 4be44e2d79..673fc91ae1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Thu Nov 13 21:59:58 2014 CHIKANAGA Tomoyuki + + * lib/rexml/document.rb: add REXML::Document#document. + reported by Tomas Hoger and patched by nahi. + Thu Nov 13 21:51:56 2014 Tanaka Akira * test/monitor/test_monitor.rb: Use assert_join_threads. diff --git a/lib/rexml/document.rb b/lib/rexml/document.rb index 8342b96e6a..d7d24f4732 100644 --- a/lib/rexml/document.rb +++ b/lib/rexml/document.rb @@ -278,6 +278,10 @@ module REXML end end + def document + self + end + private def build( source ) Parsers::TreeParser.new( source, self ).parse diff --git a/lib/rexml/entity.rb b/lib/rexml/entity.rb index f447202394..3a35ec6b94 100644 --- a/lib/rexml/entity.rb +++ b/lib/rexml/entity.rb @@ -157,6 +157,7 @@ module REXML # This is a set of entity constants -- the ones defined in the XML # specification. These are +gt+, +lt+, +amp+, +quot+ and +apos+. + # CAUTION: these entities does not have parent and document module EntityConst # +>+ GT = Entity.new( 'gt', '>' ) diff --git a/test/rexml/test_document.rb b/test/rexml/test_document.rb index 171d480557..43efbca38c 100644 --- a/test/rexml/test_document.rb +++ b/test/rexml/test_document.rb @@ -46,6 +46,22 @@ EOF &a; +EOF + + XML_WITH_NESTED_EMPTY_ENTITY = < + + + + + + + +]> + +&a; + EOF XML_WITH_NESTED_PARAMETER_ENTITY = < ]> +EOF + + XML_WITH_NESTED_EMPTY_PARAMETER_ENTITY = < + + + + + + + +]> + EOF XML_WITH_4_ENTITY_EXPANSION = <