Project

General

Profile

Backport #6307

REXML parser does not parse valid XML (The 'xml' prefix must not be bound to any other namespace)

Added by studnev (Aleksey Studnev) over 7 years ago. Updated over 7 years ago.

Status:
Closed
Priority:
Normal
[ruby-core:44397]

Description

Attached is an example file which is not parsed by REXML parser, generating an error:

The 'xml' prefix must not be bound to any other namespace (http://www.w3.org/TR/REC-xml-names/#ns-decl)

The problem is in these following lines:

            attrs.each { |a,b,c,d,e| 
              if b == "xmlns"
                if c == "xml"
                  if d != "http://www.w3.org/XML/1998/namespace"
                    msg = "The 'xml' prefix must not be bound to any other namespace "+
                    "(http://www.w3.org/TR/REC-xml-names/#ns-decl)"
                    raise REXML::ParseException.new( msg, @source, self )

There is a description of this problem also in: https://rails.lighthouseapp.com/projects/8994/tickets/3701-bug-in-baseparserrb


Files

publisher.owl (1.03 KB) publisher.owl studnev (Aleksey Studnev), 04/17/2012 06:39 AM

Associated revisions

Revision 4f043961
Added by naruse (Yui NARUSE) over 7 years ago

merge revision(s) 34419: [Backport #6307]

    * lib/rexml/parsers/baseparser.rb, test/rexml/test_namespace.rb:
      fix the default xml namespace URI validation.
      [ruby-dev:45169] [Bug #5956]
      Reported by Miho Hiramatsu. Thanks!!!

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@35365 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 35365
Added by naruse (Yui NARUSE) over 7 years ago

merge revision(s) 34419: [Backport #6307]

* lib/rexml/parsers/baseparser.rb, test/rexml/test_namespace.rb:
  fix the default xml namespace URI validation.
  [ruby-dev:45169] [Bug #5956]
  Reported by Miho Hiramatsu. Thanks!!!

History

#1

Updated by mame (Yusuke Endoh) over 7 years ago

  • Tracker changed from Bug to Backport
  • Project changed from Ruby master to Backport193
  • Status changed from Open to Assigned
  • Assignee set to naruse (Yui NARUSE)

This is already fixed at r34419 in trunk.
Moving to backport tracker.

Thanks,

--
Yusuke Endoh mame@tsg.ne.jp

#2

Updated by naruse (Yui NARUSE) over 7 years ago

  • Status changed from Assigned to Closed
  • % Done changed from 0 to 100

This issue was solved with changeset r35365.
Aleksey, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


merge revision(s) 34419: [Backport #6307]

* lib/rexml/parsers/baseparser.rb, test/rexml/test_namespace.rb:
  fix the default xml namespace URI validation.
  [ruby-dev:45169] [Bug #5956]
  Reported by Miho Hiramatsu. Thanks!!!

Also available in: Atom PDF