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

NAMESPACE_ERR when calling SardineUtil.createElement() #144

Open
carlosgarciaibanez opened this issue May 24, 2013 · 0 comments
Open

NAMESPACE_ERR when calling SardineUtil.createElement() #144

carlosgarciaibanez opened this issue May 24, 2013 · 0 comments

Comments

@carlosgarciaibanez
Copy link

The method createElement() in the SardineUtil class can be invoked with a QName which prefix is not specified. In this case, the colon should be ommited when it calls the createElementNS() on the document object. Otherwise a NAMESPACE_ERR arises. The original line is

return createDocument().createElementNS(key.getNamespaceURI(), key.getPrefix() + ":" + key.getLocalPart());

and my suggestion is

return createDocument().createElementNS(key.getNamespaceURI(),(key.getPrefix().isEmpty()? "" : key.getPrefix()+":") + key.getLocalPart());
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