Here's a quick function that removes xml tags with no value (blank, nulls.. zeroes excluded).
Function CleanNode(&inXMLDoc) Local number &i; Local array of XmlNode &dataList; &dataList = &inXMLDoc.GetElements(); For &i = &dataList.Len To 1 Step - 1 If None(&dataList [&i].NodeValue) Then If &dataList [&i].ChildNodeCount = 0 Then &inXMLDoc.removeChildNode(&i); End-If; End-If; End-For; End-Function;
Specify a parent node as parameter and you're done.
No comments:
Post a Comment