The problem is empty Docuemnt NamespaceURI

Different ways to create a doc, the need to increase DocumentBuilderFactory.setNamespaceAware (true); so it is not empty Element Node.getNamespaceURI


        Factory = DocumentBuilderFactory.newInstance the DocumentBuilderFactory (); 
the DocumentBuilder Builder factory.newDocumentBuilder = ();
the InputStream resource.getInputStream inputStream = ();
the Document DOC = builder.parse (inputStream);
the Document created in this manner, Element is acquired NamespaceURI generating empty, Element type different from the above and the resulting

Guess you like

Origin www.cnblogs.com/zhongchang/p/12081777.html