<div>Below, I will understand that the use of SXML is made with the SSAX-SXML library, which has several parts (serialization, sxpath etc.) and is distributed for lots of Scheme implementations on a public domain basis. Essential parts of it are available as Black Hole modules for anyone for whom that might be of interest. Now:</div>

<div><br></div><div><br></div><div>What is advantageous of using SXML or LIBXML depends on the application.</div><div><br></div><div>Motivations for using a C library for a particular mechanism that is already implemented in very very well in Scheme would be, that you are using some code that requires you to use that C library anyhow, or, that there would happen to be some routines implemented in that C library that you need, are not in the Scheme library, and by some reason would be very time-consuming to implement.</div>

<div>     Also of course, like Cyrille points out, there can be occasions when you want or need a specific library choice due to reasons relating to how you handle the code in your application, or the specific computer environment in which your application will execute.</div>

<div><br></div><div>From a very wide perspective, I relate to such occasions as very rare.</div><div><br></div><div>SXML is a data format standard that expresses the entire XML format in S-expression form. For several purposes this is highly usable.</div>

<div><br></div><div>As a general rule, processing Scheme objects rather than FFI objects carries many benefits with it: the language and routines for processing and manipulation available is extremely rich already (sporadic examples: iteration and serialization), your need of custom code for many operations is zero, and also as a sidenote the memory handling is implicit in all steps, including safety of memory fragmentation.</div>

<div><br></div><div>SXML is, generally speaking, an excellent example of when this applies. The only thing that SXML does not include, which a typical XML library does include, is a parent element attribute on (SXML/XML) elements. For the one for whom that would show to be relevant though, it's easy enough to implement, didn't hear anyone ask for that up to now though.</div>

<div><br></div><div>If you have further thoughts or questions please feel free to share,</div><div>Mikael</div><div><br><div class="gmail_quote">2012/7/17 Klaus Schilling <span dir="ltr"><<a href="mailto:schilling.klaus@web.de" target="_blank">schilling.klaus@web.de</a>></span><br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">What are the major advantages of using libxml2 xmlreader with ffi over</div>
using sxml?<br>
<span class="HOEnZb"><font color="#888888"><br>
Klaus Schilling<br></font></span></blockquote><div> </div></div></div>