From 2094a4fd3da85c1972f215cb5977f6157590ff79 Mon Sep 17 00:00:00 2001 From: Arseny Kapoulkine Date: Fri, 28 Feb 2014 06:01:16 +0000 Subject: docs: Regenerate HTML documentation git-svn-id: https://pugixml.googlecode.com/svn/trunk@993 99668b35-9821-0410-8761-19e4c4f06640 --- docs/manual/dom.html | 220 +++++++++++++++++++++++++-------------------------- 1 file changed, 108 insertions(+), 112 deletions(-) (limited to 'docs/manual/dom.html') diff --git a/docs/manual/dom.html b/docs/manual/dom.html index 22d8d83..57d3ea0 100644 --- a/docs/manual/dom.html +++ b/docs/manual/dom.html @@ -3,16 +3,16 @@ Document object model - - - + + +
-pugixml 1.2 manual | +pugixml 1.4 manual | Overview | Installation | Document: @@ -28,20 +28,20 @@
-
-
Tree structure
-
C++ interface
-
Unicode interface
-
Thread-safety guarantees
-
Exception guarantees
-
Memory management
+ @@ -56,7 +56,7 @@

The XML document is represented with a tree data structure. The root of the @@ -66,11 +66,11 @@ which correspond to C++ type xml_attribute, and some additional data (i.e. name).

-

- The tree nodes can be of one of the following types (which together form - the enumeration xml_node_type): +

+ The tree nodes can be of one of the following + types (which together form the enumeration xml_node_type):

