i encount DOMException. HIERARCHY_REquestST_ERR 当通过文件反对删除某一具体术语时,并在回避这一错误代码后指出:
“HIERARCHY_REquestST_ERR: Raised if this node is of a category that do not provide children of the newChild node, or if the node beated is one of this node sancestors or this node per, or if this node is of category Document and DOM application seeking to内插入第二份文件Type or Element node”
I have check the node type which i want to remove, both Element and Text type will cause the exception
我的法典
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = factory.newDocumentBuilder();
Document dom = builder.parse(new ByteArrayInputStream(smil.getBytes()));
Element root = dom.getDocumentElement();
Node node = root.getFirstChild();
dom.removeChild(node);
......
org.w3c.dom.DOMException
at org.apache.harmony.xml.dom.InnerNodeImpl.removeChild(InnerNodeImpl.java:180)