/**
* 節點爲空就X
*
* @param doc
* type: Document, DOM;
* @param param
* type: BizContext;
* @return: int ,運算邏輯返回值,如果失敗返回0,成功返回1
* @throws Exception
* <p> ** bizlet 的顯示名稱 **
* @bizlet_displayName BL_ObjectTrim
* @bizlet_param passing="in_out" type="EOSEntity" value="/" name="" desc=""
*/
public static int BL_ObjectTrim(Document doc, BizContext param)
throws Exception {
Node param0 = (Node) param.getParaObjectAt(0);
NodeList nodes = param0.getChildNodes();
int returnCode = 0;
for (int i = 0; i < nodes.getLength(); i++) {
Node currentNode = nodes.item(i);
// String nodeValue = XmlUtil.getNodeValue(currentNode);
String nodeValue =(String) currentNode.getFirstChild().getNodeValue();
System.out.println( nodeValue + "~~~~~~~~~~~~~~~~~");
if (nodeValue.trim().length() == 0) {
param0.removeChild(currentNode);
returnCode++;
}
}
System.out.println("共X掉"+returnCode + "~~~~~~~~~~~~~~~~~");
return returnCode;
}
}