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

v1.5.6 breaks Builder namespaced attributes #814

Closed
avinmathew opened this issue Dec 20, 2012 · 4 comments
Closed

v1.5.6 breaks Builder namespaced attributes #814

avinmathew opened this issue Dec 20, 2012 · 4 comments
Assignees

Comments

@avinmathew
Copy link

I found that upgrading to 1.5.6 breaks functionality that existed in 1.5.5 around building namespaced attributes.

Test code:

Nokogiri::XML::Builder.new { |xml|
  xml.root('xmlns:a' => 'a') {
    xml.element('a:b' => 'a:c')
  }
}

Error:

Java::JavaLang::ClassCastException: org.jruby.RubyNil cannot be cast to nokogiri.XmlNode
    from nokogiri.XmlNode.findNamespaceHref(XmlNode.java:1215)
    from nokogiri.XmlNode.set(XmlNode.java:1192)
    from nokogiri.XmlNode$INVOKER$i$2$0$set.call(XmlNode$INVOKER$i$2$0$set.gen)
    from org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:202)
    from org.jruby.ast.FCallTwoArgNode.interpret(FCallTwoArgNode.java:38)
    from org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105)
    from org.jruby.evaluator.ASTInterpreter.INTERPRET_METHOD(ASTInterpreter.java:75)
    from org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:225)
    from org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:204)
    from org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:202)
    from org.jruby.ast.AttrAssignTwoArgNode.interpret(AttrAssignTwoArgNode.java:42)
    from org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105)
    from org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
    from org.jruby.evaluator.ASTInterpreter.INTERPRET_BLOCK(ASTInterpreter.java:112)
    from org.jruby.runtime.Interpreted19Block.evalBlockBody(Interpreted19Block.java:209)
    from org.jruby.runtime.Interpreted19Block.yield(Interpreted19Block.java:160)
...

Versions:

> java -version
java version "1.7.0_05"
Java(TM) SE Runtime Environment (build 1.7.0_05-b06)
Java HotSpot(TM) Server VM (build 23.1-b03, mixed mode)

> jruby -v
jruby 1.7.1 (1.9.3p327) 2012-12-03 30a153b on Java HotSpot(TM) Server VM 1.7.0_05-b06 [linux-i386]
@jmcnevin
Copy link

I'm encountering this as well.

@ghost ghost assigned jvshahid Jan 17, 2013
@flavorjones
Copy link
Member

@jvshahid or @yokolet - can you take a look?

jvshahid added a commit that referenced this issue Jan 20, 2013
…o issue #814.

Currently there's some inconsistency between MRI and JRuby. See
test_use_namespace_defined_in_parent for explanation of that difference.
@flavorjones
Copy link
Member

This has been fixed at some point in the intervening years. I'm using:

# Nokogiri (1.10.0)
    ---
    warnings: []
    nokogiri: 1.10.0
    ruby:
      version: 2.5.0
      platform: java
      description: jruby 9.2.5.0 (2.5.0) 2018-12-06 6d5a228 OpenJDK 64-Bit Server VM 10.0.2+13-Ubuntu-1ubuntu0.18.04.4
        on 10.0.2+13-Ubuntu-1ubuntu0.18.04.4 [linux-x86_64]
      engine: jruby
      jruby: 9.2.5.0
    xerces: Xerces-J 2.12.0
    nekohtml: NekoHTML 1.9.21

@flavorjones
Copy link
Member

Clarification: this was fixed by #846 in v1.5.7

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

No branches or pull requests

4 participants