Skip to content

Commit

Permalink
docs: Work around asciidoc bug with TOC numbering
Browse files Browse the repository at this point in the history
For some reason using a code import right before a header breaks
numbering on that header; fix by moving the import above text.
  • Loading branch information
zeux committed Sep 12, 2024
1 parent 30cc354 commit 3b17184
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 41 deletions.
8 changes: 4 additions & 4 deletions docs/manual.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -825,10 +825,10 @@ As for rejecting invalid XML documents, there are a number of incompatibilities
[[access]]
== Accessing document data

pugixml features an extensive interface for getting various types of data from the document and for traversing the document. This section provides documentation for all such functions that do not modify the tree except for XPath-related functions; see <<xpath>> for XPath reference. As discussed in <<dom.cpp>>, there are two types of handles to tree data - <<xml_node,xml_node>> and <<xml_attribute,xml_attribute>>. The handles have special null (empty) values which propagate through various functions and thus are useful for writing more concise code; see <<node_null,this description>> for details. The documentation in this section will explicitly state the results of all function in case of null inputs.

[import samples/traverse_base.cpp]

pugixml features an extensive interface for getting various types of data from the document and for traversing the document. This section provides documentation for all such functions that do not modify the tree except for XPath-related functions; see <<xpath>> for XPath reference. As discussed in <<dom.cpp>>, there are two types of handles to tree data - <<xml_node,xml_node>> and <<xml_attribute,xml_attribute>>. The handles have special null (empty) values which propagate through various functions and thus are useful for writing more concise code; see <<node_null,this description>> for details. The documentation in this section will explicitly state the results of all function in case of null inputs.

[[access.basic]]
=== Basic traversal functions

Expand Down Expand Up @@ -1274,12 +1274,12 @@ If the offset is not available (this happens if the node is null, was not origin
[[modify]]
== Modifying document data

[import samples/modify_base.cpp]

The document in pugixml is fully mutable: you can completely change the document structure and modify the data of nodes/attributes. This section provides documentation for the relevant functions. All functions take care of memory management and structural integrity themselves, so they always result in structurally valid tree - however, it is possible to create an invalid XML tree (for example, by adding two attributes with the same name or by setting attribute/node name to empty/invalid string). Tree modification is optimized for performance and for memory consumption, so if you have enough memory you can create documents from scratch with pugixml and later save them to file/stream instead of relying on error-prone manual text writing and without too much overhead.

All member functions that change node/attribute data or structure are non-constant and thus can not be called on constant handles. However, you can easily convert constant handle to non-constant one by simple assignment: `void foo(const pugi::xml_node& n) { pugi::xml_node nc = n; }`, so const-correctness here mainly provides additional documentation.

[import samples/modify_base.cpp]

[[modify.nodedata]]
=== Setting node data

Expand Down
Loading

0 comments on commit 3b17184

Please sign in to comment.