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

dcp_inspect: Nokogiri::XML::Document#collect_namespaces #18

Closed
wolfgangw opened this issue Apr 14, 2013 · 2 comments
Closed

dcp_inspect: Nokogiri::XML::Document#collect_namespaces #18

wolfgangw opened this issue Apr 14, 2013 · 2 comments

Comments

@wolfgangw
Copy link
Owner

See sparklemotion/nokogiri#885

@wolfgangw
Copy link
Owner Author

fdecae6 adds Nokogiri::XML::Document#collect_all_namespaces_href_keys and Nokogiri::XML::Document#collect_all_namespaces_prefix_keys which allow to actually collect all of a document's namespaces -- as opposed to Nokogiri::XML::Document#collect_namespaceswhich succeeds only for specific (if common) documents.

This allows to handle documents correctly which use multiple default namespace definitions (the point of those documents being that e.g. a Signature fragment can come in and go in a minimally obtrusive fashion -- which, while maybe somewhat uncommon, makes perfect sense). See ISDCF Plugfest Fox packages for examples.

A concluding note wrt Nokogiri::XML::Document#collect_namespaces which used to work in dcp_inspect upto (and including) Nokogiri 1.5.5:

The way I used it worked entirely by chance and it fell flat on its nose when Nokogiri 1.5.6 and successive versions returned a different result. Good thing, too.

I do consider Nokogiri::XML::Document#collect_namespaces broken, though, as it will fail to return what its name suggests for a certain kind of (perfectly valid) XML. And that can get ugly.

@wolfgangw
Copy link
Owner Author

The previous github auto-comment is nonsense, of course. See wolfgangw/digital_cinema_tools_distribution#18 if you read the b829636 commit message

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

1 participant