-
    +
    • Document node (node_document) - this is the root of the tree, which consists of several child nodes. This @@ -81,7 +81,6 @@ several ways, which are covered below. There can be only one document node in the tree; document node does not have any XML representation.

      -
    • Element/tag node (node_element) - this @@ -100,7 +99,7 @@ another has name "child" and does not have any attributes or child nodes.

    -
    • +
      • Plain character data nodes (node_pcdata) represent plain text in XML. PCDATA nodes have a value, but do not have a name or children/attributes. Note that plain @@ -115,7 +114,7 @@ has three children, two of which are PCDATA nodes with values " text1 " and " text2 ".

      -
      • +
        • Character data nodes (node_cdata) represent text in XML that is quoted in a special way. CDATA nodes do not differ from PCDATA nodes except in XML representation - the above text example @@ -128,7 +127,7 @@ in plain text. CDATA value can not contain the character sequence ]]>, since it is used to determine the end of node contents.

        -
        • +
          • Comment nodes (node_comment) represent comments in XML. Comment nodes have a value, but do not have a name or children/attributes. The example XML representation of a comment node @@ -143,7 +142,7 @@ this behavior with parse_comments flag.

          -
          • +
            • Processing instruction node (node_pi) represent processing instructions (PI) in XML. PI nodes have a name and an optional value, but do not have children/attributes. The example XML representation @@ -158,7 +157,7 @@ are not loaded during XML parsing. You can override this behavior with parse_pi flag.

            -
            • +
              • Declaration node (node_declaration) represents document declarations in XML. Declaration nodes have a name ("xml") and an @@ -180,7 +179,7 @@ there is already a declaration in the document; you can disable this with format_no_declaration flag.

              -
              • +
                • Document type declaration node (node_doctype) represents document type declarations in XML. Document type declaration nodes have a value, which corresponds to the entire document type contents; @@ -189,7 +188,7 @@ (its parent should be the document). The example XML representation of a document type declaration node is as follows:
                -
                <!DOCTYPE greeting [ <!ELEMENT greeting (#PCDATA)> ]>
                +
                <!DOCTYPE greeting [ <!ELEMENT greeting (#PCDATA)> ]>
                 

                Here the node has value "greeting [ <!ELEMENT @@ -209,7 +208,6 @@

-

<?xml version="1.0"?>
 <mesh name="mesh_root">
@@ -237,7 +235,7 @@
 
 
@@ -261,21 +259,18 @@ some operations on xml_node are only valid for certain node types. The classes are described below.

-

- xml_document is the owner - of the entire document structure; it is a non-copyable class. The interface - of xml_document consists - of loading functions (see Loading document), saving functions (see Saving document) - and the entire interface of xml_node, - which allows for document inspection and/or modification. Note that while - xml_document is a sub-class - of xml_node, xml_node is not a polymorphic type; the - inheritance is present only to simplify usage. Alternatively you can use - the document_element function - to get the element node that's the immediate child of the document. +

+ xml_document is the owner of the entire + document structure; it is a non-copyable class. The interface of xml_document consists of loading functions + (see Loading document), saving functions (see Saving document) and the entire + interface of xml_node, which + allows for document inspection and/or modification. Note that while xml_document is a sub-class of xml_node, xml_node + is not a polymorphic type; the inheritance is present only to simplify usage. + Alternatively you can use the document_element + function to get the element node that's the immediate child of the document.

-

- Default constructor of xml_document +

+ Default constructor of xml_document initializes the document to the tree with only a root node (document node). You can then populate it with data using either tree modification functions or loading functions; all loading functions destroy the previous tree with @@ -300,12 +295,12 @@ are destroyed.

-

- xml_node is the handle to - document node; it can point to any node in the document, including the document - node itself. There is a common interface for nodes of all types; the actual - node type can be queried via the xml_node::type() - method. Note that xml_node +

+ xml_node + is the handle to document node; it can point to any node in the document, + including the document node itself. There is a common interface for nodes + of all types; the actual node type can + be queried via the xml_node::type() method. Note that xml_node is only a handle to the actual node, not the node itself - you can have several xml_node handles pointing to the same underlying object. Destroying xml_node @@ -315,8 +310,8 @@ a pointer; you can safely pass or return xml_node objects by value without additional overhead.

-

- There is a special value of xml_node +

+ There is a special value of xml_node type, known as null node or empty node (such nodes have type node_null). It does not correspond to any node in any document, and thus resembles null pointer. However, all operations are defined on empty nodes; generally the operations don't do anything and @@ -326,37 +321,40 @@ have a parent, the first parent() call returns null node; the second parent() call then also returns null node, which makes error handling easier.

-

- xml_attribute is the handle - to an XML attribute; it has the same semantics as xml_node, - i.e. there can be several xml_attribute - handles pointing to the same underlying object and there is a special null - attribute value, which propagates to function results. +

+ xml_attribute + is the handle to an XML attribute; it has the same semantics as xml_node, i.e. there can be several xml_attribute handles pointing to the same + underlying object and there is a special null attribute value, which propagates + to function results.

-

- Both xml_node and xml_attribute have the default constructor - which initializes them to null objects. +

+ Both xml_node and xml_attribute + have the default constructor which initializes them to null objects.

-

- xml_node and xml_attribute try to behave like pointers, - that is, they can be compared with other objects of the same type, making - it possible to use them as keys in associative containers. All handles to - the same underlying object are equal, and any two handles to different underlying - objects are not equal. Null handles only compare as equal to themselves. - The result of relational comparison can not be reliably determined from the - order of nodes in file or in any other way. Do not use relational comparison - operators except for search optimization (i.e. associative container keys). +

+ xml_node and xml_attribute + try to behave like pointers, that is, they can be compared with other objects + of the same type, making it possible to use them as keys in associative containers. + All handles to the same underlying object are equal, and any two handles + to different underlying objects are not equal. Null handles only compare + as equal to themselves. The result of relational comparison can not be reliably + determined from the order of nodes in file or in any other way. Do not use + relational comparison operators except for search optimization (i.e. associative + container keys).

-

- If you want to use xml_node +

+ If + you want to use xml_node or xml_attribute objects as keys in hash-based associative containers, you can use the hash_value member functions. They return the hash values that are guaranteed to be the same for all handles to the same underlying object. The hash value for null handles is 0.

-

- Finally handles can be implicitly cast to boolean-like objects, so that you - can test if the node/attribute is empty with the following code: if (node) { ... +

+ Finally handles + can be implicitly cast to boolean-like objects, so that you can test if the + node/attribute is empty with the following code: if + (node) { ... } or if (!node) { ... } else { ... }. @@ -379,14 +377,14 @@

There are two choices of interface and internal representation when configuring pugixml: you can either choose the UTF-8 (also called char) interface or UTF-16/32 (also called wchar_t) one. The choice is controlled via PUGIXML_WCHAR_MODE define; you can set it via pugiconfig.hpp or via preprocessor options, as - discussed in Additional configuration + discussed in Additional configuration options. If this define is set, the wchar_t interface is used; otherwise (by default) the char interface is used. The exact wide character encoding is assumed to be either UTF-16 or UTF-32 and @@ -418,13 +416,13 @@

const wchar_t* xml_node::name() const;
 bool xml_node::set_name(const wchar_t* value);
 
-

- There is a special type, pugi::char_t, - that is defined as the character type and depends on the library configuration; - it will be also used in the documentation hereafter. There is also a type - pugi::string_t, which is defined as the STL string - of the character type; it corresponds to std::string - in char mode and to std::wstring in wchar_t mode. +

+ There is a special type, pugi::char_t, that is defined as the character + type and depends on the library configuration; it will be also used in the + documentation hereafter. There is also a type pugi::string_t, + which is defined as the STL string of the character type; it corresponds + to std::string in char mode and to std::wstring + in wchar_t mode.

In addition to the interface, the internal implementation changes to store @@ -436,9 +434,10 @@ inconvenient to process and most of your XML data is non-ASCII, wchar_t mode is probably a better choice.

-

- There are cases when you'll have to convert string data between UTF-8 and - wchar_t encodings; the following helper functions are provided for such purposes: +

+ There are cases when you'll have + to convert string data between UTF-8 and wchar_t encodings; the following + helper functions are provided for such purposes:

std::string as_utf8(const wchar_t* str);
 std::wstring as_wide(const char* str);
@@ -485,12 +484,12 @@
 

Almost all functions in pugixml have the following thread-safety guarantees:

-
    +

    With the exception of XPath, pugixml itself does not throw any exceptions. @@ -541,7 +540,7 @@

    pugixml requests the memory needed for document storage in big chunks, and @@ -550,21 +549,22 @@

    -

    - All memory for tree structure, tree data and XPath objects is allocated - via globally specified functions, which default to malloc/free. You can - set your own allocation functions with set_memory_management function. - The function interfaces are the same as that of malloc/free: +

    + All + memory for tree structure, tree data and XPath objects is allocated via + globally specified functions, which default to malloc/free. You can set + your own allocation functions with set_memory_management function. The + function interfaces are the same as that of malloc/free:

    typedef void* (*allocation_function)(size_t size);
     typedef void (*deallocation_function)(void* ptr);
     
    -

    - You can use the following accessor functions to change or get current memory - management functions: +

    + You can use the following accessor + functions to change or get current memory management functions:

    void set_memory_management_functions(allocation_function allocate, deallocation_function deallocate);
     allocation_function get_memory_allocation_function();
    @@ -589,7 +589,6 @@
               This is a simple example of custom memory management (samples/custom_memory_management.cpp):
             

    -

    void* custom_allocate(size_t size)
     {
    @@ -604,7 +603,6 @@
     

    -

    pugi::set_memory_management_functions(custom_allocate, custom_deallocate);
     
    @@ -619,7 +617,7 @@

    There are several important buffering optimizations in pugixml that rely @@ -631,10 +629,10 @@

    These constants can be tuned via configuration defines, as discussed in - Additional configuration + Additional configuration options; it is recommended to set them in pugiconfig.hpp.

    -
      +
      • PUGIXML_MEMORY_PAGE_SIZE controls the page size for document memory allocation. Memory for node/attribute @@ -642,7 +640,6 @@ is 32 Kb; for some applications the size is too large (i.e. embedded systems with little heap space or applications that keep lots of XML documents in memory). A minimum size of 1 Kb is recommended.

        -
      • PUGIXML_MEMORY_OUTPUT_STACK @@ -652,7 +649,6 @@ using node output from threads with little stack space, decreasing this value can prevent stack overflows. A minimum size of 1 Kb is recommended.

        -
      • PUGIXML_MEMORY_XPATH_PAGE_SIZE @@ -667,7 +663,7 @@

      @@ -677,7 +673,7 @@

      When the document is loaded from file/buffer, unless an inplace loading - function is used (see Loading document from memory), a complete copy of character + function is used (see Loading document from memory), a complete copy of character stream is made; all names/values of nodes and attributes are allocated in this buffer. This buffer is allocated via a single large allocation and is only freed when document memory is reclaimed (i.e. if the xml_document object is destroyed or if another @@ -707,7 +703,7 @@

      - @@ -715,7 +711,7 @@
      -pugixml 1.2 manual | +pugixml 1.4 manual | Overview | Installation | Document: -- cgit v1.2.3