new function cxml:parse

This commit is contained in:
dlichteblau
2007-07-07 20:47:38 +00:00
parent 190f472657
commit 95b3f65a4b
5 changed files with 83 additions and 8 deletions

View File

@ -43,17 +43,63 @@
</p>
<h3>Parsing and Validating</h3>
<div style="border: 1px dotted black;
width: 70%;
padding: 1em">
<p>
<div class="def">Function CXML:PARSE-FILE (pathname handler &amp;key ...)</div>
<div class="def">Function CXML:PARSE-STREAM (stream handler &amp;key ...)</div>
<div class="def">Function CXML:PARSE-OCTETS (octets handler &amp;key ...)</div>
<div class="def">Function CXML:PARSE-ROD (rod handler &amp;key ...)</div>
Parse an XML document.&#160;
Old-style convenience functions:
</p>
<div style="font-weight: bold">Function CXML:PARSE-FILE (pathname handler &amp;key ...)</div>
<p style="margin-left: 2em">Same as <tt>cxml:parse</tt> with a pathname argument.
(But note that <tt>cxml:parse-file</tt> interprets string
arguments as namestrings, while <tt>cxml:parse</tt> expects
literal XML documents.)
</p>
<div style="font-weight: bold">Function CXML:PARSE-STREAM (stream handler &amp;key ...)</div>
<p style="margin-left: 2em">Same as <tt>cxml:parse</tt> with a stream argument.</p>
<div style="font-weight: bold">Function CXML:PARSE-OCTETS (octets handler &amp;key ...)</div>
<p style="margin-left: 2em">Same as <tt>cxml:parse</tt> with an octet vector argument.</p>
<div style="font-weight: bold">Function CXML:PARSE-ROD (rod handler &amp;key ...)</div>
<p style="margin-left: 2em">Same as <tt>cxml:parse</tt> with a string argument.</p>
</div>
<h4>
New all-in-one parser interface:
</h4>
<div class="def">Function CXML:PARSE (input handler &amp;key ...)</div>
<p>
Parse an XML document, where input is a string, pathname, octet
vector, or stream.
Return values from this function depend on the SAX handler used.<br/>
Arguments:
</p>
<ul>
<li><tt>pathname</tt> -- a Common Lisp pathname</li>
<li>
<tt>input</tt> -- one of:<br/>
<ul>
<li>
<tt>pathname</tt> -- a Common Lisp pathname.
Open the file specified by the pathname and create a source for
the resulting stream. See below for information on how to
close the stream.
</li>
<li><tt>stream</tt> -- a Common Lisp stream with element-type
<tt>(unsigned-byte 8)</tt>. See below for information on how to
close the stream.
</li>
<li>
<tt>octets</tt> -- an <tt>(unsigned-byte 8)</tt> array.
The array is parsed directly, and interpreted according to the
encoding it specifies.
</li>
<li>
<tt>string</tt>/<tt>rod</tt> -- a rod (or <tt>string</tt> on
unicode-capable implementations).
Parses an XML document from the input string that has already
undergone external-format decoding.
</li>
</ul>
</li>
<li><tt>stream</tt> -- a Common Lisp stream with element-type
<tt>(unsigned-byte 8)</tt></li>
<li><tt>octets</tt> -- an <tt>(unsigned-byte 8)</tt> array</li>