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

osx/ubuntu auto prefixing nodes #33

Closed
Jimflip opened this issue Dec 5, 2011 · 3 comments
Closed

osx/ubuntu auto prefixing nodes #33

Jimflip opened this issue Dec 5, 2011 · 3 comments

Comments

@Jimflip
Copy link

Jimflip commented Dec 5, 2011

on OSX i get the following output:

<TARGET id="target" type="FACEBOOK_PLATFORM">

on ubuntu I get

<default:TARGET xmlns="myNameSpace" id="target" type="FACEBOOK_PLATFORM">

using gem 2.2.2

This is simplified version of my large xml file, all nodes have the above xmlns and prefix added.

The version of libxml is different on each platform: osx = 2.7.3 and ubuntu = 2.7.7

@Jimflip
Copy link
Author

Jimflip commented Dec 5, 2011

The issue is caused by removing a node from the document via the remove! method and then reattaching the node via <<.

For some reason on Ubuntu this is adding a namespace to the detached node, this is not happening on osx.

I cannot find a way to remove the namespace from the node either, any ideas?

This is quite urgent so any help would be appreciated.

BTW: ruby 1.8.7

@cfis
Copy link
Member

cfis commented Jan 11, 2012

To get namespaces

node.namespaces

To add:

XML::Namespace.new(node, 'soap', 'http://schemas.xmlsoap.org/soap/envelope/')

To delete - I don't actually see a libxml2 api for deleting a namespace. If there is one it would be easy to surface in the bindings. Do you know of one?

@cfis
Copy link
Member

cfis commented Aug 4, 2013

Since this is so old, going to close.

@cfis cfis closed this as completed Aug 4, 2013
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

2 participants