[xml] Call for contribution of code samples



  Hi,

assuming the silent majority of the subscribers to the list actually
came because they had a problem they couldn't solve, here is a simple
opportunity to contribute back, increasing the amount of information
and documentation available for others. The net result should hopefully
the decrease of "simple" questions on this list, and get people to
quickly find their way with libxml2 programming.
Here is how this should work:
  - have a look at http://xmlsoft.org/examples/index.html
  - look at one of the code example like
    http://xmlsoft.org/examples/parse1.c

A number of you surely struggled with a given API issue at some point
and finally got it resolved. What I would like is a small program
similar to parse1.c or parse2.c , with the same kind of comments
and exaplaining how you solved your problem. Just make sure that
the code is relatively small and focused, commented, actually works and
doesn't leak :-) . Update the header to describe your code example like:

/**
 * section: Parsing
 * synopsis: Parse an XML file to a tree and free it
 * purpose: Demonstrate the use of xmlReadFile() to read an XML file
 *          into a tree and and xmlFreeDoc() to free the resulting tree
 * usage: parse1 test1.xml
 * author: Daniel veillard
 * copy: see Copyright for the status of this software.
 */

  Currently only "Parsing" is defined as a section, but others can be
defined like XPath, RelaxNG, HTML, XInclude, etc. it just need to be a single
word token. The synopsis should be one small line, usage should document
how the program can be tested (for "make tests" regression), they can use
external files, just send them along, and update the author field with
your name and/or contact informations.

  Building new examples based on some of your code or xmllint.c and
a template like parse1.c should not take you too much time, and can
probably save a lot of time to someone learning about this issue, so
please consider contributing one example. Just post it to the list 
I will integrate them to the pool. I doubt we can realistically cover
the full libxml2 API but simply the main set of function or some 
non-trivial API would be quite better than what's available now for
beginners !

    thanks in advance,

Daniel

-- 
Daniel Veillard      | Red Hat Network https://rhn.redhat.com/
veillard redhat com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]