parsexml.html 66 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662
  1. <?xml version="1.0" encoding="utf-8" ?>
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <!-- This file is generated by Nim. -->
  4. <html xmlns="https://www.w3.org/1999/xhtml" xml:lang="en" lang="en" data-theme="auto">
  5. <head>
  6. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  7. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  8. <title>std/parsexml</title>
  9. <!-- Google fonts -->
  10. <link href='https://fonts.googleapis.com/css?family=Lato:400,600,900' rel='stylesheet' type='text/css'/>
  11. <link href='https://fonts.googleapis.com/css?family=Source+Code+Pro:400,500,600' rel='stylesheet' type='text/css'/>
  12. <!-- Favicon -->
  13. <link rel="shortcut icon" href="data:image/x-icon;base64,AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AAAAAAUAAAAF////AP///wD///8A////AP///wD///8A////AP///wD///8A////AAAAAAIAAABbAAAAlQAAAKIAAACbAAAAmwAAAKIAAACVAAAAWwAAAAL///8A////AP///wD///8A////AAAAABQAAADAAAAAYwAAAA3///8A////AP///wD///8AAAAADQAAAGMAAADAAAAAFP///wD///8A////AP///wAAAACdAAAAOv///wD///8A////AP///wD///8A////AP///wD///8AAAAAOgAAAJ3///8A////AP///wAAAAAnAAAAcP///wAAAAAoAAAASv///wD///8A////AP///wAAAABKAAAAKP///wAAAABwAAAAJ////wD///8AAAAAgQAAABwAAACIAAAAkAAAAJMAAACtAAAAFQAAABUAAACtAAAAkwAAAJAAAACIAAAAHAAAAIH///8A////AAAAAKQAAACrAAAAaP///wD///8AAAAARQAAANIAAADSAAAARf///wD///8AAAAAaAAAAKsAAACk////AAAAADMAAACcAAAAnQAAABj///8A////AP///wAAAAAYAAAAGP///wD///8A////AAAAABgAAACdAAAAnAAAADMAAAB1AAAAwwAAAP8AAADpAAAAsQAAAE4AAAAb////AP///wAAAAAbAAAATgAAALEAAADpAAAA/wAAAMMAAAB1AAAAtwAAAOkAAAD/AAAA/wAAAP8AAADvAAAA3gAAAN4AAADeAAAA3gAAAO8AAAD/AAAA/wAAAP8AAADpAAAAtwAAAGUAAAA/AAAA3wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAADfAAAAPwAAAGX///8A////AAAAAEgAAADtAAAAvwAAAL0AAADGAAAA7wAAAO8AAADGAAAAvQAAAL8AAADtAAAASP///wD///8A////AP///wD///8AAAAAO////wD///8A////AAAAAIcAAACH////AP///wD///8AAAAAO////wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A//8AAP//AAD4HwAA7/cAAN/7AAD//wAAoYUAAJ55AACf+QAAh+EAAAAAAADAAwAA4AcAAP5/AAD//wAA//8AAA=="/>
  14. <link rel="icon" type="image/png" sizes="32x32" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAA3XAAAN1wFCKJt4AAAAB3RJTUUH4QQQEwksSS9ZWwAAAk1JREFUWMPtll2ITVEUx39nn/O7Y5qR8f05wtCUUr6ZIS++8pEnkZInPImneaCQ5METNdOkeFBKUhMPRIkHKfEuUZSUlGlKPN2TrgfncpvmnntnmlEyq1Z7t89/rf9a6+y99oZxGZf/XeIq61EdtgKXgdXA0xrYAvBjOIF1AI9zvjcC74BSpndrJPkBWDScTF8Aa4E3wDlgHbASaANmVqlcCnwHvgDvgVfAJ+AikAAvgfVZwLnSVZHZaOuKoQi3ZOMi4NkYkpe1p4J7A8BpYAD49hfIy/oqG0+hLomiKP2L5L+1ubn5115S+3OAn4EnwBlgMzCjyt6ZAnQCJ4A7wOs88iRJHvw50HoujuPBoCKwHWiosy8MdfZnAdcHk8dxXFJ3VQbQlCTJvRBCGdRbD4M6uc5glpY3eAihpN5S5w12diSEcCCEcKUO4ljdr15T76ur1FDDLIQQ3qv71EdDOe3Kxj3leRXyk+pxdWnFWod6Wt2bY3de3aSuUHcPBVimHs7mK9WrmeOF6lR1o9qnzskh2ar2qm1qizpfXaPeVGdlmGN5pb09qMxz1Xb1kLqgzn1RyH7JUXW52lr5e/Kqi9qpto7V1atuUzfnARrV7jEib1T76gG2qxdGmXyiekkt1GswPTtek0aBfJp6YySGBfWg2tPQ0FAYgf1stUfdmdcjarbYJEniKIq6gY/Aw+zWHAC+p2labGpqiorFYgGYCEzN7oQdQClN07O1/EfDyGgC0ALMBdYAi4FyK+4H3gLPsxfR1zRNi+NP7nH5J+QntnXe5B5mpfQAAAAASUVORK5CYII=">
  15. <!-- CSS -->
  16. <link rel="stylesheet" type="text/css" href="nimdoc.out.css?v=2.3.1">
  17. <!-- JS -->
  18. <script type="text/javascript" src="dochack.js?v=2.3.1"></script>
  19. </head>
  20. <body>
  21. <div class="document" id="documentId">
  22. <div class="container">
  23. <h1 class="title">std/parsexml</h1>
  24. <div class="row">
  25. <div class="three columns">
  26. <div class="theme-select-wrapper">
  27. <label for="theme-select">Theme:&nbsp;</label>
  28. <select id="theme-select" onchange="setTheme(this.value)">
  29. <option value="auto">🌗 Match OS</option>
  30. <option value="dark">🌑 Dark</option>
  31. <option value="light">🌕 Light</option>
  32. </select>
  33. </div>
  34. <div id="global-links">
  35. <ul class="simple-boot">
  36. <li><a href="manual.html">Manual</a></li>
  37. <li><a href="lib.html">Standard library</a></li>
  38. <li> <a id="indexLink" href="theindex.html">Index</a></li>
  39. <li><a href="compiler/theindex.html">Compiler docs</a></li>
  40. <li><a href="https://nim-lang.github.io/fusion/theindex.html">Fusion docs</a></li>
  41. <li><a href="https://nim-lang.github.io/Nim/">devel</a>, <a href="https://nim-lang.org/documentation.html">stable</a></li>
  42. </ul>
  43. </div>
  44. <div id="searchInputDiv">
  45. Search: <input type="search" id="searchInput"
  46. oninput="search()" />
  47. </div>
  48. <ul class="simple simple-toc" id="toc-list">
  49. <li><a class="reference" id="example-1colon-retrieve-html-title_toc" href="#example-1colon-retrieve-html-title">Example 1: Retrieve HTML title</a></li>
  50. <li><a class="reference" id="example-2colon-retrieve-all-html-links_toc" href="#example-2colon-retrieve-all-html-links">Example 2: Retrieve all HTML links</a></li>
  51. <li>
  52. <a class="reference reference-toplevel" href="#6" id="56">Imports</a>
  53. </li>
  54. <li>
  55. <details open>
  56. <summary><a class="reference reference-toplevel" href="#7" id="57">Types</a></summary>
  57. <ul class="simple simple-toc-section">
  58. <li><a class="reference" href="#XmlErrorKind" title="XmlErrorKind = enum
  59. errNone, ## no error
  60. errEndOfCDataExpected, ## ``]]&gt;`` expected
  61. errNameExpected, ## name expected
  62. errSemicolonExpected, ## ``;`` expected
  63. errQmGtExpected, ## ``?&gt;`` expected
  64. errGtExpected, ## ``&gt;`` expected
  65. errEqExpected, ## ``=`` expected
  66. errQuoteExpected, ## ``&quot;`` or ``'`` expected
  67. errEndOfCommentExpected, ## ``--&gt;`` expected
  68. errAttributeValueExpected ## non-empty attribute value expected">XmlErrorKind</a></li>
  69. <li><a class="reference" href="#XmlEventKind" title="XmlEventKind = enum
  70. xmlError, ## an error occurred during parsing
  71. xmlEof, ## end of file reached
  72. xmlCharData, ## character data
  73. xmlWhitespace, ## whitespace has been parsed
  74. xmlComment, ## a comment has been parsed
  75. xmlPI, ## processing instruction (``&lt;?name something ?&gt;``)
  76. xmlElementStart, ## ``&lt;elem&gt;``
  77. xmlElementEnd, ## ``&lt;/elem&gt;``
  78. xmlElementOpen, ## ``&lt;elem
  79. xmlAttribute, ## ``key = &quot;value&quot;`` pair
  80. xmlElementClose, ## ``&gt;``
  81. xmlCData, ## ``&lt;![CDATA[`` ... data ... ``]]&gt;``
  82. xmlEntity, ## &amp;entity;
  83. xmlSpecial ## ``&lt;! ... data ... &gt;``">XmlEventKind</a></li>
  84. <li><a class="reference" href="#XmlParseOption" title="XmlParseOption = enum
  85. reportWhitespace, ## report whitespace
  86. reportComments, ## report comments
  87. allowUnquotedAttribs, ## allow unquoted attribute values (for HTML)
  88. allowEmptyAttribs ## allow empty attributes (without explicit value)">XmlParseOption</a></li>
  89. <li><a class="reference" href="#XmlParser" title="XmlParser = object of BaseLexer">XmlParser</a></li>
  90. </ul>
  91. </details>
  92. </li>
  93. <li>
  94. <details open>
  95. <summary><a class="reference reference-toplevel" href="#12" id="62">Procs</a></summary>
  96. <ul class="simple simple-toc-section">
  97. <ul class="simple nested-toc-section">close
  98. <li><a class="reference" href="#close%2CXmlParser" title="close(my: var XmlParser)">close(my: var XmlParser)</a></li>
  99. </ul>
  100. <ul class="simple nested-toc-section">errorMsg
  101. <li><a class="reference" href="#errorMsg%2CXmlParser" title="errorMsg(my: XmlParser): string">errorMsg(my: XmlParser): string</a></li>
  102. <li><a class="reference" href="#errorMsg%2CXmlParser%2Cstring" title="errorMsg(my: XmlParser; msg: string): string">errorMsg(my: XmlParser; msg: string): string</a></li>
  103. </ul>
  104. <ul class="simple nested-toc-section">errorMsgExpected
  105. <li><a class="reference" href="#errorMsgExpected%2CXmlParser%2Cstring" title="errorMsgExpected(my: XmlParser; tag: string): string">errorMsgExpected(my: XmlParser; tag: string): string</a></li>
  106. </ul>
  107. <ul class="simple nested-toc-section">getColumn
  108. <li><a class="reference" href="#getColumn%2CXmlParser" title="getColumn(my: XmlParser): int">getColumn(my: XmlParser): int</a></li>
  109. </ul>
  110. <ul class="simple nested-toc-section">getFilename
  111. <li><a class="reference" href="#getFilename%2CXmlParser" title="getFilename(my: XmlParser): string">getFilename(my: XmlParser): string</a></li>
  112. </ul>
  113. <ul class="simple nested-toc-section">getLine
  114. <li><a class="reference" href="#getLine%2CXmlParser" title="getLine(my: XmlParser): int">getLine(my: XmlParser): int</a></li>
  115. </ul>
  116. <ul class="simple nested-toc-section">kind
  117. <li><a class="reference" href="#kind%2CXmlParser" title="kind(my: XmlParser): XmlEventKind">kind(my: XmlParser): XmlEventKind</a></li>
  118. </ul>
  119. <ul class="simple nested-toc-section">next
  120. <li><a class="reference" href="#next%2CXmlParser" title="next(my: var XmlParser)">next(my: var XmlParser)</a></li>
  121. </ul>
  122. <ul class="simple nested-toc-section">open
  123. <li><a class="reference" href="#open%2CXmlParser%2CStream%2Cstring%2Cset%5BXmlParseOption%5D" title="open(my: var XmlParser; input: Stream; filename: string;
  124. options: set[XmlParseOption] = {})">open(my: var XmlParser; input: Stream; filename: string;
  125. options: set[XmlParseOption] = {})</a></li>
  126. </ul>
  127. <ul class="simple nested-toc-section">rawData
  128. <li><a class="reference" href="#rawData%2CXmlParser" title="rawData(my: var XmlParser): lent string">rawData(my: var XmlParser): lent string</a></li>
  129. </ul>
  130. <ul class="simple nested-toc-section">rawData2
  131. <li><a class="reference" href="#rawData2%2CXmlParser" title="rawData2(my: var XmlParser): lent string">rawData2(my: var XmlParser): lent string</a></li>
  132. </ul>
  133. </ul>
  134. </details>
  135. </li>
  136. <li>
  137. <details open>
  138. <summary><a class="reference reference-toplevel" href="#18" id="68">Templates</a></summary>
  139. <ul class="simple simple-toc-section">
  140. <ul class="simple nested-toc-section">attrKey
  141. <li><a class="reference" href="#attrKey.t%2CXmlParser" title="attrKey(my: XmlParser): string">attrKey(my: XmlParser): string</a></li>
  142. </ul>
  143. <ul class="simple nested-toc-section">attrValue
  144. <li><a class="reference" href="#attrValue.t%2CXmlParser" title="attrValue(my: XmlParser): string">attrValue(my: XmlParser): string</a></li>
  145. </ul>
  146. <ul class="simple nested-toc-section">charData
  147. <li><a class="reference" href="#charData.t%2CXmlParser" title="charData(my: XmlParser): string">charData(my: XmlParser): string</a></li>
  148. </ul>
  149. <ul class="simple nested-toc-section">elementName
  150. <li><a class="reference" href="#elementName.t%2CXmlParser" title="elementName(my: XmlParser): string">elementName(my: XmlParser): string</a></li>
  151. </ul>
  152. <ul class="simple nested-toc-section">entityName
  153. <li><a class="reference" href="#entityName.t%2CXmlParser" title="entityName(my: XmlParser): string">entityName(my: XmlParser): string</a></li>
  154. </ul>
  155. <ul class="simple nested-toc-section">piName
  156. <li><a class="reference" href="#piName.t%2CXmlParser" title="piName(my: XmlParser): string">piName(my: XmlParser): string</a></li>
  157. </ul>
  158. <ul class="simple nested-toc-section">piRest
  159. <li><a class="reference" href="#piRest.t%2CXmlParser" title="piRest(my: XmlParser): string">piRest(my: XmlParser): string</a></li>
  160. </ul>
  161. </ul>
  162. </details>
  163. </li>
  164. </ul>
  165. </div>
  166. <div class="nine columns" id="content">
  167. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/pure/parsexml.nim#L1" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  168. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/pure/parsexml.nim#L1" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  169. <div id="tocRoot"></div>
  170. <p class="module-desc">This module implements a simple high performance <span id="xml_1">XML</span> / <span id="html_1">HTML</span> parser. The only encoding that is supported is UTF-8. The parser has been designed to be somewhat error correcting, so that even most &quot;wild HTML&quot; found on the web can be parsed with it. <strong>Note:</strong> This parser does not check that each <tt class="docutils literal"><span class="pre">&lt;tag&gt;</span></tt> has a corresponding <tt class="docutils literal"><span class="pre">&lt;/tag&gt;</span></tt>! These checks have do be implemented by the client code for various reasons:<ul class="simple"><li>Old HTML contains tags that have no end tag: <tt class="docutils literal"><span class="pre">&lt;br&gt;</span></tt> for example.</li>
  171. <li>HTML tags are case insensitive, XML tags are case sensitive. Since this library can parse both, only the client knows which comparison is to be used.</li>
  172. <li>Thus the checks would have been very difficult to implement properly with little benefit, especially since they are simple to implement in the client. The client should use the <tt class="docutils literal"><span class="pre"><span class="Identifier">errorMsgExpected</span></span></tt> proc to generate a nice error message that fits the other error messages this library creates.</li>
  173. </ul>
  174. <h1><a class="toc-backref" id="example-1colon-retrieve-html-title" href="#example-1colon-retrieve-html-title">Example 1: Retrieve HTML title</a></h1><p>The file <tt class="docutils literal"><span class="pre">examples/htmltitle.nim</span></tt> demonstrates how to use the XML parser to accomplish a simple task: To determine the title of an HTML document.</p>
  175. <p><pre class="listing"><span class="Comment"># Example program to show the parsexml module</span>
  176. <span class="Comment"># This program reads an HTML file and writes its title to stdout.</span>
  177. <span class="Comment"># Errors and whitespace are ignored.</span>
  178. <span class="Keyword">import</span> <span class="Identifier">std</span><span class="Operator">/</span><span class="Punctuation">[</span><span class="Identifier">os</span><span class="Punctuation">,</span> <span class="Identifier">streams</span><span class="Punctuation">,</span> <span class="Identifier">parsexml</span><span class="Punctuation">,</span> <span class="Identifier">strutils</span><span class="Punctuation">]</span>
  179. <span class="Keyword">if</span> <span class="Identifier">paramCount</span><span class="Punctuation">(</span><span class="Punctuation">)</span> <span class="Operator">&lt;</span> <span class="DecNumber">1</span><span class="Punctuation">:</span>
  180. <span class="Identifier">quit</span><span class="Punctuation">(</span><span class="StringLit">&quot;Usage: htmltitle filename[.html]&quot;</span><span class="Punctuation">)</span>
  181. <span class="Keyword">var</span> <span class="Identifier">filename</span> <span class="Operator">=</span> <span class="Identifier">addFileExt</span><span class="Punctuation">(</span><span class="Identifier">paramStr</span><span class="Punctuation">(</span><span class="DecNumber">1</span><span class="Punctuation">)</span><span class="Punctuation">,</span> <span class="StringLit">&quot;html&quot;</span><span class="Punctuation">)</span>
  182. <span class="Keyword">var</span> <span class="Identifier">s</span> <span class="Operator">=</span> <span class="Identifier">newFileStream</span><span class="Punctuation">(</span><span class="Identifier">filename</span><span class="Punctuation">,</span> <span class="Identifier">fmRead</span><span class="Punctuation">)</span>
  183. <span class="Keyword">if</span> <span class="Identifier">s</span> <span class="Operator">==</span> <span class="Keyword">nil</span><span class="Punctuation">:</span> <span class="Identifier">quit</span><span class="Punctuation">(</span><span class="StringLit">&quot;cannot open the file &quot;</span> <span class="Operator">&amp;</span> <span class="Identifier">filename</span><span class="Punctuation">)</span>
  184. <span class="Keyword">var</span> <span class="Identifier">x</span><span class="Punctuation">:</span> <span class="Identifier">XmlParser</span>
  185. <span class="Identifier">open</span><span class="Punctuation">(</span><span class="Identifier">x</span><span class="Punctuation">,</span> <span class="Identifier">s</span><span class="Punctuation">,</span> <span class="Identifier">filename</span><span class="Punctuation">)</span>
  186. <span class="Keyword">while</span> <span class="Identifier">true</span><span class="Punctuation">:</span>
  187. <span class="Identifier">x</span><span class="Operator">.</span><span class="Identifier">next</span><span class="Punctuation">(</span><span class="Punctuation">)</span>
  188. <span class="Keyword">case</span> <span class="Identifier">x</span><span class="Operator">.</span><span class="Identifier">kind</span>
  189. <span class="Keyword">of</span> <span class="Identifier">xmlElementStart</span><span class="Punctuation">:</span>
  190. <span class="Keyword">if</span> <span class="Identifier">cmpIgnoreCase</span><span class="Punctuation">(</span><span class="Identifier">x</span><span class="Operator">.</span><span class="Identifier">elementName</span><span class="Punctuation">,</span> <span class="StringLit">&quot;title&quot;</span><span class="Punctuation">)</span> <span class="Operator">==</span> <span class="DecNumber">0</span><span class="Punctuation">:</span>
  191. <span class="Keyword">var</span> <span class="Identifier">title</span> <span class="Operator">=</span> <span class="StringLit">&quot;&quot;</span>
  192. <span class="Identifier">x</span><span class="Operator">.</span><span class="Identifier">next</span><span class="Punctuation">(</span><span class="Punctuation">)</span> <span class="Comment"># skip &quot;&lt;title&gt;&quot;</span>
  193. <span class="Keyword">while</span> <span class="Identifier">x</span><span class="Operator">.</span><span class="Identifier">kind</span> <span class="Operator">==</span> <span class="Identifier">xmlCharData</span><span class="Punctuation">:</span>
  194. <span class="Identifier">title</span><span class="Operator">.</span><span class="Identifier">add</span><span class="Punctuation">(</span><span class="Identifier">x</span><span class="Operator">.</span><span class="Identifier">charData</span><span class="Punctuation">)</span>
  195. <span class="Identifier">x</span><span class="Operator">.</span><span class="Identifier">next</span><span class="Punctuation">(</span><span class="Punctuation">)</span>
  196. <span class="Keyword">if</span> <span class="Identifier">x</span><span class="Operator">.</span><span class="Identifier">kind</span> <span class="Operator">==</span> <span class="Identifier">xmlElementEnd</span> <span class="Keyword">and</span> <span class="Identifier">cmpIgnoreCase</span><span class="Punctuation">(</span><span class="Identifier">x</span><span class="Operator">.</span><span class="Identifier">elementName</span><span class="Punctuation">,</span> <span class="StringLit">&quot;title&quot;</span><span class="Punctuation">)</span> <span class="Operator">==</span> <span class="DecNumber">0</span><span class="Punctuation">:</span>
  197. <span class="Identifier">echo</span><span class="Punctuation">(</span><span class="StringLit">&quot;Title: &quot;</span> <span class="Operator">&amp;</span> <span class="Identifier">title</span><span class="Punctuation">)</span>
  198. <span class="Identifier">quit</span><span class="Punctuation">(</span><span class="DecNumber">0</span><span class="Punctuation">)</span> <span class="Comment"># Success!</span>
  199. <span class="Keyword">else</span><span class="Punctuation">:</span>
  200. <span class="Identifier">echo</span><span class="Punctuation">(</span><span class="Identifier">x</span><span class="Operator">.</span><span class="Identifier">errorMsgExpected</span><span class="Punctuation">(</span><span class="StringLit">&quot;/title&quot;</span><span class="Punctuation">)</span><span class="Punctuation">)</span>
  201. <span class="Keyword">of</span> <span class="Identifier">xmlEof</span><span class="Punctuation">:</span> <span class="Keyword">break</span> <span class="Comment"># end of file reached</span>
  202. <span class="Keyword">else</span><span class="Punctuation">:</span> <span class="Keyword">discard</span> <span class="Comment"># ignore other events</span>
  203. <span class="Identifier">x</span><span class="Operator">.</span><span class="Identifier">close</span><span class="Punctuation">(</span><span class="Punctuation">)</span>
  204. <span class="Identifier">quit</span><span class="Punctuation">(</span><span class="StringLit">&quot;Could not determine title!&quot;</span><span class="Punctuation">)</span></pre></p>
  205. <h1><a class="toc-backref" id="example-2colon-retrieve-all-html-links" href="#example-2colon-retrieve-all-html-links">Example 2: Retrieve all HTML links</a></h1><p>The file <tt class="docutils literal"><span class="pre">examples/htmlrefs.nim</span></tt> demonstrates how to use the XML parser to accomplish another simple task: To determine all the links an HTML document contains.</p>
  206. <p><pre class="listing"><span class="Comment"># Example program to show the new parsexml module</span>
  207. <span class="Comment"># This program reads an HTML file and writes all its used links to stdout.</span>
  208. <span class="Comment"># Errors and whitespace are ignored.</span>
  209. <span class="Keyword">import</span> <span class="Identifier">std</span><span class="Operator">/</span><span class="Punctuation">[</span><span class="Identifier">os</span><span class="Punctuation">,</span> <span class="Identifier">streams</span><span class="Punctuation">,</span> <span class="Identifier">parsexml</span><span class="Punctuation">,</span> <span class="Identifier">strutils</span><span class="Punctuation">]</span>
  210. <span class="Keyword">proc</span> <span class="Punctuation">`</span><span class="Operator">=?=</span><span class="Punctuation">`</span> <span class="Punctuation">(</span><span class="Identifier">a</span><span class="Punctuation">,</span> <span class="Identifier">b</span><span class="Punctuation">:</span> <span class="Identifier">string</span><span class="Punctuation">)</span><span class="Punctuation">:</span> <span class="Identifier">bool</span> <span class="Operator">=</span>
  211. <span class="Comment"># little trick: define our own comparator that ignores case</span>
  212. <span class="Keyword">return</span> <span class="Identifier">cmpIgnoreCase</span><span class="Punctuation">(</span><span class="Identifier">a</span><span class="Punctuation">,</span> <span class="Identifier">b</span><span class="Punctuation">)</span> <span class="Operator">==</span> <span class="DecNumber">0</span>
  213. <span class="Keyword">if</span> <span class="Identifier">paramCount</span><span class="Punctuation">(</span><span class="Punctuation">)</span> <span class="Operator">&lt;</span> <span class="DecNumber">1</span><span class="Punctuation">:</span>
  214. <span class="Identifier">quit</span><span class="Punctuation">(</span><span class="StringLit">&quot;Usage: htmlrefs filename[.html]&quot;</span><span class="Punctuation">)</span>
  215. <span class="Keyword">var</span> <span class="Identifier">links</span> <span class="Operator">=</span> <span class="DecNumber">0</span> <span class="Comment"># count the number of links</span>
  216. <span class="Keyword">var</span> <span class="Identifier">filename</span> <span class="Operator">=</span> <span class="Identifier">addFileExt</span><span class="Punctuation">(</span><span class="Identifier">paramStr</span><span class="Punctuation">(</span><span class="DecNumber">1</span><span class="Punctuation">)</span><span class="Punctuation">,</span> <span class="StringLit">&quot;html&quot;</span><span class="Punctuation">)</span>
  217. <span class="Keyword">var</span> <span class="Identifier">s</span> <span class="Operator">=</span> <span class="Identifier">newFileStream</span><span class="Punctuation">(</span><span class="Identifier">filename</span><span class="Punctuation">,</span> <span class="Identifier">fmRead</span><span class="Punctuation">)</span>
  218. <span class="Keyword">if</span> <span class="Identifier">s</span> <span class="Operator">==</span> <span class="Keyword">nil</span><span class="Punctuation">:</span> <span class="Identifier">quit</span><span class="Punctuation">(</span><span class="StringLit">&quot;cannot open the file &quot;</span> <span class="Operator">&amp;</span> <span class="Identifier">filename</span><span class="Punctuation">)</span>
  219. <span class="Keyword">var</span> <span class="Identifier">x</span><span class="Punctuation">:</span> <span class="Identifier">XmlParser</span>
  220. <span class="Identifier">open</span><span class="Punctuation">(</span><span class="Identifier">x</span><span class="Punctuation">,</span> <span class="Identifier">s</span><span class="Punctuation">,</span> <span class="Identifier">filename</span><span class="Punctuation">)</span>
  221. <span class="Identifier">next</span><span class="Punctuation">(</span><span class="Identifier">x</span><span class="Punctuation">)</span> <span class="Comment"># get first event</span>
  222. <span class="Keyword">block</span> <span class="Identifier">mainLoop</span><span class="Punctuation">:</span>
  223. <span class="Keyword">while</span> <span class="Identifier">true</span><span class="Punctuation">:</span>
  224. <span class="Keyword">case</span> <span class="Identifier">x</span><span class="Operator">.</span><span class="Identifier">kind</span>
  225. <span class="Keyword">of</span> <span class="Identifier">xmlElementOpen</span><span class="Punctuation">:</span>
  226. <span class="Comment"># the &lt;a href = &quot;xyz&quot;&gt; tag we are interested in always has an attribute,</span>
  227. <span class="Comment"># thus we search for ``xmlElementOpen`` and not for ``xmlElementStart``</span>
  228. <span class="Keyword">if</span> <span class="Identifier">x</span><span class="Operator">.</span><span class="Identifier">elementName</span> <span class="Operator">=?=</span> <span class="StringLit">&quot;a&quot;</span><span class="Punctuation">:</span>
  229. <span class="Identifier">x</span><span class="Operator">.</span><span class="Identifier">next</span><span class="Punctuation">(</span><span class="Punctuation">)</span>
  230. <span class="Keyword">if</span> <span class="Identifier">x</span><span class="Operator">.</span><span class="Identifier">kind</span> <span class="Operator">==</span> <span class="Identifier">xmlAttribute</span><span class="Punctuation">:</span>
  231. <span class="Keyword">if</span> <span class="Identifier">x</span><span class="Operator">.</span><span class="Identifier">attrKey</span> <span class="Operator">=?=</span> <span class="StringLit">&quot;href&quot;</span><span class="Punctuation">:</span>
  232. <span class="Keyword">var</span> <span class="Identifier">link</span> <span class="Operator">=</span> <span class="Identifier">x</span><span class="Operator">.</span><span class="Identifier">attrValue</span>
  233. <span class="Identifier">inc</span><span class="Punctuation">(</span><span class="Identifier">links</span><span class="Punctuation">)</span>
  234. <span class="Comment"># skip until we have an ``xmlElementClose`` event</span>
  235. <span class="Keyword">while</span> <span class="Identifier">true</span><span class="Punctuation">:</span>
  236. <span class="Identifier">x</span><span class="Operator">.</span><span class="Identifier">next</span><span class="Punctuation">(</span><span class="Punctuation">)</span>
  237. <span class="Keyword">case</span> <span class="Identifier">x</span><span class="Operator">.</span><span class="Identifier">kind</span>
  238. <span class="Keyword">of</span> <span class="Identifier">xmlEof</span><span class="Punctuation">:</span> <span class="Keyword">break</span> <span class="Identifier">mainLoop</span>
  239. <span class="Keyword">of</span> <span class="Identifier">xmlElementClose</span><span class="Punctuation">:</span> <span class="Keyword">break</span>
  240. <span class="Keyword">else</span><span class="Punctuation">:</span> <span class="Keyword">discard</span>
  241. <span class="Identifier">x</span><span class="Operator">.</span><span class="Identifier">next</span><span class="Punctuation">(</span><span class="Punctuation">)</span> <span class="Comment"># skip ``xmlElementClose``</span>
  242. <span class="Comment"># now we have the description for the ``a`` element</span>
  243. <span class="Keyword">var</span> <span class="Identifier">desc</span> <span class="Operator">=</span> <span class="StringLit">&quot;&quot;</span>
  244. <span class="Keyword">while</span> <span class="Identifier">x</span><span class="Operator">.</span><span class="Identifier">kind</span> <span class="Operator">==</span> <span class="Identifier">xmlCharData</span><span class="Punctuation">:</span>
  245. <span class="Identifier">desc</span><span class="Operator">.</span><span class="Identifier">add</span><span class="Punctuation">(</span><span class="Identifier">x</span><span class="Operator">.</span><span class="Identifier">charData</span><span class="Punctuation">)</span>
  246. <span class="Identifier">x</span><span class="Operator">.</span><span class="Identifier">next</span><span class="Punctuation">(</span><span class="Punctuation">)</span>
  247. <span class="Identifier">echo</span><span class="Punctuation">(</span><span class="Identifier">desc</span> <span class="Operator">&amp;</span> <span class="StringLit">&quot;: &quot;</span> <span class="Operator">&amp;</span> <span class="Identifier">link</span><span class="Punctuation">)</span>
  248. <span class="Keyword">else</span><span class="Punctuation">:</span>
  249. <span class="Identifier">x</span><span class="Operator">.</span><span class="Identifier">next</span><span class="Punctuation">(</span><span class="Punctuation">)</span>
  250. <span class="Keyword">of</span> <span class="Identifier">xmlEof</span><span class="Punctuation">:</span> <span class="Keyword">break</span> <span class="Comment"># end of file reached</span>
  251. <span class="Keyword">of</span> <span class="Identifier">xmlError</span><span class="Punctuation">:</span>
  252. <span class="Identifier">echo</span><span class="Punctuation">(</span><span class="Identifier">errorMsg</span><span class="Punctuation">(</span><span class="Identifier">x</span><span class="Punctuation">)</span><span class="Punctuation">)</span>
  253. <span class="Identifier">x</span><span class="Operator">.</span><span class="Identifier">next</span><span class="Punctuation">(</span><span class="Punctuation">)</span>
  254. <span class="Keyword">else</span><span class="Punctuation">:</span> <span class="Identifier">x</span><span class="Operator">.</span><span class="Identifier">next</span><span class="Punctuation">(</span><span class="Punctuation">)</span> <span class="Comment"># skip other events</span>
  255. <span class="Identifier">echo</span><span class="Punctuation">(</span><span class="Operator">$</span><span class="Identifier">links</span> <span class="Operator">&amp;</span> <span class="StringLit">&quot; link(s) found!&quot;</span><span class="Punctuation">)</span>
  256. <span class="Identifier">x</span><span class="Operator">.</span><span class="Identifier">close</span><span class="Punctuation">(</span><span class="Punctuation">)</span></pre></p>
  257. </p>
  258. <div class="section" id="6">
  259. <h1><a class="toc-backref" href="#6">Imports</a></h1>
  260. <dl class="item">
  261. <a class="reference external" href="strutils.html">strutils</a>, <a class="reference external" href="lexbase.html">lexbase</a>, <a class="reference external" href="streams.html">streams</a>, <a class="reference external" href="unicode.html">unicode</a>, <a class="reference external" href="assertions.html">assertions</a>, <a class="reference external" href="syncio.html">syncio</a>, <a class="reference external" href="os.html">os</a>
  262. </dl>
  263. </div>
  264. <div class="section" id="7">
  265. <h1><a class="toc-backref" href="#7">Types</a></h1>
  266. <dl class="item">
  267. <div id="XmlErrorKind">
  268. <dt><pre><a href="parsexml.html#XmlErrorKind"><span class="Identifier">XmlErrorKind</span></a> <span class="Other">=</span> <span class="Keyword">enum</span>
  269. <span class="Identifier">errNone</span><span class="Other">,</span> <span class="Comment">## no error</span>
  270. <span class="Identifier">errEndOfCDataExpected</span><span class="Other">,</span> <span class="Comment">## ``]]&gt;`` expected</span>
  271. <span class="Identifier">errNameExpected</span><span class="Other">,</span> <span class="Comment">## name expected</span>
  272. <span class="Identifier">errSemicolonExpected</span><span class="Other">,</span> <span class="Comment">## ``;`` expected</span>
  273. <span class="Identifier">errQmGtExpected</span><span class="Other">,</span> <span class="Comment">## ``?&gt;`` expected</span>
  274. <span class="Identifier">errGtExpected</span><span class="Other">,</span> <span class="Comment">## ``&gt;`` expected</span>
  275. <span class="Identifier">errEqExpected</span><span class="Other">,</span> <span class="Comment">## ``=`` expected</span>
  276. <span class="Identifier">errQuoteExpected</span><span class="Other">,</span> <span class="Comment">## ``&quot;`` or ``'`` expected</span>
  277. <span class="Identifier">errEndOfCommentExpected</span><span class="Other">,</span> <span class="Comment">## ``--&gt;`` expected</span>
  278. <span class="Identifier">errAttributeValueExpected</span> <span class="Comment">## non-empty attribute value expected</span></pre></dt>
  279. <dd>
  280. enumeration that lists all errors that can occur
  281. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/pure/parsexml.nim#L176" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  282. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/pure/parsexml.nim#L176" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  283. </dd>
  284. </div>
  285. <div id="XmlEventKind">
  286. <dt><pre><a href="parsexml.html#XmlEventKind"><span class="Identifier">XmlEventKind</span></a> <span class="Other">=</span> <span class="Keyword">enum</span>
  287. <span class="Identifier">xmlError</span><span class="Other">,</span> <span class="Comment">## an error occurred during parsing</span>
  288. <span class="Identifier">xmlEof</span><span class="Other">,</span> <span class="Comment">## end of file reached</span>
  289. <span class="Identifier">xmlCharData</span><span class="Other">,</span> <span class="Comment">## character data</span>
  290. <span class="Identifier">xmlWhitespace</span><span class="Other">,</span> <span class="Comment">## whitespace has been parsed</span>
  291. <span class="Identifier">xmlComment</span><span class="Other">,</span> <span class="Comment">## a comment has been parsed</span>
  292. <span class="Identifier">xmlPI</span><span class="Other">,</span> <span class="Comment">## processing instruction (``&lt;?name something ?&gt;``)</span>
  293. <span class="Identifier">xmlElementStart</span><span class="Other">,</span> <span class="Comment">## ``&lt;elem&gt;``</span>
  294. <span class="Identifier">xmlElementEnd</span><span class="Other">,</span> <span class="Comment">## ``&lt;/elem&gt;``</span>
  295. <span class="Identifier">xmlElementOpen</span><span class="Other">,</span> <span class="Comment">## ``&lt;elem</span>
  296. <span class="Identifier">xmlAttribute</span><span class="Other">,</span> <span class="Comment">## ``key = &quot;value&quot;`` pair</span>
  297. <span class="Identifier">xmlElementClose</span><span class="Other">,</span> <span class="Comment">## ``&gt;``</span>
  298. <span class="Identifier">xmlCData</span><span class="Other">,</span> <span class="Comment">## ``&lt;![CDATA[`` ... data ... ``]]&gt;``</span>
  299. <span class="Identifier">xmlEntity</span><span class="Other">,</span> <span class="Comment">## &amp;entity;</span>
  300. <span class="Identifier">xmlSpecial</span> <span class="Comment">## ``&lt;! ... data ... &gt;``</span></pre></dt>
  301. <dd>
  302. enumeration of all events that may occur when parsing
  303. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/pure/parsexml.nim#L160" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  304. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/pure/parsexml.nim#L160" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  305. </dd>
  306. </div>
  307. <div id="XmlParseOption">
  308. <dt><pre><a href="parsexml.html#XmlParseOption"><span class="Identifier">XmlParseOption</span></a> <span class="Other">=</span> <span class="Keyword">enum</span>
  309. <span class="Identifier">reportWhitespace</span><span class="Other">,</span> <span class="Comment">## report whitespace</span>
  310. <span class="Identifier">reportComments</span><span class="Other">,</span> <span class="Comment">## report comments</span>
  311. <span class="Identifier">allowUnquotedAttribs</span><span class="Other">,</span> <span class="Comment">## allow unquoted attribute values (for HTML)</span>
  312. <span class="Identifier">allowEmptyAttribs</span> <span class="Comment">## allow empty attributes (without explicit value)</span></pre></dt>
  313. <dd>
  314. options for the XML parser
  315. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/pure/parsexml.nim#L191" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  316. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/pure/parsexml.nim#L191" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  317. </dd>
  318. </div>
  319. <div id="XmlParser">
  320. <dt><pre><a href="parsexml.html#XmlParser"><span class="Identifier">XmlParser</span></a> <span class="Other">=</span> <span class="Keyword">object</span> <span class="Keyword">of</span> <a href="lexbase.html#BaseLexer"><span class="Identifier">BaseLexer</span></a></pre></dt>
  321. <dd>
  322. the parser object.
  323. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/pure/parsexml.nim#L197" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  324. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/pure/parsexml.nim#L197" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  325. </dd>
  326. </div>
  327. </dl>
  328. </div>
  329. <div class="section" id="12">
  330. <h1><a class="toc-backref" href="#12">Procs</a></h1>
  331. <dl class="item">
  332. <div id="close-procs-all">
  333. <div id="close,XmlParser">
  334. <dt><pre><span class="Keyword">proc</span> <a href="#close%2CXmlParser"><span class="Identifier">close</span></a><span class="Other">(</span><span class="Identifier">my</span><span class="Other">:</span> <span class="Keyword">var</span> <a href="parsexml.html#XmlParser"><span class="Identifier">XmlParser</span></a><span class="Other">)</span> {.<span class="Identifier">inline</span><span class="Other">,</span> <span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">IOError</span><span class="Other">,</span> <span class="Identifier">OSError</span><span class="Other">]</span><span class="Other">,</span>
  335. <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">WriteIOEffect</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
  336. <dd>
  337. closes the parser <tt class="docutils literal"><span class="pre"><span class="Identifier">my</span></span></tt> and its associated input stream.
  338. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/pure/parsexml.nim#L238" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  339. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/pure/parsexml.nim#L238" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  340. </dd>
  341. </div>
  342. </div>
  343. <div id="errorMsg-procs-all">
  344. <div id="errorMsg,XmlParser">
  345. <dt><pre><span class="Keyword">proc</span> <a href="#errorMsg%2CXmlParser"><span class="Identifier">errorMsg</span></a><span class="Other">(</span><span class="Identifier">my</span><span class="Other">:</span> <a href="parsexml.html#XmlParser"><span class="Identifier">XmlParser</span></a><span class="Other">)</span><span class="Other">:</span> <a href="system.html#string"><span class="Identifier">string</span></a> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">ValueError</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span>
  346. <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
  347. <dd>
  348. returns a helpful error message for the event <tt class="docutils literal"><span class="pre">xmlError</span></tt>
  349. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/pure/parsexml.nim#L327" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  350. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/pure/parsexml.nim#L327" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  351. </dd>
  352. </div>
  353. <div id="errorMsg,XmlParser,string">
  354. <dt><pre><span class="Keyword">proc</span> <a href="#errorMsg%2CXmlParser%2Cstring"><span class="Identifier">errorMsg</span></a><span class="Other">(</span><span class="Identifier">my</span><span class="Other">:</span> <a href="parsexml.html#XmlParser"><span class="Identifier">XmlParser</span></a><span class="Other">;</span> <span class="Identifier">msg</span><span class="Other">:</span> <a href="system.html#string"><span class="Identifier">string</span></a><span class="Other">)</span><span class="Other">:</span> <a href="system.html#string"><span class="Identifier">string</span></a> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">ValueError</span><span class="Other">]</span><span class="Other">,</span>
  355. <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
  356. <dd>
  357. returns an error message with text <tt class="docutils literal"><span class="pre"><span class="Identifier">msg</span></span></tt> in the same format as the other error messages
  358. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/pure/parsexml.nim#L339" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  359. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/pure/parsexml.nim#L339" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  360. </dd>
  361. </div>
  362. </div>
  363. <div id="errorMsgExpected-procs-all">
  364. <div id="errorMsgExpected,XmlParser,string">
  365. <dt><pre><span class="Keyword">proc</span> <a href="#errorMsgExpected%2CXmlParser%2Cstring"><span class="Identifier">errorMsgExpected</span></a><span class="Other">(</span><span class="Identifier">my</span><span class="Other">:</span> <a href="parsexml.html#XmlParser"><span class="Identifier">XmlParser</span></a><span class="Other">;</span> <span class="Identifier">tag</span><span class="Other">:</span> <a href="system.html#string"><span class="Identifier">string</span></a><span class="Other">)</span><span class="Other">:</span> <a href="system.html#string"><span class="Identifier">string</span></a> {.
  366. <span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">ValueError</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
  367. <dd>
  368. returns an error message &quot;&lt;tag&gt; expected&quot; in the same format as the other error messages
  369. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/pure/parsexml.nim#L333" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  370. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/pure/parsexml.nim#L333" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  371. </dd>
  372. </div>
  373. </div>
  374. <div id="getColumn-procs-all">
  375. <div id="getColumn,XmlParser">
  376. <dt><pre><span class="Keyword">proc</span> <a href="#getColumn%2CXmlParser"><span class="Identifier">getColumn</span></a><span class="Other">(</span><span class="Identifier">my</span><span class="Other">:</span> <a href="parsexml.html#XmlParser"><span class="Identifier">XmlParser</span></a><span class="Other">)</span><span class="Other">:</span> <a href="system.html#int"><span class="Identifier">int</span></a> {.<span class="Identifier">inline</span><span class="Other">,</span> <span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
  377. <dd>
  378. get the current column the parser has arrived at.
  379. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/pure/parsexml.nim#L315" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  380. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/pure/parsexml.nim#L315" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  381. </dd>
  382. </div>
  383. </div>
  384. <div id="getFilename-procs-all">
  385. <div id="getFilename,XmlParser">
  386. <dt><pre><span class="Keyword">proc</span> <a href="#getFilename%2CXmlParser"><span class="Identifier">getFilename</span></a><span class="Other">(</span><span class="Identifier">my</span><span class="Other">:</span> <a href="parsexml.html#XmlParser"><span class="Identifier">XmlParser</span></a><span class="Other">)</span><span class="Other">:</span> <a href="system.html#string"><span class="Identifier">string</span></a> {.<span class="Identifier">inline</span><span class="Other">,</span> <span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span>
  387. <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
  388. <dd>
  389. get the filename of the file that the parser processes.
  390. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/pure/parsexml.nim#L323" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  391. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/pure/parsexml.nim#L323" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  392. </dd>
  393. </div>
  394. </div>
  395. <div id="getLine-procs-all">
  396. <div id="getLine,XmlParser">
  397. <dt><pre><span class="Keyword">proc</span> <a href="#getLine%2CXmlParser"><span class="Identifier">getLine</span></a><span class="Other">(</span><span class="Identifier">my</span><span class="Other">:</span> <a href="parsexml.html#XmlParser"><span class="Identifier">XmlParser</span></a><span class="Other">)</span><span class="Other">:</span> <a href="system.html#int"><span class="Identifier">int</span></a> {.<span class="Identifier">inline</span><span class="Other">,</span> <span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
  398. <dd>
  399. get the current line the parser has arrived at.
  400. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/pure/parsexml.nim#L319" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  401. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/pure/parsexml.nim#L319" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  402. </dd>
  403. </div>
  404. </div>
  405. <div id="kind-procs-all">
  406. <div id="kind,XmlParser">
  407. <dt><pre><span class="Keyword">proc</span> <a href="#kind%2CXmlParser"><span class="Identifier">kind</span></a><span class="Other">(</span><span class="Identifier">my</span><span class="Other">:</span> <a href="parsexml.html#XmlParser"><span class="Identifier">XmlParser</span></a><span class="Other">)</span><span class="Other">:</span> <a href="parsexml.html#XmlEventKind"><span class="Identifier">XmlEventKind</span></a> {.<span class="Identifier">inline</span><span class="Other">,</span> <span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span>
  408. <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
  409. <dd>
  410. returns the current event type for the XML parser
  411. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/pure/parsexml.nim#L242" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  412. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/pure/parsexml.nim#L242" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  413. </dd>
  414. </div>
  415. </div>
  416. <div id="next-procs-all">
  417. <div id="next,XmlParser">
  418. <dt><pre><span class="Keyword">proc</span> <a href="#next%2CXmlParser"><span class="Identifier">next</span></a><span class="Other">(</span><span class="Identifier">my</span><span class="Other">:</span> <span class="Keyword">var</span> <a href="parsexml.html#XmlParser"><span class="Identifier">XmlParser</span></a><span class="Other">)</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">IOError</span><span class="Other">,</span> <span class="Identifier">OSError</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">ReadIOEffect</span><span class="Other">]</span><span class="Other">,</span>
  419. <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
  420. <dd>
  421. retrieves the first/next event. This controls the parser.
  422. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/pure/parsexml.nim#L757" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  423. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/pure/parsexml.nim#L757" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  424. </dd>
  425. </div>
  426. </div>
  427. <div id="open-procs-all">
  428. <div id="open,XmlParser,Stream,string,set[XmlParseOption]">
  429. <dt><pre><span class="Keyword">proc</span> <a href="#open%2CXmlParser%2CStream%2Cstring%2Cset%5BXmlParseOption%5D"><span class="Identifier">open</span></a><span class="Other">(</span><span class="Identifier">my</span><span class="Other">:</span> <span class="Keyword">var</span> <a href="parsexml.html#XmlParser"><span class="Identifier">XmlParser</span></a><span class="Other">;</span> <span class="Identifier">input</span><span class="Other">:</span> <a href="streams.html#Stream"><span class="Identifier">Stream</span></a><span class="Other">;</span> <span class="Identifier">filename</span><span class="Other">:</span> <a href="system.html#string"><span class="Identifier">string</span></a><span class="Other">;</span>
  430. <span class="Identifier">options</span><span class="Other">:</span> <a href="system.html#set"><span class="Identifier">set</span></a><span class="Other">[</span><a href="parsexml.html#XmlParseOption"><span class="Identifier">XmlParseOption</span></a><span class="Other">]</span> <span class="Other">=</span> <span class="Other">{</span><span class="Other">}</span><span class="Other">)</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">IOError</span><span class="Other">,</span> <span class="Identifier">OSError</span><span class="Other">]</span><span class="Other">,</span>
  431. <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">ReadIOEffect</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
  432. <dd>
  433. initializes the parser with an input stream. <tt class="docutils literal"><span class="pre"><span class="Identifier">Filename</span></span></tt> is only used for nice error messages. The parser's behaviour can be controlled by the <tt class="docutils literal"><span class="pre"><span class="Identifier">options</span></span></tt> parameter: If <tt class="docutils literal"><span class="pre"><span class="Identifier">options</span></span></tt> contains <tt class="docutils literal"><span class="pre">reportWhitespace</span></tt> a whitespace token is reported as an <tt class="docutils literal"><span class="pre">xmlWhitespace</span></tt> event. If <tt class="docutils literal"><span class="pre"><span class="Identifier">options</span></span></tt> contains <tt class="docutils literal"><span class="pre">reportComments</span></tt> a comment token is reported as an <tt class="docutils literal"><span class="pre">xmlComment</span></tt> event.
  434. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/pure/parsexml.nim#L220" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  435. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/pure/parsexml.nim#L220" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  436. </dd>
  437. </div>
  438. </div>
  439. <div id="rawData-procs-all">
  440. <div id="rawData,XmlParser">
  441. <dt><pre><span class="Keyword">proc</span> <a href="#rawData%2CXmlParser"><span class="Identifier">rawData</span></a><span class="Other">(</span><span class="Identifier">my</span><span class="Other">:</span> <span class="Keyword">var</span> <a href="parsexml.html#XmlParser"><span class="Identifier">XmlParser</span></a><span class="Other">)</span><span class="Other">:</span> <a href="system.html#lent"><span class="Identifier">lent</span></a> <a href="system.html#string"><span class="Identifier">string</span></a> {.<span class="Identifier">inline</span><span class="Other">,</span> <span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span>
  442. <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
  443. <dd>
  444. returns the underlying 'data' string by reference. This is only used for speed hacks.
  445. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/pure/parsexml.nim#L305" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  446. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/pure/parsexml.nim#L305" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  447. </dd>
  448. </div>
  449. </div>
  450. <div id="rawData2-procs-all">
  451. <div id="rawData2,XmlParser">
  452. <dt><pre><span class="Keyword">proc</span> <a href="#rawData2%2CXmlParser"><span class="Identifier">rawData2</span></a><span class="Other">(</span><span class="Identifier">my</span><span class="Other">:</span> <span class="Keyword">var</span> <a href="parsexml.html#XmlParser"><span class="Identifier">XmlParser</span></a><span class="Other">)</span><span class="Other">:</span> <a href="system.html#lent"><span class="Identifier">lent</span></a> <a href="system.html#string"><span class="Identifier">string</span></a> {.<span class="Identifier">inline</span><span class="Other">,</span> <span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span>
  453. <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
  454. <dd>
  455. returns the underlying second 'data' string by reference. This is only used for speed hacks.
  456. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/pure/parsexml.nim#L310" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  457. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/pure/parsexml.nim#L310" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  458. </dd>
  459. </div>
  460. </div>
  461. </dl>
  462. </div>
  463. <div class="section" id="18">
  464. <h1><a class="toc-backref" href="#18">Templates</a></h1>
  465. <dl class="item">
  466. <div id="attrKey-templates-all">
  467. <div id="attrKey.t,XmlParser">
  468. <dt><pre><span class="Keyword">template</span> <a href="#attrKey.t%2CXmlParser"><span class="Identifier">attrKey</span></a><span class="Other">(</span><span class="Identifier">my</span><span class="Other">:</span> <a href="parsexml.html#XmlParser"><span class="Identifier">XmlParser</span></a><span class="Other">)</span><span class="Other">:</span> <a href="system.html#string"><span class="Identifier">string</span></a></pre></dt>
  469. <dd>
  470. returns the attribute key for the event <tt class="docutils literal"><span class="pre">xmlAttribute</span></tt> Raises an assertion in debug mode if <tt class="docutils literal"><span class="pre">my.kind</span></tt> is not <tt class="docutils literal"><span class="pre">xmlAttribute</span></tt>. In release mode, this will not trigger an error but the value returned will not be valid.
  471. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/pure/parsexml.nim#L273" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  472. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/pure/parsexml.nim#L273" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  473. </dd>
  474. </div>
  475. </div>
  476. <div id="attrValue-templates-all">
  477. <div id="attrValue.t,XmlParser">
  478. <dt><pre><span class="Keyword">template</span> <a href="#attrValue.t%2CXmlParser"><span class="Identifier">attrValue</span></a><span class="Other">(</span><span class="Identifier">my</span><span class="Other">:</span> <a href="parsexml.html#XmlParser"><span class="Identifier">XmlParser</span></a><span class="Other">)</span><span class="Other">:</span> <a href="system.html#string"><span class="Identifier">string</span></a></pre></dt>
  479. <dd>
  480. returns the attribute value for the event <tt class="docutils literal"><span class="pre">xmlAttribute</span></tt> Raises an assertion in debug mode if <tt class="docutils literal"><span class="pre">my.kind</span></tt> is not <tt class="docutils literal"><span class="pre">xmlAttribute</span></tt>. In release mode, this will not trigger an error but the value returned will not be valid.
  481. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/pure/parsexml.nim#L281" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  482. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/pure/parsexml.nim#L281" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  483. </dd>
  484. </div>
  485. </div>
  486. <div id="charData-templates-all">
  487. <div id="charData.t,XmlParser">
  488. <dt><pre><span class="Keyword">template</span> <a href="#charData.t%2CXmlParser"><span class="Identifier">charData</span></a><span class="Other">(</span><span class="Identifier">my</span><span class="Other">:</span> <a href="parsexml.html#XmlParser"><span class="Identifier">XmlParser</span></a><span class="Other">)</span><span class="Other">:</span> <a href="system.html#string"><span class="Identifier">string</span></a></pre></dt>
  489. <dd>
  490. returns the character data for the events: <tt class="docutils literal"><span class="pre">xmlCharData</span></tt>, <tt class="docutils literal"><span class="pre">xmlWhitespace</span></tt>, <tt class="docutils literal"><span class="pre">xmlComment</span></tt>, <tt class="docutils literal"><span class="pre">xmlCData</span></tt>, <tt class="docutils literal"><span class="pre">xmlSpecial</span></tt> Raises an assertion in debug mode if <tt class="docutils literal"><span class="pre">my.kind</span></tt> is not one of those events. In release mode, this will not trigger an error but the value returned will not be valid.
  491. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/pure/parsexml.nim#L246" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  492. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/pure/parsexml.nim#L246" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  493. </dd>
  494. </div>
  495. </div>
  496. <div id="elementName-templates-all">
  497. <div id="elementName.t,XmlParser">
  498. <dt><pre><span class="Keyword">template</span> <a href="#elementName.t%2CXmlParser"><span class="Identifier">elementName</span></a><span class="Other">(</span><span class="Identifier">my</span><span class="Other">:</span> <a href="parsexml.html#XmlParser"><span class="Identifier">XmlParser</span></a><span class="Other">)</span><span class="Other">:</span> <a href="system.html#string"><span class="Identifier">string</span></a></pre></dt>
  499. <dd>
  500. returns the element name for the events: <tt class="docutils literal"><span class="pre">xmlElementStart</span></tt>, <tt class="docutils literal"><span class="pre">xmlElementEnd</span></tt>, <tt class="docutils literal"><span class="pre">xmlElementOpen</span></tt> Raises an assertion in debug mode if <tt class="docutils literal"><span class="pre">my.kind</span></tt> is not one of those events. In release mode, this will not trigger an error but the value returned will not be valid.
  501. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/pure/parsexml.nim#L256" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  502. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/pure/parsexml.nim#L256" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  503. </dd>
  504. </div>
  505. </div>
  506. <div id="entityName-templates-all">
  507. <div id="entityName.t,XmlParser">
  508. <dt><pre><span class="Keyword">template</span> <a href="#entityName.t%2CXmlParser"><span class="Identifier">entityName</span></a><span class="Other">(</span><span class="Identifier">my</span><span class="Other">:</span> <a href="parsexml.html#XmlParser"><span class="Identifier">XmlParser</span></a><span class="Other">)</span><span class="Other">:</span> <a href="system.html#string"><span class="Identifier">string</span></a></pre></dt>
  509. <dd>
  510. returns the entity name for the event: <tt class="docutils literal"><span class="pre">xmlEntity</span></tt> Raises an assertion in debug mode if <tt class="docutils literal"><span class="pre">my.kind</span></tt> is not <tt class="docutils literal"><span class="pre">xmlEntity</span></tt>. In release mode, this will not trigger an error but the value returned will not be valid.
  511. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/pure/parsexml.nim#L265" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  512. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/pure/parsexml.nim#L265" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  513. </dd>
  514. </div>
  515. </div>
  516. <div id="piName-templates-all">
  517. <div id="piName.t,XmlParser">
  518. <dt><pre><span class="Keyword">template</span> <a href="#piName.t%2CXmlParser"><span class="Identifier">piName</span></a><span class="Other">(</span><span class="Identifier">my</span><span class="Other">:</span> <a href="parsexml.html#XmlParser"><span class="Identifier">XmlParser</span></a><span class="Other">)</span><span class="Other">:</span> <a href="system.html#string"><span class="Identifier">string</span></a></pre></dt>
  519. <dd>
  520. returns the processing instruction name for the event <tt class="docutils literal"><span class="pre">xmlPI</span></tt> Raises an assertion in debug mode if <tt class="docutils literal"><span class="pre">my.kind</span></tt> is not <tt class="docutils literal"><span class="pre">xmlPI</span></tt>. In release mode, this will not trigger an error but the value returned will not be valid.
  521. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/pure/parsexml.nim#L289" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  522. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/pure/parsexml.nim#L289" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  523. </dd>
  524. </div>
  525. </div>
  526. <div id="piRest-templates-all">
  527. <div id="piRest.t,XmlParser">
  528. <dt><pre><span class="Keyword">template</span> <a href="#piRest.t%2CXmlParser"><span class="Identifier">piRest</span></a><span class="Other">(</span><span class="Identifier">my</span><span class="Other">:</span> <a href="parsexml.html#XmlParser"><span class="Identifier">XmlParser</span></a><span class="Other">)</span><span class="Other">:</span> <a href="system.html#string"><span class="Identifier">string</span></a></pre></dt>
  529. <dd>
  530. returns the rest of the processing instruction for the event <tt class="docutils literal"><span class="pre">xmlPI</span></tt> Raises an assertion in debug mode if <tt class="docutils literal"><span class="pre">my.kind</span></tt> is not <tt class="docutils literal"><span class="pre">xmlPI</span></tt>. In release mode, this will not trigger an error but the value returned will not be valid.
  531. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/pure/parsexml.nim#L297" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  532. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/pure/parsexml.nim#L297" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  533. </dd>
  534. </div>
  535. </div>
  536. </dl>
  537. </div>
  538. </div>
  539. </div>
  540. <div class="twelve-columns footer">
  541. <span class="nim-sprite"></span>
  542. <br>
  543. <small style="color: var(--hint);">Made with Nim. Generated: 2025-02-06 22:28:02 UTC</small>
  544. </div>
  545. </div>
  546. </div>
  547. <script defer data-domain="nim-lang.org" src="https://plausible.io/js/plausible.js"></script>
  548. </body>
  549. </html>