QrdaGenerator.java 文件源码

java
阅读 20 收藏 0 点赞 0 评论 0

项目:qpp-conversion-tool 作者:
private void removeWhitespace(Document document) throws XPathExpressionException {
    document.normalize();
    XPath xPath = XPathFactory.newInstance().newXPath();
    NodeList nodeList = (NodeList) xPath.evaluate("//text()[normalize-space()='']",
            document,
            XPathConstants.NODESET);

    for (int i = 0; i < nodeList.getLength(); ++i) {
        Node node = nodeList.item(i);
        node.getParentNode().removeChild(node);
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号