Re: [xml] libxml tutorial


        How about an simple example using Xpath to do thing LIKE this.

        xmlDocPtr doc = xmlParseFile(docname);

        title = getKeyword(doc, "/mail/title");
        setKeyword(doc, "/mail/title", "Simple xml example");

        xmlSaveFormatFile (docname, doc, 1);

        And same function for setAttribut, getAttribut.

 <from>Francois Chenais citb bull net</from>
 <subject>libxml tutorial</subject>
    bla bla bla

On 02 Jun 2002 21:06:12 -0600
John Fleck <jfleck inkstain net> wrote:

  | Folks -
  | I've finished a big chunk of a draft of the libxml tutorial and would
  | like feedback.
  | It includes examples and explanations on:
  | 1) parsing a doc
  | 2) extracting text from an element
  | 3) adding an element
  | 4) extracting text from an attribute (well, it *will* have this, but
  | doesn't yet)
  | 5) adding an attribute.
  | Remember that I am a writer, not a hacker, readers will be well served
  | if others look over my examples and suggest improvements.
  | Once this is done, I'm looking for suggestions for other fundamental
  | tasks, that I might add future chapters. DTD handling is the next thing
  | on my list, but I'm open to other ideas.
  | I've put it up here for now:
  | Cheers,
  | John
  | -- 
  | John Fleck
  | jfleck inkstain net (h) jfleck abqjournal com (w)
  | "You don't want to die with the music still in you."
  |  - John Gardner
  | _______________________________________________
  | xml mailing list, project page
  | xml gnome org

Attachment: pgpE1anSlVozj.pgp
Description: PGP signature

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