Skip to content

Commit b2b4664

Browse files
committed
docs: Adjust docs wrt parse_merge_pcdata x parse_embed_pcdata
parse_merge_pcdata expects to find node_pcdata nodes which aren't present when parse_embed_pcdata is active. For now we mention this in the documentation; changing this is possible in the future, but carries a small performance penalty so it requires a specific use case. Fixes #600
1 parent 3cc2daf commit b2b4664

File tree

3 files changed

+16
-22
lines changed

3 files changed

+16
-22
lines changed

docs/manual.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -749,7 +749,7 @@ These flags control the resulting tree contents:
749749
* [[parse_embed_pcdata]]`parse_embed_pcdata` determines if PCDATA contents is to be saved as element values. Normally element nodes have names but not values; this flag forces the parser to store the contents as a value if PCDATA is the first child of the element node (otherwise PCDATA node is created as usual). This can significantly reduce the memory required for documents with many PCDATA nodes. To retrieve the data you can use `xml_node::value()` on the element nodes or any of the higher-level functions like `child_value` or `text`. This flag is *off* by default.
750750
Since this flag significantly changes the DOM structure it is only recommended for parsing documents with many PCDATA nodes in memory-constrained environments. This flag is *off* by default.
751751

752-
* [[parse_merge_pcdata]]`parse_merge_pcdata` determines if PCDATA contents is to be merged with the previous PCDATA node when no intermediary nodes are present between them. If the PCDATA contains CDATA sections, PI nodes, or comments in between, and either of the flags <<parse_cdata,parse_cdata>> ,<<parse_pi,parse_pi>> ,<<parse_comments,parse_comments>> is not set, the contents of the PCDATA node will be merged with the previous one. This flag is *off* by default.
752+
* [[parse_merge_pcdata]]`parse_merge_pcdata` determines if PCDATA contents is to be merged with the previous PCDATA node when no intermediary nodes are present between them. If the PCDATA contains CDATA sections, PI nodes, or comments in between, and either of the flags <<parse_cdata,parse_cdata>> ,<<parse_pi,parse_pi>> ,<<parse_comments,parse_comments>> is not set, the contents of the PCDATA node will be merged with the previous one. This flag is *off* by default. Note that this flag is not compatible with `parse_embed_pcdata`.
753753

754754
* [[parse_fragment]]`parse_fragment` determines if document should be treated as a fragment of a valid XML. Parsing document as a fragment leads to top-level PCDATA content (i.e. text that is not located inside a node) to be added to a tree, and additionally treats documents without element nodes as valid and permits multiple top-level element nodes (currently multiple top-level element nodes are also permitted when the flag is off, but that behavior should not be relied on). This flag is *off* by default.
755755

