<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Official VTD-XML Blog</title>
	<atom:link href="http://ximpleware.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://ximpleware.wordpress.com</link>
	<description>On Performance of SOA and Cloud Computing</description>
	<lastBuildDate>Wed, 25 Jan 2012 04:09:53 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='ximpleware.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Official VTD-XML Blog</title>
		<link>http://ximpleware.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://ximpleware.wordpress.com/osd.xml" title="Official VTD-XML Blog" />
	<atom:link rel='hub' href='http://ximpleware.wordpress.com/?pushpress=hub'/>
		<item>
		<title>VTD-XML 2.10 Released</title>
		<link>http://ximpleware.wordpress.com/2011/03/01/vtd-xml-2-10-released/</link>
		<comments>http://ximpleware.wordpress.com/2011/03/01/vtd-xml-2-10-released/#comments</comments>
		<pubDate>Tue, 01 Mar 2011 03:43:41 +0000</pubDate>
		<dc:creator>jimmyzhang</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://ximpleware.wordpress.com/?p=99</guid>
		<description><![CDATA[VTD-XML 2.10 is now released...<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ximpleware.wordpress.com&amp;blog=8885239&amp;post=99&amp;subd=ximpleware&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>VTD-XML 2.10 is now released under Java, C#, C and C++. It can be downloaded at<br />
<a href="https://sourceforge.net/projects/vtd-xml/files/vtd-xml/ximpleware_2.10/">https://sourceforge.net/projects/vtd-xml/files/vtd-xml/ximpleware_2.10/</a>. This release includes a number of new features and enhancement.</p>
<ul>
<li>The core API of VTD-XML has been expanded. Users can now perform cut/paste/insert on an empty element.</li>
<li>This release also adds the support of deeper location cache support for parsing and indexing. This feature is useful for application performance  tuning for processing various XML documents.</li>
<li>The java version also added support for processing zip and gzip files. Direct processing of httpURL based XML is enhanced.</li>
<li>Extended Java version now support Iso-8859-10~16 encoding.</li>
<li>A full featured C++ port is released.</li>
<li>C version of VTD-XML now make use of thread local storage to address the  thread-safety issue for multi-threaded application.</li>
</ul>
<p>There are also a number of bugs fixed. Special thanks to Jozef Aerts, John Sillers, Chris Tornau and a number of other users for input and suggestions</p>
<h2>Thread Safety in C Version of VTD-XML</h2>
<p>Before 2.10, the C version of vtd-xml makes extensive use of global variables for XPath query compilation. The thread safety problem arises when multple instances of an application  perform  XPath compilation at the same time. To resolve this issue, VTD-XML 2.10 replaces all global variables for XPath compilation with thread local vriables: instead of simply declaring a variable, prepend _thread to the declaration. The thread local variable is just like global variable, except it is specific/visible within a thread. The macro for &#8221;_thread&#8221; is defined in &#8221;customTypes.h.&#8221;</p>
<p>How does the use of thread local variable impact the overall design of your application? Fortunately, very little change is required. The most significant one is the global thread context declaration: The old one looks something like this:</p>
<p><pre class="brush: cpp;">
struct exception_context the_exception_context[1];
int main(){
          exception e;
          Try {  // put the code throwing exceptions here
          } Catch (e) {  // handle exception in here
          }
}
</pre></p>
<p>From 2.10 and onward the app will look like below</p>
<p><pre class="brush: cpp;">
_thread struct exception_context the_exception_context[1];
int main(){
          exception e;
          Try {  // put the code throwing exceptions here
          } Catch (e) {  // handle exception in here
          }
}
</pre></p>
<h2>Location Cache Depth Tuning</h2>
<p>Before version 2.10, the location cache depth is set to 3. In this version, you can choose either 3 or 5, by simply calling VTDGen&#8217;s setLcDepth() (see the example below). The benefit is that at the cost of negligible parsing and memory overhead, the random access performance of VTDNav improves, especially for depth XML documents.</p>
<p><pre class="brush: java;">

   VTDGen vg = new VTDGen();

   vg.selectLcDepth(5);

</pre></p>
<h2>Insert Text into Empty Element</h2>
<p>In this release,  you now have the ability to insert text into an empty element  (e.g. &lt;a/&gt;).</p>
<ul>
<li>Insert &#8220;some text&#8221; into &lt;a/&gt;, you get &#8220;&lt;a&gt;some text&lt;/a&gt;&#8221;.</li>
<li>Insert &lt;b/&gt; into &lt;a/&gt;, you get &lt;a&gt;&lt;b/&gt;&lt;/a&gt;. </li>
</ul>
<h2>VTD-XML in  C++</h2>
<pre>Below is a simple app written in VTD-XML and C++.
<pre class="brush: cpp;">

#include &quot;everything.h&quot;
//#include &quot;bookMark.h&quot;

using namespace com_ximpleware;

int main(){
 FILE *f = NULL;
 FILE *fo = NULL;
 int i = 0;

 Long l = 0;
 int len = 0;
 int offset = 0;

 char* filename = &quot;c:/xml/soap2.xml&quot;;
 struct stat s;
 UByte *xml = NULL; // this is the buffer containing the XML content, UByte means unsigned byte
 //VTDGen *vg = NULL; // This is the VTDGen that parses XML
 VTDNav *vn = NULL; // This is the VTDNav that navigates the VTD records
 AutoPilot *ap = NULL;
 char *sm = &quot;\n================\n&quot;;

 // allocate a piece of buffer then reads in the document content
 // assume &quot;c:\soap2.xml&quot; is the name of the file
 f = fopen(filename,&quot;r&quot;);
 fo = fopen(&quot;c:/xml/out.txt&quot;,&quot;w&quot;);

 stat(filename,&amp;s);

 i = (int) s.st_size; 
 printf(&quot;size of the file is %d \n&quot;,i);
 xml = new UByte[i];
 fread(xml,sizeof(UByte),i,f);
 VTDGen vg;
 try{
  
  vg.setDoc(xml,i);
  vg.parse(true);
  vn = vg.getNav();
  AutoPilot ap;
  ap.declareXPathNameSpace(L&quot;ns1&quot;,L&quot;&lt;a href=&quot;http://www.w3.org/2003/05/soap-envelope&quot;&gt;http://www.w3.org/2003/05/soap-envelope&lt;/a&gt;&quot;);
  //if (ap.selectXPath(L&quot;/ns1:Envelope/ns1:Header/*[@ns1:mustUnderstand]&quot;)){
  if (ap.selectXPath(L&quot;/ns1:Envelope/ns1:Header/*[@ns1:mustUnderstand]&quot;)){
  //if (ap.selectXPath(L&quot;/a/b/*&quot;)){
   ap.printExprString();
   ap.bind(vn);
   int i=-1;
   while((i=ap.evalXPath())!= -1){
    //printf(&quot;\n hi ==&gt; %d \n&quot;,i);
    l = vn-&gt;getElementFragment();
    offset = (int) l;
    len = (int) (l&gt;&gt;32);
    fwrite((char *)(xml+offset),sizeof(UByte),len,fo);
    fwrite((char *) sm,sizeof(UByte),strlen((char*)sm),fo);
   }
  }
  fclose(f);
  fclose(fo);
  // remember C has no automatic garbage collector
  // needs to deallocate manually.
  delete(vn);
 }
 catch (ParseException &amp;e){
  //vg.printLineNumber();
  printf(&quot; error ===&gt; %s \n&quot;,e.getMessage());
 }
 catch (...) {
  delete (vn);
 }
 return 0;
} 

</pre>
</pre>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ximpleware.wordpress.com/99/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ximpleware.wordpress.com/99/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ximpleware.wordpress.com/99/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ximpleware.wordpress.com/99/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ximpleware.wordpress.com/99/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ximpleware.wordpress.com/99/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ximpleware.wordpress.com/99/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ximpleware.wordpress.com/99/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ximpleware.wordpress.com/99/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ximpleware.wordpress.com/99/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ximpleware.wordpress.com/99/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ximpleware.wordpress.com/99/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ximpleware.wordpress.com/99/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ximpleware.wordpress.com/99/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ximpleware.wordpress.com&amp;blog=8885239&amp;post=99&amp;subd=ximpleware&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ximpleware.wordpress.com/2011/03/01/vtd-xml-2-10-released/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/44e10bff8af9da12a05a02e7bc11b80a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jimmyzhang</media:title>
		</media:content>
	</item>
		<item>
		<title>How to Read All Attributes of an Element in VTD-XML?</title>
		<link>http://ximpleware.wordpress.com/2011/01/10/how-to-read-all-attributes-of-an-element-in-vtd-xml/</link>
		<comments>http://ximpleware.wordpress.com/2011/01/10/how-to-read-all-attributes-of-an-element-in-vtd-xml/#comments</comments>
		<pubDate>Mon, 10 Jan 2011 23:49:39 +0000</pubDate>
		<dc:creator>jimmyzhang</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://ximpleware.wordpress.com/?p=87</guid>
		<description><![CDATA[There are two ways to read all the attribute values of an element node. The first one is to use XPath expression  @* as in the example below    The second is lighter weight, which is by directly using autoPilot’s selectAttr() and iterAttr()<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ximpleware.wordpress.com&amp;blog=8885239&amp;post=87&amp;subd=ximpleware&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>There are two ways to read all the attribute values of an element node.</p>
<div>The first one is to use XPath expression  @* as in the example below</div>
<div><pre class="brush: java;">
  ap = new AutoPilot (vn);
  ap.selectXPath(“@*”);
  int i=-1;
while((i=ap.evalXPath())!=-1){
      // i will be attr name, i+1 will be attribute value
   } </pre></p>
<p>  </p>
</div>
<div>The second is lighter weight, which is by directly using autoPilot’s selectAttr() and iterAttr()</div>
<div><pre class="brush: java;">
ap = new AutoPilot(vn);
ap.selectAttr(“*”);
int i=-1;
while((i=ap.iterateAttr())!=-1){
 // i will be attr name, i+1 will be attribute value
}
</pre></p>
</div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ximpleware.wordpress.com/87/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ximpleware.wordpress.com/87/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ximpleware.wordpress.com/87/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ximpleware.wordpress.com/87/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ximpleware.wordpress.com/87/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ximpleware.wordpress.com/87/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ximpleware.wordpress.com/87/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ximpleware.wordpress.com/87/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ximpleware.wordpress.com/87/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ximpleware.wordpress.com/87/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ximpleware.wordpress.com/87/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ximpleware.wordpress.com/87/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ximpleware.wordpress.com/87/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ximpleware.wordpress.com/87/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ximpleware.wordpress.com&amp;blog=8885239&amp;post=87&amp;subd=ximpleware&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ximpleware.wordpress.com/2011/01/10/how-to-read-all-attributes-of-an-element-in-vtd-xml/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/44e10bff8af9da12a05a02e7bc11b80a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jimmyzhang</media:title>
		</media:content>
	</item>
		<item>
		<title>60x? That sounds just right.</title>
		<link>http://ximpleware.wordpress.com/2010/08/27/60x-that-sounds-just-right/</link>
		<comments>http://ximpleware.wordpress.com/2010/08/27/60x-that-sounds-just-right/#comments</comments>
		<pubDate>Fri, 27 Aug 2010 02:12:01 +0000</pubDate>
		<dc:creator>jimmyzhang</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[jaxp]]></category>
		<category><![CDATA[open-source]]></category>
		<category><![CDATA[vtd-xml]]></category>

		<guid isPermaLink="false">http://ximpleware.wordpress.com/?p=78</guid>
		<description><![CDATA[Latest, independent VTD-XML XPath performance tests<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ximpleware.wordpress.com&amp;blog=8885239&amp;post=78&amp;subd=ximpleware&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I came across a recent blog in which the author benchmarks the performance of evaluating XPath using VTD-XML on a 20 MB and comparing it to JAXP. The result is a convincing 60X. Surprised? Don&#8217;t be. The fact is that DOM and JAXP just have too much inherent issues (performance, memory usage etc). Below is the link to that blog</p>
<p><a href="http://fahdshariff.blogspot.com/2010/08/faster-xpaths-with-vtd-xml.html">http://fahdshariff.blogspot.com/2010/08/faster-xpaths-with-vtd-xml.html</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ximpleware.wordpress.com/78/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ximpleware.wordpress.com/78/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ximpleware.wordpress.com/78/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ximpleware.wordpress.com/78/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ximpleware.wordpress.com/78/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ximpleware.wordpress.com/78/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ximpleware.wordpress.com/78/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ximpleware.wordpress.com/78/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ximpleware.wordpress.com/78/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ximpleware.wordpress.com/78/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ximpleware.wordpress.com/78/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ximpleware.wordpress.com/78/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ximpleware.wordpress.com/78/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ximpleware.wordpress.com/78/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ximpleware.wordpress.com&amp;blog=8885239&amp;post=78&amp;subd=ximpleware&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ximpleware.wordpress.com/2010/08/27/60x-that-sounds-just-right/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/44e10bff8af9da12a05a02e7bc11b80a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jimmyzhang</media:title>
		</media:content>
	</item>
		<item>
		<title>VTD-XML 2.9 Released</title>
		<link>http://ximpleware.wordpress.com/2010/08/11/vtd-xml-2-9-released/</link>
		<comments>http://ximpleware.wordpress.com/2010/08/11/vtd-xml-2-9-released/#comments</comments>
		<pubDate>Wed, 11 Aug 2010 07:35:29 +0000</pubDate>
		<dc:creator>jimmyzhang</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://ximpleware.wordpress.com/?p=71</guid>
		<description><![CDATA[VTD-XML 2.9 Released<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ximpleware.wordpress.com&amp;blog=8885239&amp;post=71&amp;subd=ximpleware&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<div>VTD-XML 2.9, the next generation XML Processing API for SOA and Cloud computing, has been released. Please visit  <a href="https://sourceforge.net/projects/vtd-xml/files/"><span style="color:#800080;">https://sourceforge.net/projects/vtd-xml/files/</span></a> to download the latest version.</div>
<ul>
<li><span style="font-family:Calibri;">Strict Conformance</span>
<ul>
<li>VTD-XML now fully conforms to XML namespace 1.0 spec</li>
</ul>
</li>
<li>
<div><span style="font-family:Calibri;">Performance Improvement</span></div>
<ul>
<li><span style="font-family:Calibri;">Significantly improved parsing performance for small XML files</span></li>
</ul>
</li>
<li><span style="font-family:Calibri;">Expand Core VTD-XML API </span>
<ul>
<li><span style="font-family:Calibri;">Adds getPrefixString(), and toNormalizedString2()</span></li>
</ul>
</li>
<li><span style="font-family:Calibri;">Cutting/Splitting</span>
<ul>
<li><span style="font-family:Calibri;">Adds getSiblingElementFragment() </span></li>
</ul>
</li>
<li><span style="font-family:Calibri;">A number of bug fixes and code enhancement including:</span>
<ul>
<li><span style="font-family:Calibri;">Fixes a bug for reading very large XML documents on some platforms</span></li>
<li><span style="font-family:Calibri;">Fixes a bug in parsing processing instruction</span></li>
<li><span style="font-family:Calibri;">Fixes a bug in outputAndReparse()</span></li>
</ul>
</li>
</ul>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ximpleware.wordpress.com/71/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ximpleware.wordpress.com/71/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ximpleware.wordpress.com/71/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ximpleware.wordpress.com/71/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ximpleware.wordpress.com/71/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ximpleware.wordpress.com/71/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ximpleware.wordpress.com/71/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ximpleware.wordpress.com/71/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ximpleware.wordpress.com/71/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ximpleware.wordpress.com/71/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ximpleware.wordpress.com/71/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ximpleware.wordpress.com/71/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ximpleware.wordpress.com/71/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ximpleware.wordpress.com/71/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ximpleware.wordpress.com&amp;blog=8885239&amp;post=71&amp;subd=ximpleware&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ximpleware.wordpress.com/2010/08/11/vtd-xml-2-9-released/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/44e10bff8af9da12a05a02e7bc11b80a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jimmyzhang</media:title>
		</media:content>
	</item>
		<item>
		<title>Shuffle XML Elements with XPath and VTD-XML</title>
		<link>http://ximpleware.wordpress.com/2010/05/25/shuffle-xml-elements-with-vtd-xml/</link>
		<comments>http://ximpleware.wordpress.com/2010/05/25/shuffle-xml-elements-with-vtd-xml/#comments</comments>
		<pubDate>Tue, 25 May 2010 00:12:48 +0000</pubDate>
		<dc:creator>jimmyzhang</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://ximpleware.wordpress.com/?p=49</guid>
		<description><![CDATA[This is a simple app that shuffles elements in an XML file. It uses XPath to address individual element then re-arrange and re-combine the fragments.  Those fragments are identified by their offsets and lengths, both of which are obtained by calling VTDNav&#8217;s getElementFragment(). Why not using SAX and STaX? Simply speaking, the lack of XPath support [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ximpleware.wordpress.com&amp;blog=8885239&amp;post=49&amp;subd=ximpleware&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This is a simple app that shuffles elements in an XML file. It uses XPath to address individual element then re-arrange and re-combine the fragments.  Those fragments are identified by their offsets and lengths, both of which are obtained by calling VTDNav&#8217;s getElementFragment().</p>
<h2> Why not using SAX and STaX?</h2>
<p>Simply speaking, the lack of XPath support makes it very tedious, almost impossible, to re-arrange XML element fragments.</p>
<h2> Why not using DOM? </h2>
<p>Aside from performance and memory usage, the redundant, wasteful de-serialization/serialization contributes nothing but overhead to the task. </p>
<h2> The Code </h2>
<h3>Input XML:</h3>
<p><pre class="brush: xml;">
   &lt;root&gt;
     &lt;a&gt; text &lt;/a&gt;
     &lt;b&gt; text &lt;/b&gt;
     &lt;c&gt; text &lt;/c&gt;
     &lt;a&gt; text &lt;/a&gt;
     &lt;b&gt; text &lt;/b&gt;
     &lt;c&gt; text &lt;/c&gt;
     &lt;a&gt; text &lt;/a&gt;
     &lt;b&gt; text &lt;/b&gt;
     &lt;c&gt; text &lt;/c&gt;
   &lt;/root&gt;
</pre></p>
<h3>Output.xml</h3>
<p><pre class="brush: xml;">
   &lt;root&gt;
     &lt;a&gt; text &lt;/a&gt;
     &lt;a&gt; text &lt;/a&gt;
     &lt;a&gt; text &lt;/a&gt;
     &lt;b&gt; text &lt;/b&gt;
     &lt;b&gt; text &lt;/b&gt;
     &lt;b&gt; text &lt;/b&gt;
     &lt;c&gt; text &lt;/c&gt;
     &lt;c&gt; text &lt;/c&gt;
     &lt;c&gt; text &lt;/c&gt;
   &lt;/root&gt;
</pre></p>
<h3>Java Code:</h3>
<p><pre class="brush: java;">
import com.ximpleware.*;
import java.io.*;
public class shuffle {
    public static void main(String[] args) throws Exception {
        VTDGen vg = new VTDGen();
        AutoPilot ap0 = new AutoPilot();
        AutoPilot ap1 = new AutoPilot();
        AutoPilot ap2 = new AutoPilot();
        ap0.selectXPath(&quot;/root/a&quot;);
        ap1.selectXPath(&quot;/root/b&quot;);
        ap2.selectXPath(&quot;/root/c&quot;);

        if (vg.parseFile(&quot;old.xml&quot;,false)){
            VTDNav vn = vg.getNav();
            ap0.bind(vn);
            ap1.bind(vn);
            ap2.bind(vn);
            FileOutputStream fos = new FileOutputStream(&quot;new.xml&quot;);
            fos.write(&quot;&lt;root&gt;&quot;.getBytes());
            byte[] ba = vn.getXML().getBytes();
            while(ap0.evalXPath()!=-1){
                long l= vn.getElementFragment();
                int offset = (int)l;
                int len = (int)(l&gt;&gt;32);
                fos.write('\n');
                fos.write(ba,offset, len);
            }
            ap0.resetXPath();
            while(ap1.evalXPath()!=-1){
                long l= vn.getElementFragment();
                int offset = (int)l;
                int len = (int)(l&gt;&gt;32);
                fos.write('\n');
                fos.write(ba,offset, len);
            }
            ap1.resetXPath();
            while(ap2.evalXPath()!=-1){
                long l= vn.getElementFragment();
                int offset = (int)l;
                int len = (int)(l&gt;&gt;32);
                fos.write('\n');
                fos.write(ba,offset, len);
            }
            ap2.resetXPath();
            fos.write('\n');
            fos.write(&quot;&lt;/root&gt;&quot;.getBytes());
        }
    }
}
</pre></p>
<h3>C# code:</h3>
<p><pre class="brush: csharp;">
using System;
using com.ximpleware;

namespace shuffle
{
    public class shuffle
    {
        public static void Main(String[] args)
        {
            VTDGen vg = new VTDGen();
            AutoPilot ap0 = new AutoPilot();
            AutoPilot ap1 = new AutoPilot();
            AutoPilot ap2 = new AutoPilot();
            ap0.selectXPath(&quot;/root/a&quot;);
            ap1.selectXPath(&quot;/root/b&quot;);
            ap2.selectXPath(&quot;/root/c&quot;);
            Encoding eg = System.Text.Encoding.GetEncoding(&quot;utf-8&quot;);
            if (vg.parseFile(&quot;old.xml&quot;, false))
            {
                VTDNav vn = vg.getNav();
                ap0.bind(vn);
                ap1.bind(vn);
                ap2.bind(vn);
                FileStream fos = new FileStream(&quot;new.xml&quot;, System.IO.FileMode.OpenOrCreate);
                //fos.Write(&quot;&lt;root&gt;&quot;.getBytes());
                byte[] ba0,ba1, ba2, ba3, ba4;
                //ba0 = eg.GetBytes(&quot;
                ba1 = eg.GetBytes(&quot;&lt;root&gt;&quot;);
                ba2 = eg.GetBytes(&quot;&lt;/root&gt;&quot;);
                ba3 = eg.GetBytes(&quot;\n&quot;);
                fos.Write(ba1, 0, ba1.Length);
                byte[] ba = vn.getXML().getBytes();
                while (ap0.evalXPath() != -1)
                {
                    long l = vn.getElementFragment();
                    int offset = (int)l;
                    int len = (int)(l &gt;&gt; 32);
                    fos.Write(ba3,0,ba3.Length);
                    fos.Write(ba, offset, len);
                }
                ap0.resetXPath();
                while (ap1.evalXPath() != -1)
                {
                    long l = vn.getElementFragment();
                    int offset = (int)l;
                    int len = (int)(l &gt;&gt; 32);
                    fos.Write(ba3,0,ba3.Length);
                    fos.Write(ba, offset, len);
                }
                ap1.resetXPath();
                while (ap2.evalXPath() != -1)
                {
                    long l = vn.getElementFragment();
                    int offset = (int)l;
                    int len = (int)(l &gt;&gt; 32);
                    fos.Write(ba3,0,ba3.Length);
                    fos.Write(ba, offset, len);
                }
                ap2.resetXPath();
                fos.Write(ba3,0,ba3.Length);
                fos.Write(ba2,0,ba2.Length);
            }
        }
    }
}
</pre></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ximpleware.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ximpleware.wordpress.com/49/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ximpleware.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ximpleware.wordpress.com/49/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ximpleware.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ximpleware.wordpress.com/49/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ximpleware.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ximpleware.wordpress.com/49/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ximpleware.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ximpleware.wordpress.com/49/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ximpleware.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ximpleware.wordpress.com/49/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ximpleware.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ximpleware.wordpress.com/49/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ximpleware.wordpress.com&amp;blog=8885239&amp;post=49&amp;subd=ximpleware&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ximpleware.wordpress.com/2010/05/25/shuffle-xml-elements-with-vtd-xml/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/44e10bff8af9da12a05a02e7bc11b80a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jimmyzhang</media:title>
		</media:content>
	</item>
		<item>
		<title>Process Huge XML Documents with Extended VTD-XML</title>
		<link>http://ximpleware.wordpress.com/2010/05/22/process-huge-xml-documents-with-extended-vtd-xml/</link>
		<comments>http://ximpleware.wordpress.com/2010/05/22/process-huge-xml-documents-with-extended-vtd-xml/#comments</comments>
		<pubDate>Sat, 22 May 2010 00:36:31 +0000</pubDate>
		<dc:creator>jimmyzhang</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://ximpleware.wordpress.com/?p=38</guid>
		<description><![CDATA[If you have XML files that are larger than 2GB, and don&#8217;t want to lose the benefit of XPath (full set), you will be surprised on how handy and fast extended VTD-XML can become. New since version 2.3 and a part of full VTD-XML distribution , extended VTD-XML expands the maximum document size to 256 [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ximpleware.wordpress.com&amp;blog=8885239&amp;post=38&amp;subd=ximpleware&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>If you have XML files that are larger than 2GB, and don&#8217;t want to lose the benefit of XPath (full set), you will be surprised on how handy and fast extended VTD-XML can become. </p>
<p>New since version 2.3 and a part of full VTD-XML distribution , extended VTD-XML expands the maximum document size to 256 GB and requires 64-bit JVM to achieve those limits. </p>
<p>Extended VTD-XML works with XML either with standard in-memory mode (like the standard VTD-XML), or the memory mapped mode, which allows partial document loading.</p>
<p>The code examples below shows you how to use extended VTD-XML to process XML document using in-memory mode and memory mapped mode:</p>
<p>Memory Mapped Mode<br />
<pre class="brush: java;">
import com.ximpleware.extended.*;
public class mem_mapped_read {
	// first read is the longer version of loading the XML file 
	public static void first_read() throws Exception{
	XMLMemMappedBuffer xb = new XMLMemMappedBuffer();
        VTDGenHuge vg = new VTDGenHuge();
        xb.readFile(&quot;test.xml&quot;);
        vg.setDoc(xb);
        vg.parse(true);
        VTDNavHuge vn = vg.getNav();
        System.out.println(&quot;text data ===&gt;&quot; + vn.toString(vn.getText()));
	}	

	// second read is the shorter version of loading the XML file 
	public static void second_read() throws Exception{
	    VTDGenHuge vg = new VTDGenHuge();
	    if (vg.parseFile(&quot;test.xml&quot;,true,VTDGenHuge.MEM_MAPPED)){
	        VTDNavHuge vn = vg.getNav();
	        System.out.println(&quot;text data ===&gt;&quot; + vn.toString(vn.getText()));
	    }
	}

	public static void main(String[] s) throws Exception{
		first_read();
	 	second_read();
	}
}
</pre></p>
<p>In Memory Mode<br />
<pre class="brush: java;">
/**
 * This is a demonstration of how to use the extended VTD parser
 * to process large XML file. 
 *
 */
import com.ximpleware.extended.*;
public class in_mem_read {
	// first read is the longer version of loading the XML file 
	public static void first_read() throws Exception{
		XMLBuffer xb = new XMLBuffer();
        VTDGenHuge vg = new VTDGenHuge();
        xb.readFile(&quot;test.xml&quot;);
        vg.setDoc(xb);
        vg.parse(true);
        VTDNavHuge vn = vg.getNav();
        System.out.println(&quot;text data ===&gt;&quot; + vn.toString(vn.getText()));
	}	

	// second read is the shorter version of loading the XML file 
	public static void second_read() throws Exception{
	    VTDGenHuge vg = new VTDGenHuge();
	    if (vg.parseFile(&quot;test.xml&quot;,true,VTDGenHuge.IN_MEMORY)){
	        VTDNavHuge vn = vg.getNav();
	        System.out.println(&quot;text data ===&gt;&quot; + vn.toString(vn.getText()));
	    }
	}

	public static void main(String[] s) throws Exception{
		first_read();
	 	second_read();
	}
}

</pre></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ximpleware.wordpress.com/38/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ximpleware.wordpress.com/38/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ximpleware.wordpress.com/38/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ximpleware.wordpress.com/38/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ximpleware.wordpress.com/38/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ximpleware.wordpress.com/38/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ximpleware.wordpress.com/38/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ximpleware.wordpress.com/38/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ximpleware.wordpress.com/38/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ximpleware.wordpress.com/38/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ximpleware.wordpress.com/38/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ximpleware.wordpress.com/38/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ximpleware.wordpress.com/38/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ximpleware.wordpress.com/38/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ximpleware.wordpress.com&amp;blog=8885239&amp;post=38&amp;subd=ximpleware&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ximpleware.wordpress.com/2010/05/22/process-huge-xml-documents-with-extended-vtd-xml/feed/</wfw:commentRss>
		<slash:comments>16</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/44e10bff8af9da12a05a02e7bc11b80a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jimmyzhang</media:title>
		</media:content>
	</item>
		<item>
		<title>Namespace Compensation with VTD-XML</title>
		<link>http://ximpleware.wordpress.com/2010/05/22/namespace-compensation-with-vtd-xml/</link>
		<comments>http://ximpleware.wordpress.com/2010/05/22/namespace-compensation-with-vtd-xml/#comments</comments>
		<pubDate>Sat, 22 May 2010 00:05:28 +0000</pubDate>
		<dc:creator>jimmyzhang</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://ximpleware.wordpress.com/?p=34</guid>
		<description><![CDATA[When you extract an element fragment by calling VTDNav&#8217;s getElementFragment(), you won&#8217;t be able to carry along the name spaces within context. If you want to extract an element fragment along with its name spaces, you need to call getElementFragmentNs(). Below are the examples of calling The Java Version: The C# version The C version<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ximpleware.wordpress.com&amp;blog=8885239&amp;post=34&amp;subd=ximpleware&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>When you extract an element fragment by calling VTDNav&#8217;s getElementFragment(), you won&#8217;t be able to carry along the name spaces within context. If you want to extract an element fragment along with its name spaces, you need to call getElementFragmentNs(). Below are the examples of calling </p>
<p>The Java Version:<br />
<pre class="brush: java;">
// Insert a ns-compensated fragment into an XML doc

public class FragmentTest {    
    public static void main(String[] s) throws Exception{
        // instantiate VTDGen and XMLModifier
        VTDGen vg = new VTDGen();
        XMLModifier xm = new XMLModifier();
        AutoPilot ap = new AutoPilot();
        AutoPilot ap2 = new AutoPilot();
        ap.selectXPath(&quot;(/*/*/*)[position()&gt;1 and position()&lt;4]&quot;);
        ap2.selectXPath(&quot;/*/*/*&quot;);
        if (vg.parseFile(&quot;soap2.xml&quot;,true)){
            VTDNav vn = vg.getNav();
            xm.bind(vn);
            ap2.bind(vn);
            ap.bind(vn);
            ap2.evalXPath();
            ElementFragmentNs ef = vn.getElementFragmentNs();
            int i = -1;
            while((i=ap.evalXPath())!=-1){
                xm.insertAfterElement(ef);
            }           
            xm.output(new FileOutputStream(&quot;new_soap.xml&quot;));
        }        
    }
}
</pre></p>
<p>The C# version<br />
<pre class="brush: csharp;">
using System;
using com.ximpleware;

namespace FragmentTest
{
    public class FragmentTest
    {
        public static void Main(String[] args)
        {
            // instantiate VTDGen and XMLModifier
            VTDGen vg = new VTDGen();
            XMLModifier xm = new XMLModifier();
            AutoPilot ap = new AutoPilot();
            AutoPilot ap2 = new AutoPilot();
            ap.selectXPath(&quot;(/*/*/*)[position()&gt;1 and position()&lt;4]&quot;);
            ap2.selectXPath(&quot;/*/*/*&quot;);
            if (vg.parseFile(&quot;soap2.xml&quot;, true))
            {
                VTDNav vn = vg.getNav();
                xm.bind(vn);
                ap2.bind(vn);
                ap.bind(vn);
                ap2.evalXPath();
                ElementFragmentNs ef = vn.getElementFragmentNs();
                int i = -1;
                while ((i = ap.evalXPath()) != -1)
                {
                    xm.insertAfterElement(ef);
                }
                xm.output(&quot;new_soap.xml&quot;);
            }
        }
    }
}
</pre></p>
<p>The C version<br />
<pre class="brush: cpp;">
#include &lt;string.h&gt;
#include &lt;stdio.h&gt;
#include &lt;stdlib.h&gt;
#include &lt;fcntl.h&gt;
#include &lt;sys/types.h&gt;
#include &lt;sys/stat.h&gt;
#include &lt;io.h&gt;
#include &quot;xpath1.h&quot;
#include &quot;helper.h&quot;
#include &quot;vtdGen.h&quot;
#include &quot;vtdNav.h&quot;
#include &quot;autoPilot.h&quot;
#include &quot;XMLModifier.h&quot;
#include &quot;nodeRecorder.h&quot;
#include &quot;bookMark.h&quot;

struct exception_context the_exception_context[1];

void main(){
	exception e;
	Try{
		VTDGen *vg = NULL; /* This is the VTDGen that parses XML */
		VTDNav *vn = NULL; /* This is the VTDNav that navigates the VTD records */
		AutoPilot *ap = NULL, *ap2=NULL;
		XMLModifier *xm = NULL;
		ElementFragmentNs *ef = NULL;
		int i= -1;
		Long l= -1;

		vg = createVTDGen();
		ap = createAutoPilot2();
		ap2 = createAutoPilot2();
		xm = createXMLModifier();
		selectXPath(ap,L&quot;(/*/*/*)[position()&gt;1 and position()&lt;4]&quot;);
		selectXPath(ap2,L&quot;/*/*/*&quot;);
		if (parseFile(vg,TRUE,&quot;soap2.xml&quot;)){
			//FILE *f1 = fopen(&quot;d:/new3.xml&quot;,&quot;wb&quot;);
			vn = getNav(vg);
			bind(ap,vn);
			bind(ap2,vn);
			bind4XMLModifier(xm,vn);
			evalXPath(ap2);
			ef = getElementFragmentNs(vn);
			
			while( (i=evalXPath(ap))!=-1){
				insertAfterElement4(xm,ef);
				printf(&quot; index %d \n&quot;,i);
			}
			//fwrite(vn-&gt;XMLDoc+vn-&gt;docOffset,sizeof(UByte),vn-&gt;docLen,f1);
			output2(xm,&quot;new3.xml&quot;);
			//fclose(f1);
			free(vn-&gt;XMLDoc);
			freeVTDNav(vn);
		}
		freeElementFragmentNs(ef);
		freeXMLModifier(xm);
		freeAutoPilot(ap);
		freeAutoPilot(ap2);
		freeVTDGen(vg);
		
	}Catch(e){
		printf(&quot;exception !!!!!!!!!!! \n&quot;);
	}
}
</pre></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ximpleware.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ximpleware.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ximpleware.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ximpleware.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ximpleware.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ximpleware.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ximpleware.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ximpleware.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ximpleware.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ximpleware.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ximpleware.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ximpleware.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ximpleware.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ximpleware.wordpress.com/34/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ximpleware.wordpress.com&amp;blog=8885239&amp;post=34&amp;subd=ximpleware&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ximpleware.wordpress.com/2010/05/22/namespace-compensation-with-vtd-xml/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/44e10bff8af9da12a05a02e7bc11b80a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jimmyzhang</media:title>
		</media:content>
	</item>
		<item>
		<title>Using VTD-XML to Replace Element Names</title>
		<link>http://ximpleware.wordpress.com/2010/05/21/using-vtd-xml/</link>
		<comments>http://ximpleware.wordpress.com/2010/05/21/using-vtd-xml/#comments</comments>
		<pubDate>Fri, 21 May 2010 23:24:37 +0000</pubDate>
		<dc:creator>jimmyzhang</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://ximpleware.wordpress.com/?p=27</guid>
		<description><![CDATA[C# and Java code about how to <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ximpleware.wordpress.com&amp;blog=8885239&amp;post=27&amp;subd=ximpleware&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This code example shows you how to replace the element name of an XML document using XPath and XMLModifier in VTD-XML. The key is to combine XPath and  XMLModifier&#8217;s updateElementName() at the cursor node.</p>
<p>The Java version is below:<br />
<pre class="brush: java;">
/*
 * Change all elements to lalalala
 */
import com.ximpleware.*;

public class changeElementName {

    public static void main(String[] args) throws Exception{
        
        String xml = &quot;&lt;aaaa&gt; &lt;bbbbb&gt; &lt;ccccc&gt; &lt;/ccccc&gt; &lt;ccccc/&gt; &lt;ccccc&gt;&lt;/ccccc&gt; &lt;/bbbbb&gt; &lt;/aaaa&gt;&quot;;
        VTDGen vg = new VTDGen();
        vg.setDoc(xml.getBytes());
        vg.parse(false);
        VTDNav vn = vg.getNav();
        AutoPilot ap = new AutoPilot(vn);
        ap.selectXPath(&quot;//*&quot;);
        XMLModifier xm = new XMLModifier(vn);
        int i;
        while(ap.evalXPath()!=-1){
            xm.updateElementName(&quot;lalalala&quot;);
        }
        xm.output(&quot;lala.xml&quot;);
        
    }
}
</pre></p>
<p>The C# version is here:</p>
<p><pre class="brush: csharp;">
using System;

using com.ximpleware;
using System.IO;
namespace FragmentTest
{
    public class FragmentTest
    {
        public static void Main(String[] args)
        {

            String xml = &quot;&lt;aaaa&gt; &lt;bbbbb&gt; &lt;ccccc&gt; &lt;/ccccc&gt; &lt;ccccc/&gt; &lt;ccccc&gt;&lt;/ccccc&gt; &lt;/bbbbb&gt; &lt;/aaaa&gt;&quot;;
            Encoding eg = Encoding.GetEncoding(&quot;utf-8&quot;);
            VTDGen vg = new VTDGen();
            vg.setDoc(eg.GetBytes(xml));
            vg.parse(false);
            VTDNav vn = vg.getNav();
            AutoPilot ap = new AutoPilot(vn);
            ap.selectXPath(&quot;//*&quot;);
            XMLModifier xm = new XMLModifier(vn);
            while (ap.evalXPath() != -1)
            {
                xm.updateElementName(&quot;d:/lalalala&quot;);
            }
            xm.output(&quot;lala.xml&quot;);
        }
    }
}
</pre></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ximpleware.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ximpleware.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ximpleware.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ximpleware.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ximpleware.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ximpleware.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ximpleware.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ximpleware.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ximpleware.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ximpleware.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ximpleware.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ximpleware.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ximpleware.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ximpleware.wordpress.com/27/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ximpleware.wordpress.com&amp;blog=8885239&amp;post=27&amp;subd=ximpleware&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ximpleware.wordpress.com/2010/05/21/using-vtd-xml/feed/</wfw:commentRss>
		<slash:comments>24</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/44e10bff8af9da12a05a02e7bc11b80a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jimmyzhang</media:title>
		</media:content>
	</item>
		<item>
		<title>VTD-XML 2.8 Released!</title>
		<link>http://ximpleware.wordpress.com/2010/04/12/vtd-xml-2-8-released/</link>
		<comments>http://ximpleware.wordpress.com/2010/04/12/vtd-xml-2-8-released/#comments</comments>
		<pubDate>Mon, 12 Apr 2010 09:41:39 +0000</pubDate>
		<dc:creator>jimmyzhang</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://ximpleware.wordpress.com/?p=25</guid>
		<description><![CDATA[Below are the improvements and enhancements in v 2.8 (which can be downloaded here) Expansion of Core VTD-XML API VTDGen adds support for capturing white spaces VTDNav adds support for suport for getContentFragment(), recoverNode() and cloneNav() XMLModifier adds support for update and reparse feature AutoPilot adds support for retrieving all attributes BookMark is also enhanced. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ximpleware.wordpress.com&amp;blog=8885239&amp;post=25&amp;subd=ximpleware&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Below are the improvements and enhancements in v 2.8 (which can be downloaded <a title="VTD-XML 2.8 File Download" href="https://sourceforge.net/projects/vtd-xml/files/" target="_blank">here</a>)</p>
<ul>
<li>Expansion of Core VTD-XML API
<ul>
<li style="text-align:left;">VTDGen adds support for capturing white spaces</li>
<li style="text-align:left;">VTDNav adds support for suport for getContentFragment(), recoverNode() and cloneNav()</li>
<li style="text-align:left;">XMLModifier adds support for update and reparse feature</li>
<li style="text-align:left;">AutoPilot adds support for retrieving all attributes</li>
<li style="text-align:left;">BookMark is also enhanced.</li>
</ul>
</li>
<li>
<div style="text-align:left;">Expansion of Extended VTD-XML API</div>
<ul>
<li>Add content extraction ability to extended VTD-XML</li>
<li>VTDNavHuge now can call getElementFragment() and getElementFragmentNs()</li>
<li>VTDGenHuge adds support for capturing white spaces</li>
</ul>
</li>
<li>XPath
<ul>
<li>Adds comment and processing instruction support for nodes, and performance enhancement</li>
<li>Adds namespace axis support &#8230;</li>
<li> Adds round-half-to-even()</li>
</ul>
</li>
<li>A number of bug fixes and code enhancement</li>
</ul>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ximpleware.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ximpleware.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ximpleware.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ximpleware.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ximpleware.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ximpleware.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ximpleware.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ximpleware.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ximpleware.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ximpleware.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ximpleware.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ximpleware.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ximpleware.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ximpleware.wordpress.com/25/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ximpleware.wordpress.com&amp;blog=8885239&amp;post=25&amp;subd=ximpleware&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ximpleware.wordpress.com/2010/04/12/vtd-xml-2-8-released/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/44e10bff8af9da12a05a02e7bc11b80a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jimmyzhang</media:title>
		</media:content>
	</item>
		<item>
		<title>A Slide Presentation on VTD-XML</title>
		<link>http://ximpleware.wordpress.com/2010/02/05/a-slide-presentation-on-vtd-xml/</link>
		<comments>http://ximpleware.wordpress.com/2010/02/05/a-slide-presentation-on-vtd-xml/#comments</comments>
		<pubDate>Fri, 05 Feb 2010 03:55:34 +0000</pubDate>
		<dc:creator>jimmyzhang</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://ximpleware.wordpress.com/?p=23</guid>
		<description><![CDATA[I just found a new slide presentation of VTD-XML posted on slideshare.net, a very good read! http://www.slideshare.net/junyuo/vtdxml-the-future-of-xml-processing#stats-bottom<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ximpleware.wordpress.com&amp;blog=8885239&amp;post=23&amp;subd=ximpleware&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I just found a new slide presentation of VTD-XML posted on slideshare.net, a very good read!</p>
<p><a href="http://www.slideshare.net/junyuo/vtdxml-the-future-of-xml-processing#stats-bottom">http://www.slideshare.net/junyuo/vtdxml-the-future-of-xml-processing#stats-bottom</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ximpleware.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ximpleware.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ximpleware.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ximpleware.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ximpleware.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ximpleware.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ximpleware.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ximpleware.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ximpleware.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ximpleware.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ximpleware.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ximpleware.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ximpleware.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ximpleware.wordpress.com/23/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ximpleware.wordpress.com&amp;blog=8885239&amp;post=23&amp;subd=ximpleware&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ximpleware.wordpress.com/2010/02/05/a-slide-presentation-on-vtd-xml/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/44e10bff8af9da12a05a02e7bc11b80a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jimmyzhang</media:title>
		</media:content>
	</item>
	</channel>
</rss>
