diff --git a/ChangeLog b/ChangeLog index 38c5a2a7..48297e31 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Mon Mar 6 09:34:52 CET 2000 Daniel Veillard + + * doc/xml.html, doc/update.html: updated docs, 1.8.7 + Sat Mar 4 16:14:42 CET 2000 Daniel Veillard * doc/* : rebuilt the docs diff --git a/doc/upgrade.html b/doc/upgrade.html index ce13befa..6a0a787c 100644 --- a/doc/upgrade.html +++ b/doc/upgrade.html @@ -3,7 +3,7 @@ Upgrading libxml client code from 1.x to 2.x - + @@ -38,7 +38,7 @@ mail:

(probablility of having "childs" anywere else is close to 0+
  • The document don't have anymore a root element it has been replaced by children and usually you will get a list - of element here. Áor example a Dtd element for the internal subset and + of element here. For example a Dtd element for the internal subset and it's declaration may be found in that list, as well as processing instructions or comments found before or after the document root element. Use xmlDocGetRootElement(doc) to get the root element of @@ -77,6 +77,6 @@ upgrade, it may cost a lot on the long term ...

    Daniel Veillard

    -

    $Id$

    +

    $Id: upgrade.html,v 1.1 2000/03/04 11:39:43 veillard Exp $

    diff --git a/doc/xml.html b/doc/xml.html index bafbbc98..28cf5ea5 100644 --- a/doc/xml.html +++ b/doc/xml.html @@ -3,7 +3,7 @@ The XML library for Gnome - + @@ -42,9 +42,10 @@

    Introduction

    -

    This document describes libxml, the XML -library provided in the Gnome framework. -XML is a standard for building tag-based structured documents/data.

    +

    This document describes libxml, the XML library provided in the Gnome framework. XML is a standard for +building tag-based structured documents/data.

    Here are some key points about libxml:

      @@ -56,9 +57,11 @@ XML is a standard for building tag-based structured documents/data.

    • Libxml now includes a nearly complete XPath implementation.
    • Libxml exports Push and Pull type parser interfaces for both XML and - HTML.
    • + HTML.
    • This library is released both under the W3C Copyright and the GNU LGPL. Basically, everybody should be happy; if not, drop me a mail.
    • +
    • There is a first set of instruction + concerning upgrade from libxml-1.x to libxml-2.x

    Documentation

    @@ -138,11 +141,11 @@ platform, get in touch with me to upload the package. I will keep them in the
    • The W3C CVS base, available read-only using the CVS pserver authentification (I tend to use - this base for my own development, so it's updated more regularly, but - the content may not be as stable):

      + this base for my own development, so it's updated more regularly, but the + content may not be as stable):

      CVSROOT=:pserver:anonymous@dev.w3.org:/sources/public
      -password: anonymous
      -module: XML
      + password: anonymous + module: XML
    • The Gnome @@ -163,12 +166,14 @@ for really accurate description

    • huge work toward libxml-2.0: This work is available only in W3C CVs base for the moment. You get the snapshot for - the updated version: + the updated version:
      • fix I18N support. ISO-Latin-x/UTF-8/UTF-16 seems correctly handled now
      • -
      • Better handling of entities
      • +
      • Better handling of entities, especially well formedness checking and + proper PEref extensions in external subsets
      • DTD conditional sections
      • +
      • Validation now correcly handle entities content
      • change structures to accomodate DOM
      • Lot of work toward a better compliance. I'm now running and @@ -179,6 +184,22 @@ for really accurate description
      +

      1.8.7: Mar 6 2000

      +
        +
      • This is a bug fix release:
      • +
      • It is possible to disable the ignorable blanks heuristic used by + libxml-1.x, a new function xmlKeepBlanksDefault(0) will allow this. Note + that for adherence to XML spec, this behaviour will be disabled by default + in 2.x . The same function will allow to keep compatibility for old + code.
      • +
      • Blanks in <a> </a> constructs are not ignored anymore, avoiding + heuristic is really the Right Way :-\
      • +
      • The unchecked use of snprintf which was breaking libxml-1.8.6 + compilation on some platforms has been fixed
      • +
      • nanoftp.c nanohttp.c: Fixed '#' and '?' stripping when processing + URIs
      • +
      +

      1.8.6: Jan 31 2000

      • added a nanoFTP transport module, debugged until the new version of

        1.8.3: Jan 5 2000

        • a Push interface for the XML and HTML parsers
        • -
        • a shell-like interface to the document tree (try tester --shell - :-)
        • +
        • a shell-like interface to the document tree (try tester --shell :-)
        • lots of bug fixes and improvement added over XMas hollidays
        • fixed the DTD parsing code to work with the xhtml DTD
        • added xmlRemoveProp(), xmlRemoveID() and xmlRemoveRef()
        • @@ -299,8 +319,8 @@ for really accurate description

          XML

          XML is a standard for -markup-based structured documents. Here is an example -XML document:

          +markup-based structured documents. Here is an example XML +document:

          <?xml version="1.0"?>
           <EXAMPLE prop1="gnome is great" prop2="&amp; linux too">
             <head>
          @@ -317,25 +337,24 @@ XML document:

          The first line specifies that it's an XML document and gives useful information about its encoding. Then the document is a text format whose structure is specified by tags between brackets. Each tag opened has -to be closed. XML is pedantic about this. However, if a tag is -empty (no content), a single tag can serve as both the opening and closing -tag if it ends with /> rather than with >. -Note that, for example, the -image tag has no content (just an attribute) and is closed by ending the -tag with />.

          +to be closed. XML is pedantic about this. However, if a tag is empty +(no content), a single tag can serve as both the opening and closing tag if it +ends with /> rather than with >. Note that, for +example, the image tag has no content (just an attribute) and is closed by +ending the tag with />.

          XML can be applied sucessfully to a wide range of uses, from long term structured document maintenance (where it follows the steps of SGML) to simple -data encoding mechanisms like configuration file formatting (glade), spreadsheets -(gnumeric), or even shorter lived documents such as WebDAV where it is used to -encode remote calls between a client and a server.

          +data encoding mechanisms like configuration file formatting (glade), +spreadsheets (gnumeric), or even shorter lived documents such as WebDAV where +it is used to encode remote calls between a client and a server.

          The tree output

          The parser returns a tree built during the document analysis. The value returned is an xmlDocPtr (i.e., a pointer to an -xmlDoc structure). This structure contains information such as -the file name, the document type, and a root pointer which +xmlDoc structure). This structure contains information such +as the file name, the document type, and a root pointer which is the root of the document (or more exactly the first child under the root which is the document). The tree is made of xmlNodes, chained in double-linked lists of siblings and with childs<->parent relationship. @@ -349,10 +368,10 @@ should be only one ELEMENT under the root):

          In the source package there is a small program (not installed by default) called tester which parses XML files given as argument and -prints them back as parsed. This is useful for detecting errors both in XML code -and in the XML parser itself. It has an option --debug which -prints the actual in-memory structure of the document, here is the result with -the example given before:

          +prints them back as parsed. This is useful for detecting errors both in XML +code and in the XML parser itself. It has an option --debug +which prints the actual in-memory structure of the document, here is the +result with the example given before:

          DOCUMENT
           version=1.0
           standalone=true
          @@ -391,13 +410,13 @@ standalone=true
           memory. In that case (and if you don't expect to save back the XML document
           loaded using libxml), it's better to use the SAX interface of libxml. SAX is a
           callback-based interface to the parser. Before parsing, the
          -application layer registers a customized set of callbacks which are called
          -by the library as it progresses through the XML input.

          +application layer registers a customized set of callbacks which are called by +the library as it progresses through the XML input.

          To get more detailed step-by-step guidance on using the SAX interface of libxml, see the href="http://www.daa.com.au/~james/gnome/xml-sax/xml-sax.html">nice -documentation. written by James +documentation.written by James Henstridge.

          You can debug the SAX behaviour by using the testSAX @@ -471,7 +490,8 @@ defined in "parser.h":

          xmlDocPtr xmlParseFile(const char *filename);
          -

          Parse an XML document contained in a (possibly compressed) file.

          +

          Parse an XML document contained in a (possibly compressed) + file.

          @@ -532,9 +552,9 @@ limited to SAX. Just use the two first arguments of

          Building a tree from scratch

          The other way to get an XML tree in memory is by building it. Basically -there is a set of functions dedicated to building new elements. (These are also -described in "tree.h".) For example, here is a piece of code that produces the -XML document used in the previous examples:

          +there is a set of functions dedicated to building new elements. (These are +also described in "tree.h".) For example, here is a piece of code that +produces the XML document used in the previous examples:

              xmlDocPtr doc;
               xmlNodePtr tree, subtree;
           
          @@ -555,8 +575,8 @@ XML document used in the previous examples:

          Traversing the tree

          Basically by including "tree.h" your code -has access to the internal structure of all the elements of the tree. The names -should be somewhat simple like parent, +has access to the internal structure of all the elements of the tree. The +names should be somewhat simple like parent, childs, next, prev, properties, etc... For example, still with the previous example:

          @@ -565,8 +585,8 @@ example:

          points to the title element,

          doc->root->childs->next->child->child
          -

          points to the text node containing the chapter title "The Linux adventure". -

          +

          points to the text node containing the chapter title "The Linux +adventure".

          NOTE: XML allows PIs and comments to be present before the document root, so doc->root may point to an @@ -599,20 +619,19 @@ elements:

          *value);

          This function takes an "external" string and convert it to one text node or possibly to a list of entity and text nodes. All non-predefined - entity references like &Gnome; will be stored internally as - entity nodes, hence the result of the function may not be a single - node.

          + entity references like &Gnome; will be stored internally as entity + nodes, hence the result of the function may not be a single node.

          xmlChar *xmlNodeListGetString(xmlDocPtr doc, xmlNodePtr list, int inLine);
          -

          This function is the inverse of xmlStringGetNodeList(). - It generates a new string containing - the content of the text and entity nodes. Note the extra argument - inLine. If this argument is set to 1, the function will expand entity - references. For example, instead of returning the &Gnome; XML - encoding in the string, it will substitute it with its value (say, +

          This function is the inverse of + xmlStringGetNodeList(). It generates a new string + containing the content of the text and entity nodes. Note the extra + argument inLine. If this argument is set to 1, the function will expand + entity references. For example, instead of returning the &Gnome; + XML encoding in the string, it will substitute it with its value (say, "GNU Network Object Model Environment"). Set this argument if you want to use the string for non-XML usage like User Interface.

          @@ -634,16 +653,16 @@ elements:

          int xmlSaveFile(const char *filename, xmlDocPtr cur);
          -

          Saves the document to a file. In this case, the compression interface - is triggered if it has been turned on.

          +

          Saves the document to a file. In this case, the compression + interface is triggered if it has been turned on.

          Compression

          The library transparently handles compression when doing file-based -accesses. The level of compression on saves can be turned on either globally or -individually for one file:

          +accesses. The level of compression on saves can be turned on either globally +or individually for one file:

          int xmlGetDocCompressMode (xmlDocPtr doc);

          Gets the document compression ratio (0-9).

          @@ -670,9 +689,9 @@ individually for one file:

          Entities in principle are similar to simple C macros. An entity defines an abbreviation for a given string that you can reuse many times throughout the content of your document. Entities are especially useful when a given string -may occur frequently within a document, or to confine the change needed -to a document to a restricted area in the internal subset of the document (at -the beginning). Example:

          +may occur frequently within a document, or to confine the change needed to a +document to a restricted area in the internal subset of the document (at the +beginning). Example:

          1 <?xml version="1.0"?>
           2 <!DOCTYPE EXAMPLE SYSTEM "example.dtd" [
           3 <!ENTITY xml "Extensible Markup Language">
          @@ -691,11 +710,10 @@ for the character '>',  &apos; for the character ''',
           &amp; for the character '&'.

          One of the problems related to entities is that you may want the parser to -substitute an entity's content so that you can see the replacement text in your -application. -Or you may prefer to keep entity references as such in the content to be -able to save the document back without losing this usually precious -information (if the user went through the pain of explicitly defining +substitute an entity's content so that you can see the replacement text in +your application. Or you may prefer to keep entity references as such in the +content to be able to save the document back without losing this usually +precious information (if the user went through the pain of explicitly defining entities, he may have a a rather negative attitude if you blindly susbtitute them as saving time). The xmlSubstituteEntitiesDefault() @@ -744,26 +762,26 @@ structure and all elements or attributes within that namespace point to it. Hence testing the namespace is a simple and fast equality operation at the user level.

          -

          I suggest that people using libxml use a namespace, and declare it in -the root element of their document as the default namespace. Then they don't -need to use the prefix in the content but we will have a basis for future -semantic refinement and merging of data from different sources. This doesn't -augment significantly the size of the XML output, but significantly increase -its value in the long-term.

          +

          I suggest that people using libxml use a namespace, and declare it in the +root element of their document as the default namespace. Then they don't need +to use the prefix in the content but we will have a basis for future semantic +refinement and merging of data from different sources. This doesn't augment +significantly the size of the XML output, but significantly increase its value +in the long-term.

          Concerning the namespace value, this has to be an URL, but the URL doesn't have to point to any existing resource on the Web. I suggest that it makes -sense to use an URL within a domain you control, and that the URL -should contain some kind of version information if possible. For example, +sense to use an URL within a domain you control, and that the URL should +contain some kind of version information if possible. For example, "http://www.gnome.org/gnumeric/1.0" is a good namespace scheme. Then when you load a file, make sure that a namespace carrying the version-independent prefix is installed on the root element of your document, and if the version information don't match something you know, warn the user and be liberal in what you accept as the input. Also do *not* try to base namespace checking on the prefix value. <foo:text> may be exactly the same -as <bar:text> in another document. What really matter is the URI -associated with the element or the attribute, not the prefix string (which is -just a shortcut for the full URI).

          +as <bar:text> in another document. What really matter is the URI associated +with the element or the attribute, not the prefix string (which is just a +shortcut for the full URI).

          @@Interfaces@@

          @@ -771,8 +789,8 @@ just a shortcut for the full URI).

          Usually people object using namespace in the case of validation, I object this and will make sure that using namespaces won't break validity checking, -so even is you plan to use or currently are using validation I strongly suggest -adding namespaces to your document. A default namespace scheme +so even is you plan to use or currently are using validation I strongly +suggest adding namespaces to your document. A default namespace scheme xmlns="http://...." should not break validity even on less flexible parsers. Now using namespace to mix and differentiate content coming from multiple DTDs will certainly break current validation schemes. I will try @@ -915,10 +933,11 @@ only a couple of functions, browsing the tree to gather the informations and generate the internals structures is harder, and more error prone.

          The suggested principle is to be tolerant with respect to the input -structure. For example, the ordering of the attributes is not significant, Cthe -XML specification is clear about it. It's also usually a good idea to not be -dependent of the orders of the childs of a given node, unless it really makes -things harder. Here is some code to parse the informations for a person:

          +structure. For example, the ordering of the attributes is not significant, +Cthe XML specification is clear about it. It's also usually a good idea to not +be dependent of the orders of the childs of a given node, unless it really +makes things harder. Here is some code to parse the informations for a +person:

          /*
            * A person record
            */
          @@ -1047,6 +1066,6 @@ base under gnome-xml/example

          Daniel Veillard

          -

          $Id: xml.html,v 1.26 2000/03/01 00:40:41 veillard Exp $

          +

          $Id: xml.html,v 1.27 2000/03/02 00:15:55 veillard Exp $