docs/manual.html

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<meta charset="UTF-8">
55
<meta http-equiv="X-UA-Compatible" content="IE=edge">
66
<meta name="viewport" content="width=device-width, initial-scale=1.0">
7-
<meta name="generator" content="Asciidoctor 2.0.18">
7+
<meta name="generator" content="Asciidoctor 2.0.20">
88
<meta name="author" content="website, repository">
99
<title>pugixml 1.14 manual</title>
1010
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Open+Sans:300,300italic,400,400italic,600,600italic%7CNoto+Serif:400,400italic,700,700italic%7CDroid+Sans+Mono:400,700">
@@ -209,13 +209,10 @@
209209
.admonitionblock>table td.content{padding-left:1.125em;padding-right:1.25em;border-left:1px solid #dddddf;color:rgba(0,0,0,.6);word-wrap:anywhere}
210210
.admonitionblock>table td.content>:last-child>:last-child{margin-bottom:0}
211211
.exampleblock>.content{border:1px solid #e6e6e6;margin-bottom:1.25em;padding:1.25em;background:#fff;border-radius:4px}
212-
.exampleblock>.content>:first-child{margin-top:0}
213-
.exampleblock>.content>:last-child{margin-bottom:0}
214212
.sidebarblock{border:1px solid #dbdbd6;margin-bottom:1.25em;padding:1.25em;background:#f3f3f2;border-radius:4px}
215-
.sidebarblock>:first-child{margin-top:0}
216-
.sidebarblock>:last-child{margin-bottom:0}
217213
.sidebarblock>.content>.title{color:#7a2518;margin-top:0;text-align:center}
218-
.exampleblock>.content>:last-child>:last-child,.exampleblock>.content .olist>ol>li:last-child>:last-child,.exampleblock>.content .ulist>ul>li:last-child>:last-child,.exampleblock>.content .qlist>ol>li:last-child>:last-child,.sidebarblock>.content>:last-child>:last-child,.sidebarblock>.content .olist>ol>li:last-child>:last-child,.sidebarblock>.content .ulist>ul>li:last-child>:last-child,.sidebarblock>.content .qlist>ol>li:last-child>:last-child{margin-bottom:0}
214+
.exampleblock>.content>:first-child,.sidebarblock>.content>:first-child{margin-top:0}
215+
.exampleblock>.content>:last-child,.exampleblock>.content>:last-child>:last-child,.exampleblock>.content .olist>ol>li:last-child>:last-child,.exampleblock>.content .ulist>ul>li:last-child>:last-child,.exampleblock>.content .qlist>ol>li:last-child>:last-child,.sidebarblock>.content>:last-child,.sidebarblock>.content>:last-child>:last-child,.sidebarblock>.content .olist>ol>li:last-child>:last-child,.sidebarblock>.content .ulist>ul>li:last-child>:last-child,.sidebarblock>.content .qlist>ol>li:last-child>:last-child{margin-bottom:0}
219216
.literalblock pre,.listingblock>.content>pre{border-radius:4px;overflow-x:auto;padding:1em;font-size:.8125em}
220217
@media screen and (min-width:768px){.literalblock pre,.listingblock>.content>pre{font-size:.90625em}}
221218
@media screen and (min-width:1280px){.literalblock pre,.listingblock>.content>pre{font-size:1em}}
@@ -394,7 +391,7 @@
394391
dt,th.tableblock,td.content,div.footnote{text-rendering:optimizeLegibility}
395392
h1,h2,p,td.content,span.alt,summary{letter-spacing:-.01em}
396393
p strong,td.content strong,div.footnote strong{letter-spacing:-.005em}
397-
p,blockquote,dt,td.content,span.alt,summary{font-size:1.0625rem}
394+
p,blockquote,dt,td.content,td.hdlist1,span.alt,summary{font-size:1.0625rem}
398395
p{margin-bottom:1.25rem}
399396
.sidebarblock p,.sidebarblock dt,.sidebarblock td.content,p.tableblock{font-size:1em}
400397
.exampleblock>.content{background:#fffef7;border-color:#e0e0dc;box-shadow:0 1px 4px #e0e0dc}
@@ -710,7 +707,7 @@ <h3 id="overview.license"><a class="anchor" href="#overview.license"></a><a clas
710707
</div>
711708
<div class="literalblock">
712709
<div class="content">
713-
<pre>Copyright (c) 2006-2023 Arseny Kapoulkine
710+
<pre>Copyright (c) 2006-2024 Arseny Kapoulkine
714711

715712
Permission is hereby granted, free of charge, to any person
716713
obtaining a copy of this software and associated documentation
@@ -740,7 +737,7 @@ <h3 id="overview.license"><a class="anchor" href="#overview.license"></a><a clas
740737
<div class="literalblock">
741738
<div class="content">
742739
<pre>This software is based on pugixml library (https://pugixml.org).
743-
pugixml is Copyright (C) 2006-2023 Arseny Kapoulkine.</pre>
740+
pugixml is Copyright (C) 2006-2024 Arseny Kapoulkine.</pre>
744741
</div>
745742
</div>
746743
</div>
@@ -1802,7 +1799,7 @@ <h3 id="loading.options"><a class="anchor" href="#loading.options"></a><a class=
18021799
Since this flag significantly changes the DOM structure it is only recommended for parsing documents with many PCDATA nodes in memory-constrained environments. This flag is <strong>off</strong> by default.</p>
18031800
</li>
18041801
<li>
1805-
<p><a id="parse_merge_pcdata"></a><code>parse_merge_pcdata</code> determines if PCDATA contents is to be merged with the previous PCDATA node when no intermediary nodes are present between them. If the PCDATA contains CDATA sections, PI nodes, or comments in between, and either of the flags <a href="#parse_cdata">parse_cdata</a> ,<a href="#parse_pi">parse_pi</a> ,<a href="#parse_comments">parse_comments</a> is not set, the contents of the PCDATA node will be merged with the previous one. This flag is <strong>off</strong> by default.</p>
1802+
<p><a id="parse_merge_pcdata"></a><code>parse_merge_pcdata</code> determines if PCDATA contents is to be merged with the previous PCDATA node when no intermediary nodes are present between them. If the PCDATA contains CDATA sections, PI nodes, or comments in between, and either of the flags <a href="#parse_cdata">parse_cdata</a> ,<a href="#parse_pi">parse_pi</a> ,<a href="#parse_comments">parse_comments</a> is not set, the contents of the PCDATA node will be merged with the previous one. This flag is <strong>off</strong> by default. Note that this flag is not compatible with <code>parse_embed_pcdata</code>.</p>
18061803
</li>
18071804
<li>
18081805
<p><a id="parse_fragment"></a><code>parse_fragment</code> determines if document should be treated as a fragment of a valid XML. Parsing document as a fragment leads to top-level PCDATA content (i.e. text that is not located inside a node) to be added to a tree, and additionally treats documents without element nodes as valid and permits multiple top-level element nodes (currently multiple top-level element nodes are also permitted when the flag is off, but that behavior should not be relied on). This flag is <strong>off</strong> by default.</p>
@@ -6156,7 +6153,7 @@ <h3 id="apiref.functions"><a class="anchor" href="#apiref.functions"></a><a clas
61566153
</div>
61576154
<div id="footer">
61586155
<div id="footer-text">
6159-
Last updated 2023-09-07 11:54:45 -0700
6156+
Last updated 2024-01-26 09:23:09 -0800
61606157
</div>
61616158
</div>
61626159
</body>

docs/quickstart.html

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<meta charset="UTF-8">
55
<meta http-equiv="X-UA-Compatible" content="IE=edge">
66
<meta name="viewport" content="width=device-width, initial-scale=1.0">
7-
<meta name="generator" content="Asciidoctor 2.0.18">
7+
<meta name="generator" content="Asciidoctor 2.0.20">
88
<meta name="author" content="website, repository">
99
<title>pugixml 1.14 quick start guide</title>
1010
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Open+Sans:300,300italic,400,400italic,600,600italic%7CNoto+Serif:400,400italic,700,700italic%7CDroid+Sans+Mono:400,700">
@@ -209,13 +209,10 @@
209209
.admonitionblock>table td.content{padding-left:1.125em;padding-right:1.25em;border-left:1px solid #dddddf;color:rgba(0,0,0,.6);word-wrap:anywhere}
210210
.admonitionblock>table td.content>:last-child>:last-child{margin-bottom:0}
211211
.exampleblock>.content{border:1px solid #e6e6e6;margin-bottom:1.25em;padding:1.25em;background:#fff;border-radius:4px}
212-
.exampleblock>.content>:first-child{margin-top:0}
213-
.exampleblock>.content>:last-child{margin-bottom:0}
214212
.sidebarblock{border:1px solid #dbdbd6;margin-bottom:1.25em;padding:1.25em;background:#f3f3f2;border-radius:4px}
215-
.sidebarblock>:first-child{margin-top:0}
216-
.sidebarblock>:last-child{margin-bottom:0}
217213
.sidebarblock>.content>.title{color:#7a2518;margin-top:0;text-align:center}
218-
.exampleblock>.content>:last-child>:last-child,.exampleblock>.content .olist>ol>li:last-child>:last-child,.exampleblock>.content .ulist>ul>li:last-child>:last-child,.exampleblock>.content .qlist>ol>li:last-child>:last-child,.sidebarblock>.content>:last-child>:last-child,.sidebarblock>.content .olist>ol>li:last-child>:last-child,.sidebarblock>.content .ulist>ul>li:last-child>:last-child,.sidebarblock>.content .qlist>ol>li:last-child>:last-child{margin-bottom:0}
214+
.exampleblock>.content>:first-child,.sidebarblock>.content>:first-child{margin-top:0}
215+
.exampleblock>.content>:last-child,.exampleblock>.content>:last-child>:last-child,.exampleblock>.content .olist>ol>li:last-child>:last-child,.exampleblock>.content .ulist>ul>li:last-child>:last-child,.exampleblock>.content .qlist>ol>li:last-child>:last-child,.sidebarblock>.content>:last-child,.sidebarblock>.content>:last-child>:last-child,.sidebarblock>.content .olist>ol>li:last-child>:last-child,.sidebarblock>.content .ulist>ul>li:last-child>:last-child,.sidebarblock>.content .qlist>ol>li:last-child>:last-child{margin-bottom:0}
219216
.literalblock pre,.listingblock>.content>pre{border-radius:4px;overflow-x:auto;padding:1em;font-size:.8125em}
220217
@media screen and (min-width:768px){.literalblock pre,.listingblock>.content>pre{font-size:.90625em}}
221218
@media screen and (min-width:1280px){.literalblock pre,.listingblock>.content>pre{font-size:1em}}
@@ -394,7 +391,7 @@
394391
dt,th.tableblock,td.content,div.footnote{text-rendering:optimizeLegibility}
395392
h1,h2,p,td.content,span.alt,summary{letter-spacing:-.01em}
396393
p strong,td.content strong,div.footnote strong{letter-spacing:-.005em}
397-
p,blockquote,dt,td.content,span.alt,summary{font-size:1.0625rem}
394+
p,blockquote,dt,td.content,td.hdlist1,span.alt,summary{font-size:1.0625rem}
398395
p{margin-bottom:1.25rem}
399396
.sidebarblock p,.sidebarblock dt,.sidebarblock td.content,p.tableblock{font-size:1em}
400397
.exampleblock>.content{background:#fffef7;border-color:#e0e0dc;box-shadow:0 1px 4px #e0e0dc}
@@ -1057,7 +1054,7 @@ <h2 id="license"><a class="anchor" href="#license"></a><a class="link" href="#li
10571054
</div>
10581055
<div class="literalblock">
10591056
<div class="content">
1060-
<pre>Copyright (c) 2006-2023 Arseny Kapoulkine
1057+
<pre>Copyright (c) 2006-2024 Arseny Kapoulkine
10611058

10621059
Permission is hereby granted, free of charge, to any person
10631060
obtaining a copy of this software and associated documentation
@@ -1087,7 +1084,7 @@ <h2 id="license"><a class="anchor" href="#license"></a><a class="link" href="#li
10871084
<div class="literalblock">
10881085
<div class="content">
10891086
<pre>This software is based on pugixml library (https://pugixml.org).
1090-
pugixml is Copyright (C) 2006-2023 Arseny Kapoulkine.</pre>
1087+
pugixml is Copyright (C) 2006-2024 Arseny Kapoulkine.</pre>
10911088
</div>
10921089
</div>
10931090
</div>
@@ -1101,7 +1098,7 @@ <h2 id="license"><a class="anchor" href="#license"></a><a class="link" href="#li
11011098
</div>
11021099
<div id="footer">
11031100
<div id="footer-text">
1104-
Last updated 2023-09-07 11:54:46 -0700
1101+
Last updated 2024-01-26 09:23:09 -0800
11051102
</div>
11061103
</div>
11071104
</body>

0 commit comments

Comments
 (0)