From: Jimmy Z. <jz...@xi...> - 2016-05-05 22:36:19
|
An updated VTD-XML version 2.12 release has been uploaded... there has been some missing classes due to source code target issue in the build.bat file... Please go visit the vtd-xml web site and download the latest update... I apologize for the SNAFU ----- Original Message ----- From: Jimmy Zhang To:, "Jimmy Zhang" , "Suresh Naidu" Cc: Sent:Wed, 04 May 2016 14:17:31 -0500 Subject:Re: [Vtd-xml-users] Suggestion in Removing the spaces after Removing the Element v2.13 will introduce more methods that allows more control over the modification output... will come out pretty soon ----- Original Message ----- From: al...@sa... [1] To:"Jimmy Zhang" , "Suresh Naidu" Cc: Sent:Tue, 3 May 2016 10:33:00 -0300 Subject:Re: [Vtd-xml-users] Suggestion in Removing the spaces after Removing the Element We assumed vtd-xml was just a fast XML parser, so we used other tools/apis to format the XML and control whitespaces. We take the bytes from vtdnav.getXML().getBytes() and pass them to a stream to be used with javax.xml.transform.Transformer [5]. The Transformer allows you to set properties to control indentation and effectively takes out the whitespace you see with vtd-xml. It also handles adding newlines, whether they are in the source XML or not. This keeps the formatted xml from being one long line. We use vtd-xml to create and parse XML for applications and processes. Its the best tool for the job. We use javax.xml [6] classes to format XML for people and documentation. Regards, Al G ---------- ORIGINAL MESSAGE ----------- From: Jimmy Zhang To: Suresh Naidu , Jimmy Zhang Cc: vtd...@li... [10] Sent: Mon, 02 May 2016 21:49:19 -0500 Subject: Re: [Vtd-xml-users] Suggestion in Removing the spaces after Removing the Element > The current implementation of expandWhite space is greedy, it will eat up all white spaces surrounding the element, > > more fine-grained control will be introduced in next release of vtd-xml ...2.13 that is... > > > ----- Original Message ----- > > From: Suresh Naidu > > To:"Jimmy Zhang" > > Cc: > > Sent:Sun, 1 May 2016 23:40:42 +0200 > > Subject:Re: [Vtd-xml-users] Suggestion in Removing the spaces after Removing the Element > > Dear Zhang, > > Thanks .I have checked your solution .I agree to you and I have posted our discussion ,sample on stack overflow . > > Still I have a concern,the solution is not fully correct to our requirement. > > Input to the program is: > > > Address1 > suresh > Address > Address2 > > > Output got: > > > Address1Address > Address2 > > > Output Expected: > > > Address1 > Address > Address2 > > > Can this be achievable as we should not change the format of it. > > Thanks border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex;" class="gmail_quote"> > > After some polishing I made your code work.. see my attachment, > > I have a request: would you please post a question on stack overflow, so I can respond, and the content of our correspondence can thus be made available to public and help them as well > > > ----- Original Message ----- > > > From: Suresh Naidu > > To:"Jimmy Zhang" > > Cc: > > Sent:Sun, 1 May 2016 01:35:36 +0200 > > Subject:Re: [Vtd-xml-users] Suggestion in Removing the spaces after Removing the Element > > Dear Zhang, > > I have tried with expandwhitespaces method with multiple ways,but i could not get the output. > > I have not find much examples about its usage. > > Can you check and let me know if i am using it correctly or not. > > I have attached the source code and file used. > > Thanks border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex;" class="gmail_quote"> > Yes, there is, in version 2.12, there is a method called expandWhiteSpace in VTDNav, it works like the following > > public final long expandWhiteSpaces(long l) > New in v2.12 This method will take a segment descriptor and return a new descriptor that includes all the leading and trailing white spaces around the input segment It has no effect on CDATA A typical usage would be 'expandWhiteSpaces(getElementFragment())'Parameters:l - upper 32 bits length of the segment, lower 32 bits offset of the segment, unit is byte offsetReturns:a long 64 bit segment descriptorThrows:NavException [17] > > > ----- Original Message ----- > > > From: Suresh Naidu > > To:"Jimmy Zhang" > > Cc: > > Sent:Sat, 30 Apr 2016 06:23:38 +0200 > > Subject:Re: [Vtd-xml-users] Suggestion in Removing the spaces after Removing the Element > > Thanks zhang for your reply.It [20] is not a show stopper.but the requirement from client is to remove that spaces...is there an option to do that with vtd- xml. > Thanks border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex;" class="gmail_quote"> > How big a deal is it ? cosmetic or show stopping? > > > ----- Original Message ----- > > From: Suresh Naidu > > To: > > Cc: > > Sent:Fri, 29 Apr 2016 10:40:39 +0200 > > Subject:[Vtd-xml-users] Suggestion in Removing the spaces after Removing the Element > > Dears, > > We are using VTD XML for our application.Can [25] you help us in solving the issue in our application. > > The issue is: > > input xml: > > > suresh > Address > > > output xml: > > > > Address > > > But i want the output to be: > > > > Address > > > > When i remove the element with xmlmodifier it is creating an empty space(new line) for the removed element. > > Is there any possibility to remove that vtdxml? > > Thanks & Regards, > G . Suresh Naidu > > > > ------- END OF ORIGINAL MESSAGE ------- Links: ------ [1] mailto:al...@sa... [2] mailto:jz...@xi... [3] mailto:sur...@gm... [4] mailto:vtd...@li... [5] http://javax.xml.transform.Transformer [6] http://javax.xml [7] mailto:jz...@xi... [8] mailto:sur...@gm... [9] mailto:jz...@xi... [10] mailto:vtd...@li... [11] mailto:sur...@gm... [12] mailto:jz...@xi... [13] mailto:jz...@xi... [14] mailto:sur...@gm... [15] mailto:jz...@xi... [16] mailto:jz...@xi... [17] http://vtd-xml.sourceforge.net/javadoc/com/ximpleware/NavException.html [18] mailto:sur...@gm... [19] mailto:jz...@xi... [20] http://reply.it/ [21] http://g.suresh/ [22] mailto:jzhang@ximplewarecom [23] mailto:sur...@gm... [24] mailto:vtd...@li... [25] http://application.can/ |