Hi,
The cloneNode() method in the following minimal example works on java 1.6 but throws an DOMException with code 14 under android 5.
Code 14 according to sdk docs means: "NAMESPACE_ERR If an attempt is made to create or change an object in a way which is incorrect with regard to namespaces."
Has anybody an idea why this might be? Thank you in advance!
public class M
{
public static void main(String[] args)
{
try
{
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = factory.newDocumentBuilder();
String text = new String("<blub></blub>");
Document document = builder.parse(new InputSource( new StringReader(text) ));
document.getDocumentElement().cloneNode(true);
}
catch(DOMException e)
{}
catch(ParserConfigurationException e)
{}
catch(IOException e)
{}
catch(SAXException e)
{}
}
}