Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assertion failed: (doc->_private), function Nokogiri_wrap_xml_namespace, file xml_namespace.c, line 41. #843

Closed
juskoljo opened this issue Jan 31, 2013 · 2 comments

Comments

@juskoljo
Copy link

Hi,

I'm having issues with reader.attribute_nodes and reader.attributes methods.

a) reader.attribute_nodes doesn't seem to work as expected? If I remove xsi:schemaLocation from the XML it works ok. Assertion failed: (doc->_private), function Nokogiri_wrap_xml_namespace, file xml_namespace.c, line 41. Abort trap: 6

b) reader.attributes returns {"xmlns:xsi"=>"http://www.w3.org/2001/XMLSchema-instance", "schemaLocation"=>"url filename.xsd"}. How can I get ns/prefix for schemaLocation?

With best regards,
Jussi

require 'nokogiri'
xml = '<xml xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="url filename.xsd"></xml>'
reader = Nokogiri::XML::Reader(xml)
while reader.read
  p reader.attribute_nodes
end

1.8.7 :001 > Nokogiri::VERSION_INFO
 => {"ruby"=>{"platform"=>"i686-darwin11.4.2", "engine"=>"mri", "description"=>"ruby 1.8.7 (2012-10-12 patchlevel 371) [i686-darwin11.4.2]", "version"=>"1.8.7"}, "nokogiri"=>"1.5.6", "libxml"=>{"loaded"=>"2.8.0", "binding"=>"extension", "compiled"=>"2.8.0"}, "warnings"=>[]} 
@flavorjones
Copy link
Member

Confirmed in Nokogiri 1.5.9.

@retorquere
Copy link

Still present in 1.6.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants