Created
July 7, 2009 10:48
-
-
Save Serabe/142019 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public void setDocument(IRubyObject doc) { | |
| this.setInstanceVariable("@document", doc); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @JRubyMethod | |
| public IRubyObject add_namespace_definition(ThreadContext context, IRubyObject prefix, IRubyObject href) { | |
| Ruby ruby = context.getRuntime(); | |
| XmlNamespace ns = new XmlNamespace(ruby, prefix, href); | |
| ns.setDocument(this.document(context)); | |
| this.getNsDefinitions(ruby).append(ns); | |
| return ns; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module Nokogiri | |
| module XML | |
| class Namespace | |
| attr_reader :document | |
| end | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment