intro.html 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194
  1. <html>
  2. <head>
  3. <title>Mini-XML Programmers Manual, Version 2.10</title>
  4. <meta name="copyright" content="Copyright 2003-2016">
  5. <meta name="author" content="Michael R Sweet">
  6. <meta name="keywords" content="XML, C, C++, library">
  7. </head>
  8. <body>
  9. <h1 align="right"><a name="INTRO"><img src="0.gif" align="right"
  10. hspace="10" width="100" height="100" alt="0"></a>Introduction</h1>
  11. <p>This programmers manual describes Mini-XML version 2.10, a small
  12. XML parsing library that you can use to read and write XML data
  13. files in your C and C++ applications.</p>
  14. <p>Mini-XML was initially developed for the <a
  15. href="http://gutenprint.sf.net/">Gutenprint</a> project to replace
  16. the rather large and unwieldy <tt>libxml2</tt> library with
  17. something substantially smaller and easier-to-use. It all began one
  18. morning in June of 2003 when Robert posted the following sentence to
  19. the developer's list:</p>
  20. <blockquote><em>It's bad enough that we require libxml2, but rolling
  21. our own XML parser is a bit more than we can handle.</em></blockquote>
  22. <p>I then replied with:</p>
  23. <blockquote><em>Given the limited scope of what you use in XML, it
  24. should be trivial to code a mini-XML API in a few hundred lines of
  25. code.</em></blockquote>
  26. <p>I took my own challenge and coded furiously for two days to
  27. produced the initial public release of Mini-XML, total lines of
  28. code: 696. Robert promptly integrated Mini-XML into Gutenprint
  29. and removed libxml2.</p>
  30. <p>Thanks to lots of feedback and support from various
  31. developers, Mini-XML has evolved since then to provide a more
  32. complete XML implementation and now stands at a whopping 3,792
  33. lines of code, compared to 140,410 lines of code for libxml2
  34. version 2.9.1.</p>
  35. <p>Aside from Gutenprint, Mini-XML is used for the
  36. following projects/software applications:</p>
  37. <ul>
  38. <li><a href="https://www.cups.org/">CUPS</a></li>
  39. <li><a
  40. href="http://zynaddsubfx.sourceforge.net">ZynAddSubFX</a></li>
  41. </ul>
  42. <p>Please file a bug on msweet.org if you would like your project added or
  43. removed from this list, or if you have any comments/quotes you would like me to
  44. publish about your experiences with Mini-XML.</p>
  45. <!-- NEED 1in -->
  46. <h2>Organization of This Document</h2>
  47. <p>This manual is organized into the following chapters and
  48. appendices:</p>
  49. <ul>
  50. <li>Chapter 1, "<a href="#INSTALL">Building,
  51. Installing, and Packaging Mini-XML</a>", provides
  52. compilation, installation, and packaging instructions for
  53. Mini-XML.</li>
  54. <li>Chapter 2, "<a href="#BASICS">Getting
  55. Started with Mini-XML</a>", shows how to use the
  56. Mini-XML library in your programs.</li>
  57. <li>Chapter 3, "<a href="#ADVANCED">More
  58. Mini-XML Programming Techniques</a>", shows additional
  59. ways to use the Mini-XML library.</li>
  60. <li>Chapter 4, "<a href="#MXMLDOC">Using the
  61. mxmldoc Utility</a>", describes how to use the
  62. <tt>mxmldoc(1)</tt> program to generate software
  63. documentation.</li>
  64. <li>Appendix A, "<a href="#LICENSE">Mini-XML License</a>",
  65. provides the terms and conditions for using and distributing
  66. Mini-XML.</li>
  67. <li>Appendix B, "<a href="#RELNOTES">Release Notes</a>",
  68. lists the changes in each release of Mini-XML.</li>
  69. <li>Appendix C, "<a href="#REFERENCE">Library
  70. Reference</a>", contains a complete reference for
  71. Mini-XML, generated by <tt>mxmldoc</tt>.</li>
  72. <li>Appendix D, "<a href="#SCHEMA">XML Schema</a>", shows
  73. the XML schema used for the XML files produced by
  74. <tt>mxmldoc</tt>.</li>
  75. </ul>
  76. <!-- NEED 10 -->
  77. <h2>Notation Conventions</h2>
  78. <p>Various font and syntax conventions are used in this guide.
  79. Examples and their meanings and uses are explained below:</p>
  80. <dl>
  81. <dt><code>mxmldoc</code><br>
  82. <code>mxmldoc(1)</code></dt>
  83. <dd>The names of commands; the first mention of a command
  84. or function in a chapter is followed by a manual page
  85. section number.<br><br></dd>
  86. <dt><var>/var</var><br>
  87. <var>/etc/hosts</var></dt>
  88. <dd>File and directory names.<br><br></dd>
  89. <dt><tt>Request ID is Printer-123</tt></dt>
  90. <dd>Screen output.<br><br></dd>
  91. <dt><kbd>lp -d printer filename ENTER</kbd></dt>
  92. <dd>Literal user input; special keys like
  93. <kbd>ENTER</kbd> are in ALL CAPS.<br><br></dd>
  94. <dt>12.3</dt>
  95. <dd>Numbers in the text are written using the period (.)
  96. to indicate the decimal point.<br><br></dd>
  97. </dl>
  98. <!-- NEED 10 -->
  99. <h2>Abbreviations</h2>
  100. <p>The following abbreviations are used throughout this
  101. manual:</p>
  102. <dl>
  103. <dt>Gb</dt>
  104. <dd>Gigabytes, or 1073741824 bytes<br><br></dd>
  105. <dt>kb</dt>
  106. <dd>Kilobytes, or 1024 bytes<br><br></dd>
  107. <dt>Mb</dt>
  108. <dd>Megabytes, or 1048576 bytes<br><br></dd>
  109. <dt>UTF-8, UTF-16</dt>
  110. <dd>Unicode Transformation Format, 8-bit or 16-bit<br><br></dd>
  111. <dt>W3C</dt>
  112. <dd>World Wide Web Consortium<br><br></dd>
  113. <dt>XML</dt>
  114. <dd>Extensible Markup Language<br><br></dd>
  115. </dl>
  116. <!-- NEED 12 -->
  117. <h2>Other References</h2>
  118. <dl>
  119. <dt>The Unicode Standard, Version 4.0, Addison-Wesley,
  120. ISBN 0-321-18578-1</dt>
  121. <dd>The definition of the Unicode character set which is
  122. used for XML.<br><br></dd>
  123. <dt><a
  124. href="http://www.w3.org/TR/2004/REC-xml-20040204/">Extensible
  125. Markup Language (XML) 1.0 (Third Edition)</a></dt>
  126. <dd>The XML specification from the World Wide Web
  127. Consortium (W3C)<br><br></dd>
  128. </dl>
  129. <!-- NEED 6 -->
  130. <h2>Legal Stuff</h2>
  131. <p>The Mini-XML library is copyright 2003-2016 by Michael R Sweet. License terms
  132. are described in <a href="#LICENSE">Appendix A - Mini-XML License</a>.</p>
  133. </body>
  134. </html>