aboutsummaryrefslogtreecommitdiffstats
path: root/lib/rexml
Commit message (Collapse)AuthorAgeFilesLines
* * lib/rexml/parsers/treeparser.rb (REXML::Parsers::TreeParser#parse):kou2013-09-031-2/+2
| | | | | | | | | | Add source information to parse exception on no close tag error. [Bug #8844] [ruby-dev:47672] Patch by Ippei Obayashi. Thanks!!! * test/rexml/parser/test_tree.rb: Add a test for the above case. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42815 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/rexml/parsers/treeparser.rb (REXML::Parsers::TreeParser#parse):kou2013-09-031-1/+1
| | | | | | | | | | Remove needless nested parse exception information. [Bug #8844] [ruby-dev:47672] Reported by Ippei Obayashi. Thanks!!! * test/rexml/parser/test_tree.rb: Add a test for the above case. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42813 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/rexml/sax2listener.rb (REXML::SAX2Listener#notationdecl): Fixkou2013-08-111-1/+1
| | | | | | | | | | | wrong number of arguments in the template listener. [Bug #8731] [ruby-dev:47582] Reported by Ippei Obayashi. * test/rexml/parser/test_sax2.rb: Add tests for parsing notation declarations with SAX2 API. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42521 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/rexml/sax2listener.rb (REXML::SAX2Listener#elementdecl): Fix wrongkou2013-08-111-6/+6
| | | | | | | | examples. [Bug #8731] [ruby-dev:47582] Reported by Ippei Obayashi. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42520 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/rexml/parsers/sax2parser.rbkou2013-08-111-24/+28
| | | | | | | (REXML::Parsers::SAX2Parser#handle_entitydecl): Extract. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42519 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/rexml/parsers/sax2parser.rb (REXML::Parsers::SAX2Parser#parse):kou2013-08-111-2/+18
| | | | | | | | Fix wrong "%" position in parameter entity declaration event argument. * test/rexml/parser/test_sax2.rb: Add tests for the above case. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42518 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/rexml/parsers/sax2parser.rb (REXML::Parsers::SAX2Parser#parse):kou2013-08-111-0/+6
| | | | | | | | Support NDATA in external entity declaration. * test/rexml/parser/test_sax2.rb: Add tests for the above case. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42516 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/rexml/parsers/baseparser.rbkou2013-08-111-1/+2
| | | | | | | | (REXML::Parsers::BaseParser#pull_event): Support optional NDATA in parameter entity declaration. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42515 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * NEWS (REXML::Parsers::SAX2Parser): Add about this change.kou2013-08-112-2/+2
| | | | | | | | | | | | | | * lib/rexml/parsers/sax2parser.rb (REXML::Parsers::SAX2Parser#parse): Fix wrong number of arguments. Document says "an array of the entity declaration" but it passes two or more arguments. This is a bug but it break backward compatibility. Reported by Ippei Obayashi. [Bug #8731] [ruby-dev:47582] * lib/rexml/sax2listener.rb (REXML::SAX2Listener#entitydecl): ditto. The listener template accepted two arguments. * test/rexml/parser/test_sax2.rb: Add tests for external ID case. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42514 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/rexml/parsers/baseparser.rbkou2013-08-101-1/+1
| | | | | | | | (REXML::Parsers::BaseParser::CDATA_END): Use "\A" instead of "^". It is not an used constant but I fix it. (Or shuold I remove it?) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42489 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/rexml/parsers/baseparser.rb (REXML::Parsers::BaseParser):kou2013-08-101-2/+3
| | | | | | | | Fix wrong constant name. "]>" pattern match is the same but it is used for "<!DOCTYPE" end mark not "<![CDATA[" end mark. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42488 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/rexml/parsers/baseparser.rb (REXML::Parsers::BaseParser):kou2013-08-101-7/+7
| | | | | | | | | | Use "\A" instead of "^" in document type declaration patterns because they are used as the head match in content not the head match in line. They don't cause any problems in the current code but it should be fixed. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42487 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/rexml/parsers/baseparser.rb (REXML::Parsers::BaseParser::SYSTEM):kou2013-08-101-1/+1
| | | | | | | | | Fix loose "head" match regular expression. It doesn't cause any problem in the current code but it should be fixed because readers may confuse it. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42484 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/rexml/parsers/baseparser.rb (REXML::Parsers::BaseParser::PUBLIC):kou2013-08-101-1/+1
| | | | | | | | | | | Fix loose "head" match regular expression. [Bug #8701] [ruby-dev:47551] Patch by Ippei Obayashi. Thanks!!! * test/rexml/parse/test_notation_declaration.rb (#test_system_public): Add a test for the above case. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42482 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/rexml/attribute.rb: [DOC] Update example for #namespacezzak2013-08-041-2/+5
| | | | | | | Patch by Ippei Obayashi [Bug #8685] [ruby-core:56173] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42376 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/rexml/parsers/streamparser.rbkou2013-07-261-0/+4
| | | | | | | | | | | (REXML::Parsers::StreamParser#parse): Add "entity" event support to listener. [Bug #8689] [ruby-dev:47542] Reported by Ippei Obayashi. * test/rexml/test_stream.rb (StreamTester#entity): Add a test for the above case. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42198 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/rexml/streamlistener.rb: [DOC] Fix examples inzzak2013-07-221-6/+6
| | | | | | | REXML::StreamListener#entitydecl patch by Ippei Obayashi [Bug #8665] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42125 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/rexml/text.rb (REXML::Text#<<): Support appending in notkou2013-07-071-0/+1
| | | | | | | | | | "raw" mode. [Bug #8602] [ruby-dev:47482] Reported by Ippei Obayashi. Thanks!!! * test/rexml/test_text.rb (TextTester#test_shift_operator_cache): Add a test for the above case. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41819 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/rexml/text.rb (REXML::Text#<<): Support method chain use by "<<"kou2013-07-071-0/+4
| | | | | | | | | like other objects. * test/rexml/test_text.rb (TextTester#test_shift_operator_chain): Add a test for the above case. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41818 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/rexml/text.rb (REXML::Text#clear_cache): Extract commonkou2013-07-071-3/+8
| | | | | | | cache clear code. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41817 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/rexml/text.rb (REXML::Text.normalize): Fix a bug that allkou2013-04-261-1/+1
| | | | | | | | | | entity filters are ignored. [ruby-dev:47278] [Bug #8302] Patch by Ippei Obayashi. Thanks!!! * test/rexml/test_entity.rb (EntityTester#test_entity_filter): Add a test of the above change. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40484 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/rexml/element.rb (REXML::Attributes#to_a): Supportkou2013-04-261-1/+1
| | | | | | | | | | | namespaced attributes. [ruby-dev:47277] [Bug #8301] Patch by Ippei Obayashi. Thanks!!! * test/rexml/test_attributes.rb (AttributesTester#test_to_a_with_namespaces): Add a test of the above change. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40482 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/rexml/document.rb, lib/rexml/element.rb,duerst2013-04-233-11/+5
| | | | | | | | lib/rexml/formatters/pretty.rb: remove opinionated language in documentation. [Bug #8309], reported by Charles Beckmann git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40420 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/rexml/security.rb (REXML::Security): create.kou2013-02-274-35/+39
| | | | | | | | | | | | * lib/rexml/rexml.rb: move entity_expansion_limit and entity_expansion_text_limit accessors to ... * lib/rexml/security.rb: ... here. * lib/rexml/document.rb: use REXML::Security. * lib/rexml/text.rb: use REXML::Security. * test/rexml/test_document.rb: use REXML::Security. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39528 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/rexml/document.rb: move entity_expansion_limit accessor to ...kou2013-02-262-5/+19
| | | | | | | | | | | * lib/rexml/rexml.rb: ... here for consistency. * lib/rexml/document.rb (REXML::Document.entity_expansion_limit): deprecated. * lib/rexml/document.rb (REXML::Document.entity_expansion_limit=): deprecated. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39510 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/rexml/document.rb: move entity_expansion_limit accessor to ...kou2013-02-263-5/+20
| | | | | | | | | | | | | | | * lib/rexml/rexml.rb: ... here to make rexml/text independent from REXML::Document. It causes circular require. * lib/rexml/document.rb (REXML::Document.entity_expansion_limit): deprecated. * lib/rexml/document.rb (REXML::Document.entity_expansion_limit=): deprecated. * lib/rexml/text.rb: add missing require "rexml/rexml" for REXML.entity_expansion_limit. Reported by Robert Ulejczyk. Thanks!!! [ruby-core:52895] [Bug #7961] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39509 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/rexml/document.rb (REXML::Document.entity_expansion_text_limit):nagachika2013-02-221-1/+1
| | | | | | fix a typo in comment in r39384. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39388 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/rexml/document.rb (REXML::Document.entity_expansion_text_limit):usa2013-02-222-15/+37
| | | | | | | | | | new attribute to read/write entity expansion text limit. the default limit is 10Kb. * lib/rexml/text.rb (REXML::Text.unnormalize): check above attribute. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39384 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/rexml/element.rb (REXML::Elements#add): Remove too muchkou2013-01-031-1/+1
| | | | | | | "elements" in document. Sorry... git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38682 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/rexml/element.rb (REXML::Elements#each): Add missingkou2013-01-031-4/+4
| | | | | | | | "elements" in document. [ruby-talk:402713] Reported by Wesley Rishel. Thanks!!! git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38681 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ruby.c (load_file_internal): set default source encoding asnaruse2012-11-062-0/+2
| | | | | | | | | UTF-8 instead of US-ASCII. [ruby-core:46021] [Feature #6679] * parse.y (parser_initialize): set default parser encoding as UTF-8 instead of US-ASCII. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37485 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/rexml/xmldecl.rb (REXML::XMLDecl#content): Add missing \Akou2012-11-031-1/+1
| | | | | | | and \z. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37452 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/rexml/output.rb (REXML::Output#initialize): Use normalizedkou2012-11-031-1/+1
| | | | | | | encoding name. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37451 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/rexml/output.rb (REXML::Output): Don't output BOM in middlekou2012-11-031-0/+5
| | | | | | | | of the output string. * test/rexml/test_document.rb: Add a test for the above change. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37450 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Revert r37439 and r37441kou2012-11-031-4/+7
| | | | | | | | | | | | | | | | | r37439: * lib/rexml/xmldecl.rb (REXML::XMLDecl): Stop using REXML::Encoding module because XMLDecl doesn't convert encoding. This causes removing XML encoding name normalization (encoding.upcase). Encoding name in XML declaration is what user specifies. I think this is reasonable change. * test/rexml/test_xml_declaration.rb: Add tests for the above change. r37441: * test/rexml/test_core.rb (Tester#test_ticket_88): Follow the change that encoding name in XML declaration isn't normalized. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37446 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/rexml/document.rb (REXML::Document#write): Document encodingkou2012-11-032-7/+7
| | | | | | | | | | | | option. Now different encoding between XML file's encoding and XML declaration's encodiong is support. [Feature #4872] (work in progress) * lib/rexml/xmldecl.rb (REXML::XMLDecl#write): Always use XMLDecl's encoding. * test/rexml/test_document.rb: Update tests for the above change. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37440 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/rexml/xmldecl.rb (REXML::XMLDecl): Stop using REXML::Encodingkou2012-11-031-7/+4
| | | | | | | | | | | module because XMLDecl doesn't convert encoding. This causes removing XML encoding name normalization (encoding.upcase). Encoding name in XML declaration is what user specifies. I think this is reasonable change. * test/rexml/test_xml_declaration.rb: Add tests for the above change. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37439 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/rexml/source.rb: Move encoding detection code to base class.kou2012-10-282-58/+56
| | | | | | | * lib/rexml/encoding.rb: Remove needless encoding detection code. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37365 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/rexml/parsers/baseparser.rb: Fix a bug that UTF-8 is usedkou2012-10-281-0/+3
| | | | | | | | | for UTF-16XX encoded XML that doesn't have encoding="UTF-16" in XML declration. * test/rexml/test_document.rb: Add tests for the above change. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37363 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/rexml/source.rb (REXML::IOSource#initialize): Reducekou2012-10-282-14/+40
| | | | | | | | | | | | @line_break initialize code. It should be done only in #encoding=. * lib/rexml/parsers/baseparser.rb: Don't set UTF-16 encoding to source by encoding="UTF-16" in XML declaration because UTF-16XX source encoding should be set in Source#initialize or IOSource#intialize. They should handle BOM. Parser should not consider about it. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37361 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Revert r37358kou2012-10-281-2/+2
| | | | | | | | | * lib/rexml/source.rb (REXML::IOSource#initialize): Use encode("UTF-16XX") instead of UTF-16XX encoded byte string by hand. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37359 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/rexml/source.rb (REXML::IOSource#initialize): Usekou2012-10-281-2/+2
| | | | | | | | encode("UTF-16XX") instead of UTF-16XX encoded byte string by hand. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37358 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/rexml/document.rb (REXML::Document#write): Add :encoding optionkou2012-10-281-5/+7
| | | | | | | | | to support custom XML encoding. [Feature #4872] (work in progress) * test/rexml/test_document.rb: Add tests for the above change. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37355 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/rexml/document.rb (REXML::Document#write): Remove needlesskou2012-10-281-1/+1
| | | | | | | indent in document. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37354 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/rexml/document.rb (REXML::Document#write): Accept optionskou2012-10-281-5/+37
| | | | | | | | Hash as argument. * test/rexml/test_document.rb: Add tests for the above change. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37353 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/rexml/document.rb (REXML::Document#write): Fix wrong usagekou2012-10-281-2/+2
| | | | | | | in document. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37352 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/rexml/document.rb (REXML::Document#write): Fix wrong methodkou2012-10-281-2/+2
| | | | | | | names in document. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37351 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* eliminate `shadowing outer local variable - name` warning.tenderlove2012-02-081-4/+4
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34496 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/rexml/parsers/baseparser.rb: use meaningful name.kou2012-02-021-13/+13
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34420 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/rexml/parsers/baseparser.rb, test/rexml/test_namespace.rb:kou2012-02-021-1/+1
| | | | | | | | fix the default xml namespace URI validation. Reported by Miho Hiramatsu. Thanks!!! git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34419 b2dd03c8-39d4-4d8f-98ff-823fe69b080e