JRuby & Builder namespace improvements #812

Closed
wants to merge 13 commits into
from

Conversation

Projects
None yet
3 participants
Contributor

mbklein commented Dec 19, 2012

I thought about splitting this into two separate pull requests, but everything's so intertwined. This change does three things:

  1. Add tests for how I think Nokogiri is trying to handle namespaces and namespace inheritance – at least tests that are consistent with how most code I've come across expects namespaces to work.
  2. Fix the node renaming issues that were causing Xerces to throw NAMESPACE_ERR exceptions in certain (sometimes inconsistent) circumstances.
  3. Give Nokogiri::XML::Builder the ability to handle namespace prefixes that won't be formally declared until the first method_missing call (e.g., xml[:foo].bar(:'xmlns:foo' => 'baz')). The ArgumentError will still be raised if the new prefix isn't declared by the first element encountered.

The libxml C version of Nokogiri still doesn't pass the "expected namespace behavior" tests, but this at least establishes a common baseline for the two.

mbklein added some commits Dec 11, 2012

@mbklein mbklein * Fix the NAMESPACE_ERR issues (e.g, Issue #801)
* Untangle handling of namespaces in JRuby
* Secure XmlNode and NokogiriNamespaceCache against internal node object changes
6acedf5
@mbklein mbklein Added thorough namespace compliance testing for parsed, created, and …
…built documents
0c19cb8
@mbklein mbklein Allow namespaces to be declared on first use in Builder just as they …
…are in XML.
98310b3
Contributor

mbklein commented Dec 19, 2012

Curious that the Travis build is failing more tests than my local install. I'm looking into whether it's the JDK version. Some libxml namespace test failures (as noted above) are expected, as well as the tests that are failing for me on an unmodified master anyway.

Contributor

mbklein commented Dec 20, 2012

Grr. I accidentally rebased the wrong branch on master and pushed. I'll clean this up later tonight. Sorry about that.

Contributor

mbklein commented Feb 12, 2013

Closing due to rebase confusion. Opening a new pull request before I mangle this further.

mbklein closed this Feb 12, 2013

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