From: <jz...@xi...> - 2015-09-29 00:20:53
|
Looking into it. will get back sooon ----- Original Message ----- From: W K To:"Vtd...@li..." , "jz...@xi..." Cc: Sent:Mon, 28 Sep 2015 16:11:04 -0400 Subject:Help with trimming white space around removed element Can anyone give me a snippet of code that will remove the white space around an element when that element is removed? I am struggling to make VTDNav.expandWhiteSpace() [1] and VTDNav.trimWhiteSpace() [2] work. I just need assistance with removing the white space ... assume that I have already identified the element to remove and I am removing it with the following code: xm.remove( [3] vn.trimWhiteSpaces( [4] vn.expandWhiteSpaces( [5] vn.getElementFragment() [6] ) ) ); I am using a custom version of VTD-XML ... v2.11 with the updated VTDNav and XMLModifier versions from CVS ... which contains the expandWhiteSpaces() and trimWhiteSpaces() methods. Here is a sample XML ... I need to remove the empty element without the 'activityTitle' attribute: This is what I am ending up with: This is what I want to end up with: Thank you for any assistance. Links: ------ [1] http://sitemail.hostway.com/http: [2] http://sitemail.hostway.com/http: [3] http://sitemail.hostway.com/http: [4] http://sitemail.hostway.com/http: [5] http://sitemail.hostway.com/http: [6] http://sitemail.hostway.com/http: |