summaryrefslogtreecommitdiff
path: root/man/2/xml
diff options
context:
space:
mode:
Diffstat (limited to 'man/2/xml')
-rw-r--r--man/2/xml15
1 files changed, 12 insertions, 3 deletions
diff --git a/man/2/xml b/man/2/xml
index 8387971a..0b286e49 100644
--- a/man/2/xml
+++ b/man/2/xml
@@ -11,6 +11,8 @@ Parser, Item, Location, Attributes, Mark: import xml;
init: fn(): string;
open: fn(f: string, warning: chan of (Locator, string),
preelem: string): (ref Parser, string);
+fopen: fn(iob: ref Bufio->Iobuf, f: string, warning: chan of (Locator, string),
+ preelem: string): (ref Parser, string);
Parser: adt {
fileoffset: int;
@@ -79,8 +81,15 @@ A new parser instance is created by calling
.BR open(\fIf\fP,\ \fIwarning\fP,\ \fIpreelem\fP) ,
which opens the file
.I f
-for parsing as an XML document.
-It returns a tuple, say
+for parsing as an XML document,
+or
+.BR fopen(\fIiob\fP,\ \fIname\fP,\ \fIwarning\fP,\ \fIpreelem\fP) ,
+which does the same for an already open
+.B Iobuf
+(the string
+.I name
+will be used in diagnostics).
+Both functions return a tuple
.RI ( p ,\ err ).
If there is an error opening the document,
.I p
@@ -94,7 +103,7 @@ If
is not nil, non-fatal errors encountered when parsing
will be sent on this channel - a separate process will
be needed to received them. Each error is represented
-by a tuple, say
+by a tuple
.RI ( loc ,\ msg ),
containing the location
.IR loc ,