mirror of
https://github.com/michaelrsweet/mxml.git
synced 2024-11-24 11:25:30 +00:00
Update documentation.
This commit is contained in:
parent
e4ca6951f0
commit
b972235840
27
README.md
27
README.md
@ -21,6 +21,10 @@ Mini-XML provides the following functionality:
|
||||
Mini-XML doesn't do validation or other types of processing on the data
|
||||
based upon schema files or other sources of definition information.
|
||||
|
||||
> Note: Version 3.0 hides the definition of the `mxml_node_t` structure,
|
||||
> requiring the use of the various accessor functions that were introduced in
|
||||
> version 2.0.
|
||||
|
||||
|
||||
## Building Mini-XML
|
||||
|
||||
@ -62,19 +66,19 @@ against it.
|
||||
## Documentation
|
||||
|
||||
The documentation is available in the `doc` subdirectory in the files
|
||||
`mxml.html` (HTML) and `mxml.pdf` (PDF). You can also look at the
|
||||
`testmxml.c` and `mxmldoc.c` source files for examples of using Mini-XML.
|
||||
`mxml.html` (HTML) and `mxml.epub` (EPUB). You can also look at the
|
||||
`testmxml.c` source file for examples of using Mini-XML.
|
||||
|
||||
Mini-XML provides a single header file which you include:
|
||||
|
||||
#include <mxml.h>
|
||||
|
||||
Nodes are defined by the `mxml_node_t` structure; the `type` member defines the
|
||||
node type (`element`, `integer`, `opaque`, `real`, or `text`) which determines
|
||||
which value you want to look at in the `value` union. New nodes can be created
|
||||
using the `mxmlNewElement()`, `mxmlNewInteger()`, `mxmlNewOpaque()`,
|
||||
`mxmlNewReal()`, and `mxmlNewText()` functions. Only elements can have child
|
||||
nodes, and the top node must be an element, usually "?xml".
|
||||
Nodes (elements, comments, processing directives, integers, opaque strings, real
|
||||
numbers, and text strings) are represented by `mxml_node_t` objects. New nodes
|
||||
can be created using the `mxmlNewElement()`, `mxmlNewInteger()`,
|
||||
`mxmlNewOpaque()`, `mxmlNewReal()`, and `mxmlNewText()` functions. Only
|
||||
elements can have child nodes, and the top node must be the "?xml" processing
|
||||
directive.
|
||||
|
||||
You load an XML file using the `mxmlLoadFile()` function:
|
||||
|
||||
@ -155,7 +159,7 @@ element using an XPath:
|
||||
mxml_node_t *value = mxmlFindPath(tree, "path/to/*/foo/bar");
|
||||
|
||||
The `mxmlGetInteger()`, `mxmlGetOpaque()`, `mxmlGetReal()`, and
|
||||
`mxmlGetText()` functions retrieve the value from a node:
|
||||
`mxmlGetText()` functions retrieve the corresponding value from a node:
|
||||
|
||||
mxml_node_t *node;
|
||||
|
||||
@ -177,9 +181,8 @@ or the entire tree:
|
||||
|
||||
## Getting Help And Reporting Problems
|
||||
|
||||
The Mini-XML project page provides access to the Github issue tracking page:
|
||||
|
||||
https://www.msweet.org/mxml
|
||||
The [Mini-XML project page](https://www.msweet.org/mxml) provides access to the
|
||||
current version of this software, documentation, and Github issue tracking page.
|
||||
|
||||
|
||||
## Legal Stuff
|
||||
|
17
doc/body.md
17
doc/body.md
@ -1,8 +1,8 @@
|
||||
---
|
||||
title: Mini-XML API Reference
|
||||
title: Mini-XML 3.0 API Reference
|
||||
author: Michael R Sweet
|
||||
copyright: Copyright © 2003-2019, All Rights Reserved.
|
||||
docversion: 3.0
|
||||
version: 3.0
|
||||
...
|
||||
|
||||
# Introduction
|
||||
@ -49,18 +49,15 @@ integrated Mini-XML into Gutenprint and removed libxml2.
|
||||
|
||||
Thanks to lots of feedback and support from various developers, Mini-XML has
|
||||
evolved since then to provide a more complete XML implementation and now stands
|
||||
at a whopping 4,115 lines of code, compared to 140,410 lines of code for libxml2
|
||||
version 2.9.1.
|
||||
at a whopping 4,186 lines of code, compared to 196,141 lines of code for libxml2
|
||||
version 2.9.9.
|
||||
|
||||
|
||||
## Resources
|
||||
|
||||
The Mini-XML home page can be found at:
|
||||
|
||||
https://www.msweet.orgm/mxml
|
||||
|
||||
From here you can download the current version of Mini-XML, the issue tracker,
|
||||
and other resources.
|
||||
The Mini-XML home page can be found at <https://www.msweet.org/mxml>. From
|
||||
there you can download the current version of Mini-XML, access the issue
|
||||
tracker, and find other resources.
|
||||
|
||||
|
||||
## Legal Stuff
|
||||
|
BIN
doc/mxml.epub
BIN
doc/mxml.epub
Binary file not shown.
@ -1,12 +1,12 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Mini-XML API Reference</title>
|
||||
<title>Mini-XML 3.0 API Reference</title>
|
||||
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
|
||||
<meta name="creator" content="codedoc v3.2">
|
||||
<meta name="author" content="Michael R Sweet">
|
||||
<meta name="copyright" content="Copyright © 2003-2019, All Rights Reserved.">
|
||||
<meta name="version" content="0.0">
|
||||
<meta name="version" content="3.0">
|
||||
<style type="text/css"><!--
|
||||
body, p, h1, h2, h3, h4, h5, h6 {
|
||||
font-family: sans-serif;
|
||||
@ -160,7 +160,7 @@ h2.title, h3.title {
|
||||
<body>
|
||||
<div class="header">
|
||||
<p><img src="doc/mxml-cover.png" width="100%"></p>
|
||||
<h1 class="title">Mini-XML API Reference</h1>
|
||||
<h1 class="title">Mini-XML 3.0 API Reference</h1>
|
||||
<p>Michael R Sweet</p>
|
||||
<p>Copyright © 2003-2019, All Rights Reserved.</p>
|
||||
</div>
|
||||
@ -314,12 +314,9 @@ h2.title, h3.title {
|
||||
<p>Given the limited scope of what you use in XML, it should be trivial to code a mini-XML API in a few hundred lines of code.</p>
|
||||
</blockquote>
|
||||
<p>I took my own challenge and coded furiously for two days to produced the initial public release of Mini-XML, total lines of code: 696. Robert promptly integrated Mini-XML into Gutenprint and removed libxml2.</p>
|
||||
<p>Thanks to lots of feedback and support from various developers, Mini-XML has evolved since then to provide a more complete XML implementation and now stands at a whopping 4,115 lines of code, compared to 140,410 lines of code for libxml2 version 2.9.1.</p>
|
||||
<p>Thanks to lots of feedback and support from various developers, Mini-XML has evolved since then to provide a more complete XML implementation and now stands at a whopping 4,186 lines of code, compared to 196,141 lines of code for libxml2 version 2.9.9.</p>
|
||||
<h3 class="title" id="resources">Resources</h3>
|
||||
<p>The Mini-XML home page can be found at:</p>
|
||||
<pre><code>https://www.msweet.orgm/mxml
|
||||
</code></pre>
|
||||
<p>From here you can download the current version of Mini-XML, the issue tracker, and other resources.</p>
|
||||
<p>The Mini-XML home page can be found at <a href="https://www.msweet.org/mxml">https://www.msweet.org/mxml</a>. From there you can download the current version of Mini-XML, access the issue tracker, and find other resources.</p>
|
||||
<h3 class="title" id="legal-stuff">Legal Stuff</h3>
|
||||
<p>The Mini-XML library is copyright © 2003-2019 by Michael R Sweet and is provided under the Apache License Version 2.0 with an exception to allow linking against GPL2/LGPL2-only software. See the files "LICENSE" and "NOTICE" for more information.</p>
|
||||
<h2 class="title" id="using-mini-xml">Using Mini-XML</h2>
|
||||
|
Loading…
Reference in New Issue
Block a user