blob: 13a179e193eb76a7bde3d7e40630540293d02d66 [file] [log] [blame]
Daniel Veillard7d6fd212001-05-10 15:34:11 +00001<HTML
2><HEAD
3><TITLE
4>DOCBparser</TITLE
5><META
6NAME="GENERATOR"
7CONTENT="Modular DocBook HTML Stylesheet Version 1.44"><LINK
8REL="HOME"
9TITLE="Gnome XML Library Reference Manual"
10HREF="book1.html"><LINK
11REL="UP"
12TITLE="Libxml Library Reference"
13HREF="libxml-lib.html"><LINK
14REL="PREVIOUS"
15TITLE="catalog"
16HREF="libxml-catalog.html"><LINK
17REL="NEXT"
18TITLE="parserInternals"
19HREF="libxml-parserinternals.html"></HEAD
20><BODY
21BGCOLOR="#FFFFFF"
22TEXT="#000000"
23LINK="#0000FF"
24VLINK="#840084"
25ALINK="#0000FF"
26><DIV
27CLASS="NAVHEADER"
28><TABLE
29WIDTH="100%"
30BORDER="0"
31BGCOLOR="#000000"
32CELLPADDING="1"
33CELLSPACING="0"
34><TR
35><TH
36COLSPAN="4"
37ALIGN="center"
38><FONT
39COLOR="#FFFFFF"
40SIZE="5"
41>Gnome XML Library Reference Manual</FONT
42></TH
43></TR
44><TR
45><TD
46WIDTH="25%"
47BGCOLOR="#C00000"
48ALIGN="left"
49><A
50HREF="libxml-catalog.html"
51><FONT
52COLOR="#FFFFFF"
53SIZE="3"
54><B
55>&#60;&#60;&#60; Previous Page</B
56></FONT
57></A
58></TD
59><TD
60WIDTH="25%"
61BGCOLOR="#0000C0"
62ALIGN="center"
63><FONT
64COLOR="#FFFFFF"
65SIZE="3"
66><B
67><A
68HREF="book1.html"
69><FONT
70COLOR="#FFFFFF"
71SIZE="3"
72><B
73>Home</B
74></FONT
75></A
76></B
77></FONT
78></TD
79><TD
80WIDTH="25%"
81BGCOLOR="#00C000"
82ALIGN="center"
83><FONT
84COLOR="#FFFFFF"
85SIZE="3"
86><B
87><A
88HREF="libxml-lib.html"
89><FONT
90COLOR="#FFFFFF"
91SIZE="3"
92><B
93>Up</B
94></FONT
95></A
96></B
97></FONT
98></TD
99><TD
100WIDTH="25%"
101BGCOLOR="#C00000"
102ALIGN="right"
103><A
104HREF="libxml-parserinternals.html"
105><FONT
106COLOR="#FFFFFF"
107SIZE="3"
108><B
109>Next Page &#62;&#62;&#62;</B
110></FONT
111></A
112></TD
113></TR
114></TABLE
115></DIV
116><H1
117><A
118NAME="LIBXML-DOCBPARSER"
119>DOCBparser</A
120></H1
121><DIV
122CLASS="REFNAMEDIV"
123><A
124NAME="AEN16846"
125></A
126><H2
127>Name</H2
128>DOCBparser&nbsp;--&nbsp;</DIV
129><DIV
130CLASS="REFSYNOPSISDIV"
131><A
132NAME="AEN16849"
133></A
134><H2
135>Synopsis</H2
136><TABLE
137BORDER="0"
138BGCOLOR="#D6E8FF"
139WIDTH="100%"
140CELLPADDING="6"
141><TR
142><TD
143><PRE
144CLASS="SYNOPSIS"
145>&#13;
146
147typedef <A
148HREF="libxml-docbparser.html#DOCBPARSERCTXT"
149>docbParserCtxt</A
150>;
151typedef <A
152HREF="libxml-docbparser.html#DOCBPARSERCTXTPTR"
153>docbParserCtxtPtr</A
154>;
155typedef <A
156HREF="libxml-docbparser.html#DOCBPARSERNODEINFO"
157>docbParserNodeInfo</A
158>;
159typedef <A
160HREF="libxml-docbparser.html#DOCBSAXHANDLER"
161>docbSAXHandler</A
162>;
163typedef <A
164HREF="libxml-docbparser.html#DOCBSAXHANDLERPTR"
165>docbSAXHandlerPtr</A
166>;
167typedef <A
168HREF="libxml-docbparser.html#DOCBPARSERINPUT"
169>docbParserInput</A
170>;
171typedef <A
172HREF="libxml-docbparser.html#DOCBPARSERINPUTPTR"
173>docbParserInputPtr</A
174>;
175typedef <A
176HREF="libxml-docbparser.html#DOCBDOCPTR"
177>docbDocPtr</A
178>;
179typedef <A
180HREF="libxml-docbparser.html#DOCBNODEPTR"
181>docbNodePtr</A
182>;
183int <A
184HREF="libxml-docbparser.html#DOCBENCODEENTITIES"
185>docbEncodeEntities</A
186> (unsigned char *out,
187 int *outlen,
188 unsigned char *in,
189 int *inlen,
190 int quoteChar);
191<A
192HREF="libxml-docbparser.html#DOCBDOCPTR"
193>docbDocPtr</A
194> <A
195HREF="libxml-docbparser.html#DOCBSAXPARSEDOC"
196>docbSAXParseDoc</A
197> (<A
198HREF="libxml-tree.html#XMLCHAR"
199>xmlChar</A
200> *cur,
201 const char *encoding,
202 <A
203HREF="libxml-docbparser.html#DOCBSAXHANDLERPTR"
204>docbSAXHandlerPtr</A
205> sax,
206 void *userData);
207<A
208HREF="libxml-docbparser.html#DOCBDOCPTR"
209>docbDocPtr</A
210> <A
211HREF="libxml-docbparser.html#DOCBPARSEDOC"
212>docbParseDoc</A
213> (<A
214HREF="libxml-tree.html#XMLCHAR"
215>xmlChar</A
216> *cur,
217 const char *encoding);
218<A
219HREF="libxml-docbparser.html#DOCBDOCPTR"
220>docbDocPtr</A
221> <A
222HREF="libxml-docbparser.html#DOCBSAXPARSEFILE"
223>docbSAXParseFile</A
224> (const char *filename,
225 const char *encoding,
226 <A
227HREF="libxml-docbparser.html#DOCBSAXHANDLERPTR"
228>docbSAXHandlerPtr</A
229> sax,
230 void *userData);
231<A
232HREF="libxml-docbparser.html#DOCBDOCPTR"
233>docbDocPtr</A
234> <A
235HREF="libxml-docbparser.html#DOCBPARSEFILE"
236>docbParseFile</A
237> (const char *filename,
238 const char *encoding);
239void <A
240HREF="libxml-docbparser.html#DOCBFREEPARSERCTXT"
241>docbFreeParserCtxt</A
242> (<A
243HREF="libxml-docbparser.html#DOCBPARSERCTXTPTR"
244>docbParserCtxtPtr</A
245> ctxt);
246<A
247HREF="libxml-docbparser.html#DOCBPARSERCTXTPTR"
248>docbParserCtxtPtr</A
249> <A
250HREF="libxml-docbparser.html#DOCBCREATEPUSHPARSERCTXT"
251>docbCreatePushParserCtxt</A
252> (<A
253HREF="libxml-docbparser.html#DOCBSAXHANDLERPTR"
254>docbSAXHandlerPtr</A
255> sax,
256 void *user_data,
257 const char *chunk,
258 int size,
259 const char *filename,
260 <A
261HREF="libxml-encoding.html#XMLCHARENCODING"
262>xmlCharEncoding</A
263> enc);
264int <A
265HREF="libxml-docbparser.html#DOCBPARSECHUNK"
266>docbParseChunk</A
267> (<A
268HREF="libxml-docbparser.html#DOCBPARSERCTXTPTR"
269>docbParserCtxtPtr</A
270> ctxt,
271 const char *chunk,
272 int size,
273 int terminate);
274<A
275HREF="libxml-docbparser.html#DOCBPARSERCTXTPTR"
276>docbParserCtxtPtr</A
277> <A
278HREF="libxml-docbparser.html#DOCBCREATEFILEPARSERCTXT"
279>docbCreateFileParserCtxt</A
280> (const char *filename,
281 const char *encoding);
282int <A
283HREF="libxml-docbparser.html#DOCBPARSEDOCUMENT"
284>docbParseDocument</A
285> (<A
286HREF="libxml-docbparser.html#DOCBPARSERCTXTPTR"
287>docbParserCtxtPtr</A
288> ctxt);</PRE
289></TD
290></TR
291></TABLE
292></DIV
293><DIV
294CLASS="REFSECT1"
295><A
296NAME="AEN16886"
297></A
298><H2
299>Description</H2
300><P
301></P
302></DIV
303><DIV
304CLASS="REFSECT1"
305><A
306NAME="AEN16889"
307></A
308><H2
309>Details</H2
310><DIV
311CLASS="REFSECT2"
312><A
313NAME="AEN16891"
314></A
315><H3
316><A
317NAME="DOCBPARSERCTXT"
318></A
319>docbParserCtxt</H3
320><TABLE
321BORDER="0"
322BGCOLOR="#D6E8FF"
323WIDTH="100%"
324CELLPADDING="6"
325><TR
326><TD
327><PRE
328CLASS="PROGRAMLISTING"
329>typedef xmlParserCtxt docbParserCtxt;</PRE
330></TD
331></TR
332></TABLE
333><P
334></P
335></DIV
336><HR><DIV
337CLASS="REFSECT2"
338><A
339NAME="AEN16896"
340></A
341><H3
342><A
343NAME="DOCBPARSERCTXTPTR"
344></A
345>docbParserCtxtPtr</H3
346><TABLE
347BORDER="0"
348BGCOLOR="#D6E8FF"
349WIDTH="100%"
350CELLPADDING="6"
351><TR
352><TD
353><PRE
354CLASS="PROGRAMLISTING"
355>typedef xmlParserCtxtPtr docbParserCtxtPtr;</PRE
356></TD
357></TR
358></TABLE
359><P
360></P
361></DIV
362><HR><DIV
363CLASS="REFSECT2"
364><A
365NAME="AEN16901"
366></A
367><H3
368><A
369NAME="DOCBPARSERNODEINFO"
370></A
371>docbParserNodeInfo</H3
372><TABLE
373BORDER="0"
374BGCOLOR="#D6E8FF"
375WIDTH="100%"
376CELLPADDING="6"
377><TR
378><TD
379><PRE
380CLASS="PROGRAMLISTING"
381>typedef xmlParserNodeInfo docbParserNodeInfo;</PRE
382></TD
383></TR
384></TABLE
385><P
386></P
387></DIV
388><HR><DIV
389CLASS="REFSECT2"
390><A
391NAME="AEN16906"
392></A
393><H3
394><A
395NAME="DOCBSAXHANDLER"
396></A
397>docbSAXHandler</H3
398><TABLE
399BORDER="0"
400BGCOLOR="#D6E8FF"
401WIDTH="100%"
402CELLPADDING="6"
403><TR
404><TD
405><PRE
406CLASS="PROGRAMLISTING"
407>typedef xmlSAXHandler docbSAXHandler;</PRE
408></TD
409></TR
410></TABLE
411><P
412></P
413></DIV
414><HR><DIV
415CLASS="REFSECT2"
416><A
417NAME="AEN16911"
418></A
419><H3
420><A
421NAME="DOCBSAXHANDLERPTR"
422></A
423>docbSAXHandlerPtr</H3
424><TABLE
425BORDER="0"
426BGCOLOR="#D6E8FF"
427WIDTH="100%"
428CELLPADDING="6"
429><TR
430><TD
431><PRE
432CLASS="PROGRAMLISTING"
433>typedef xmlSAXHandlerPtr docbSAXHandlerPtr;</PRE
434></TD
435></TR
436></TABLE
437><P
438></P
439></DIV
440><HR><DIV
441CLASS="REFSECT2"
442><A
443NAME="AEN16916"
444></A
445><H3
446><A
447NAME="DOCBPARSERINPUT"
448></A
449>docbParserInput</H3
450><TABLE
451BORDER="0"
452BGCOLOR="#D6E8FF"
453WIDTH="100%"
454CELLPADDING="6"
455><TR
456><TD
457><PRE
458CLASS="PROGRAMLISTING"
459>typedef xmlParserInput docbParserInput;</PRE
460></TD
461></TR
462></TABLE
463><P
464></P
465></DIV
466><HR><DIV
467CLASS="REFSECT2"
468><A
469NAME="AEN16921"
470></A
471><H3
472><A
473NAME="DOCBPARSERINPUTPTR"
474></A
475>docbParserInputPtr</H3
476><TABLE
477BORDER="0"
478BGCOLOR="#D6E8FF"
479WIDTH="100%"
480CELLPADDING="6"
481><TR
482><TD
483><PRE
484CLASS="PROGRAMLISTING"
485>typedef xmlParserInputPtr docbParserInputPtr;</PRE
486></TD
487></TR
488></TABLE
489><P
490></P
491></DIV
492><HR><DIV
493CLASS="REFSECT2"
494><A
495NAME="AEN16926"
496></A
497><H3
498><A
499NAME="DOCBDOCPTR"
500></A
501>docbDocPtr</H3
502><TABLE
503BORDER="0"
504BGCOLOR="#D6E8FF"
505WIDTH="100%"
506CELLPADDING="6"
507><TR
508><TD
509><PRE
510CLASS="PROGRAMLISTING"
511>typedef xmlDocPtr docbDocPtr;</PRE
512></TD
513></TR
514></TABLE
515><P
516></P
517></DIV
518><HR><DIV
519CLASS="REFSECT2"
520><A
521NAME="AEN16931"
522></A
523><H3
524><A
525NAME="DOCBNODEPTR"
526></A
527>docbNodePtr</H3
528><TABLE
529BORDER="0"
530BGCOLOR="#D6E8FF"
531WIDTH="100%"
532CELLPADDING="6"
533><TR
534><TD
535><PRE
536CLASS="PROGRAMLISTING"
537>typedef xmlNodePtr docbNodePtr;</PRE
538></TD
539></TR
540></TABLE
541><P
542></P
543></DIV
544><HR><DIV
545CLASS="REFSECT2"
546><A
547NAME="AEN16936"
548></A
549><H3
550><A
551NAME="DOCBENCODEENTITIES"
552></A
553>docbEncodeEntities ()</H3
554><TABLE
555BORDER="0"
556BGCOLOR="#D6E8FF"
557WIDTH="100%"
558CELLPADDING="6"
559><TR
560><TD
561><PRE
562CLASS="PROGRAMLISTING"
563>int docbEncodeEntities (unsigned char *out,
564 int *outlen,
565 unsigned char *in,
566 int *inlen,
567 int quoteChar);</PRE
568></TD
569></TR
570></TABLE
571><P
572>Take a block of UTF-8 chars in and try to convert it to an ASCII
573plus SGML entities block of chars out.</P
574><P
575></P
576><DIV
577CLASS="INFORMALTABLE"
578><P
579></P
580><TABLE
581BORDER="0"
582WIDTH="100%"
583BGCOLOR="#FFD0D0"
584CELLSPACING="0"
585CELLPADDING="4"
586CLASS="CALSTABLE"
587><TR
588><TD
589WIDTH="20%"
590ALIGN="RIGHT"
591VALIGN="TOP"
592><TT
593CLASS="PARAMETER"
594><I
595>out</I
596></TT
597>&nbsp;:</TD
598><TD
599WIDTH="80%"
600ALIGN="LEFT"
601VALIGN="TOP"
602> a pointer to an array of bytes to store the result</TD
603></TR
604><TR
605><TD
606WIDTH="20%"
607ALIGN="RIGHT"
608VALIGN="TOP"
609><TT
610CLASS="PARAMETER"
611><I
612>outlen</I
613></TT
614>&nbsp;:</TD
615><TD
616WIDTH="80%"
617ALIGN="LEFT"
618VALIGN="TOP"
619> the length of <TT
620CLASS="PARAMETER"
621><I
622>out</I
623></TT
624></TD
625></TR
626><TR
627><TD
628WIDTH="20%"
629ALIGN="RIGHT"
630VALIGN="TOP"
631><TT
632CLASS="PARAMETER"
633><I
634>in</I
635></TT
636>&nbsp;:</TD
637><TD
638WIDTH="80%"
639ALIGN="LEFT"
640VALIGN="TOP"
641> a pointer to an array of UTF-8 chars</TD
642></TR
643><TR
644><TD
645WIDTH="20%"
646ALIGN="RIGHT"
647VALIGN="TOP"
648><TT
649CLASS="PARAMETER"
650><I
651>inlen</I
652></TT
653>&nbsp;:</TD
654><TD
655WIDTH="80%"
656ALIGN="LEFT"
657VALIGN="TOP"
658> the length of <TT
659CLASS="PARAMETER"
660><I
661>in</I
662></TT
663></TD
664></TR
665><TR
666><TD
667WIDTH="20%"
668ALIGN="RIGHT"
669VALIGN="TOP"
670><TT
671CLASS="PARAMETER"
672><I
673>quoteChar</I
674></TT
675>&nbsp;:</TD
676><TD
677WIDTH="80%"
678ALIGN="LEFT"
679VALIGN="TOP"
680> the quote character to escape (' or ") or zero.</TD
681></TR
682><TR
683><TD
684WIDTH="20%"
685ALIGN="RIGHT"
686VALIGN="TOP"
687><I
688CLASS="EMPHASIS"
689>Returns</I
690> :</TD
691><TD
692WIDTH="80%"
693ALIGN="LEFT"
694VALIGN="TOP"
695>0 if success, -2 if the transcoding fails, or -1 otherwise
696The value of <TT
697CLASS="PARAMETER"
698><I
699>inlen</I
700></TT
701> after return is the number of octets consumed
702as the return value is positive, else unpredictiable.
703The value of <TT
704CLASS="PARAMETER"
705><I
706>outlen</I
707></TT
708> after return is the number of octets consumed.</TD
709></TR
710></TABLE
711><P
712></P
713></DIV
714></DIV
715><HR><DIV
716CLASS="REFSECT2"
717><A
718NAME="AEN16975"
719></A
720><H3
721><A
722NAME="DOCBSAXPARSEDOC"
723></A
724>docbSAXParseDoc ()</H3
725><TABLE
726BORDER="0"
727BGCOLOR="#D6E8FF"
728WIDTH="100%"
729CELLPADDING="6"
730><TR
731><TD
732><PRE
733CLASS="PROGRAMLISTING"
734><A
735HREF="libxml-docbparser.html#DOCBDOCPTR"
736>docbDocPtr</A
737> docbSAXParseDoc (<A
738HREF="libxml-tree.html#XMLCHAR"
739>xmlChar</A
740> *cur,
741 const char *encoding,
742 <A
743HREF="libxml-docbparser.html#DOCBSAXHANDLERPTR"
744>docbSAXHandlerPtr</A
745> sax,
746 void *userData);</PRE
747></TD
748></TR
749></TABLE
750><P
751>parse an SGML in-memory document and build a tree.
752It use the given SAX function block to handle the parsing callback.
753If sax is NULL, fallback to the default DOM tree building routines.</P
754><P
755></P
756><DIV
757CLASS="INFORMALTABLE"
758><P
759></P
760><TABLE
761BORDER="0"
762WIDTH="100%"
763BGCOLOR="#FFD0D0"
764CELLSPACING="0"
765CELLPADDING="4"
766CLASS="CALSTABLE"
767><TR
768><TD
769WIDTH="20%"
770ALIGN="RIGHT"
771VALIGN="TOP"
772><TT
773CLASS="PARAMETER"
774><I
775>cur</I
776></TT
777>&nbsp;:</TD
778><TD
779WIDTH="80%"
780ALIGN="LEFT"
781VALIGN="TOP"
782> a pointer to an array of xmlChar</TD
783></TR
784><TR
785><TD
786WIDTH="20%"
787ALIGN="RIGHT"
788VALIGN="TOP"
789><TT
790CLASS="PARAMETER"
791><I
792>encoding</I
793></TT
794>&nbsp;:</TD
795><TD
796WIDTH="80%"
797ALIGN="LEFT"
798VALIGN="TOP"
799> a free form C string describing the SGML document encoding, or NULL</TD
800></TR
801><TR
802><TD
803WIDTH="20%"
804ALIGN="RIGHT"
805VALIGN="TOP"
806><TT
807CLASS="PARAMETER"
808><I
809>sax</I
810></TT
811>&nbsp;:</TD
812><TD
813WIDTH="80%"
814ALIGN="LEFT"
815VALIGN="TOP"
816> the SAX handler block</TD
817></TR
818><TR
819><TD
820WIDTH="20%"
821ALIGN="RIGHT"
822VALIGN="TOP"
823><TT
824CLASS="PARAMETER"
825><I
826>userData</I
827></TT
828>&nbsp;:</TD
829><TD
830WIDTH="80%"
831ALIGN="LEFT"
832VALIGN="TOP"
833> if using SAX, this pointer will be provided on callbacks. </TD
834></TR
835><TR
836><TD
837WIDTH="20%"
838ALIGN="RIGHT"
839VALIGN="TOP"
840><I
841CLASS="EMPHASIS"
842>Returns</I
843> :</TD
844><TD
845WIDTH="80%"
846ALIGN="LEFT"
847VALIGN="TOP"
848>the resulting document tree</TD
849></TR
850></TABLE
851><P
852></P
853></DIV
854></DIV
855><HR><DIV
856CLASS="REFSECT2"
857><A
858NAME="AEN17009"
859></A
860><H3
861><A
862NAME="DOCBPARSEDOC"
863></A
864>docbParseDoc ()</H3
865><TABLE
866BORDER="0"
867BGCOLOR="#D6E8FF"
868WIDTH="100%"
869CELLPADDING="6"
870><TR
871><TD
872><PRE
873CLASS="PROGRAMLISTING"
874><A
875HREF="libxml-docbparser.html#DOCBDOCPTR"
876>docbDocPtr</A
877> docbParseDoc (<A
878HREF="libxml-tree.html#XMLCHAR"
879>xmlChar</A
880> *cur,
881 const char *encoding);</PRE
882></TD
883></TR
884></TABLE
885><P
886>parse an SGML in-memory document and build a tree.</P
887><P
888></P
889><DIV
890CLASS="INFORMALTABLE"
891><P
892></P
893><TABLE
894BORDER="0"
895WIDTH="100%"
896BGCOLOR="#FFD0D0"
897CELLSPACING="0"
898CELLPADDING="4"
899CLASS="CALSTABLE"
900><TR
901><TD
902WIDTH="20%"
903ALIGN="RIGHT"
904VALIGN="TOP"
905><TT
906CLASS="PARAMETER"
907><I
908>cur</I
909></TT
910>&nbsp;:</TD
911><TD
912WIDTH="80%"
913ALIGN="LEFT"
914VALIGN="TOP"
915> a pointer to an array of xmlChar</TD
916></TR
917><TR
918><TD
919WIDTH="20%"
920ALIGN="RIGHT"
921VALIGN="TOP"
922><TT
923CLASS="PARAMETER"
924><I
925>encoding</I
926></TT
927>&nbsp;:</TD
928><TD
929WIDTH="80%"
930ALIGN="LEFT"
931VALIGN="TOP"
932> a free form C string describing the SGML document encoding, or NULL</TD
933></TR
934><TR
935><TD
936WIDTH="20%"
937ALIGN="RIGHT"
938VALIGN="TOP"
939><I
940CLASS="EMPHASIS"
941>Returns</I
942> :</TD
943><TD
944WIDTH="80%"
945ALIGN="LEFT"
946VALIGN="TOP"
947>the resulting document tree</TD
948></TR
949></TABLE
950><P
951></P
952></DIV
953></DIV
954><HR><DIV
955CLASS="REFSECT2"
956><A
957NAME="AEN17034"
958></A
959><H3
960><A
961NAME="DOCBSAXPARSEFILE"
962></A
963>docbSAXParseFile ()</H3
964><TABLE
965BORDER="0"
966BGCOLOR="#D6E8FF"
967WIDTH="100%"
968CELLPADDING="6"
969><TR
970><TD
971><PRE
972CLASS="PROGRAMLISTING"
973><A
974HREF="libxml-docbparser.html#DOCBDOCPTR"
975>docbDocPtr</A
976> docbSAXParseFile (const char *filename,
977 const char *encoding,
978 <A
979HREF="libxml-docbparser.html#DOCBSAXHANDLERPTR"
980>docbSAXHandlerPtr</A
981> sax,
982 void *userData);</PRE
983></TD
984></TR
985></TABLE
986><P
987>parse an SGML file and build a tree. Automatic support for ZLIB/Compress
988compressed document is provided by default if found at compile-time.
989It use the given SAX function block to handle the parsing callback.
990If sax is NULL, fallback to the default DOM tree building routines.</P
991><P
992></P
993><DIV
994CLASS="INFORMALTABLE"
995><P
996></P
997><TABLE
998BORDER="0"
999WIDTH="100%"
1000BGCOLOR="#FFD0D0"
1001CELLSPACING="0"
1002CELLPADDING="4"
1003CLASS="CALSTABLE"
1004><TR
1005><TD
1006WIDTH="20%"
1007ALIGN="RIGHT"
1008VALIGN="TOP"
1009><TT
1010CLASS="PARAMETER"
1011><I
1012>filename</I
1013></TT
1014>&nbsp;:</TD
1015><TD
1016WIDTH="80%"
1017ALIGN="LEFT"
1018VALIGN="TOP"
1019> the filename</TD
1020></TR
1021><TR
1022><TD
1023WIDTH="20%"
1024ALIGN="RIGHT"
1025VALIGN="TOP"
1026><TT
1027CLASS="PARAMETER"
1028><I
1029>encoding</I
1030></TT
1031>&nbsp;:</TD
1032><TD
1033WIDTH="80%"
1034ALIGN="LEFT"
1035VALIGN="TOP"
1036> a free form C string describing the SGML document encoding, or NULL</TD
1037></TR
1038><TR
1039><TD
1040WIDTH="20%"
1041ALIGN="RIGHT"
1042VALIGN="TOP"
1043><TT
1044CLASS="PARAMETER"
1045><I
1046>sax</I
1047></TT
1048>&nbsp;:</TD
1049><TD
1050WIDTH="80%"
1051ALIGN="LEFT"
1052VALIGN="TOP"
1053> the SAX handler block</TD
1054></TR
1055><TR
1056><TD
1057WIDTH="20%"
1058ALIGN="RIGHT"
1059VALIGN="TOP"
1060><TT
1061CLASS="PARAMETER"
1062><I
1063>userData</I
1064></TT
1065>&nbsp;:</TD
1066><TD
1067WIDTH="80%"
1068ALIGN="LEFT"
1069VALIGN="TOP"
1070> if using SAX, this pointer will be provided on callbacks. </TD
1071></TR
1072><TR
1073><TD
1074WIDTH="20%"
1075ALIGN="RIGHT"
1076VALIGN="TOP"
1077><I
1078CLASS="EMPHASIS"
1079>Returns</I
1080> :</TD
1081><TD
1082WIDTH="80%"
1083ALIGN="LEFT"
1084VALIGN="TOP"
1085>the resulting document tree</TD
1086></TR
1087></TABLE
1088><P
1089></P
1090></DIV
1091></DIV
1092><HR><DIV
1093CLASS="REFSECT2"
1094><A
1095NAME="AEN17067"
1096></A
1097><H3
1098><A
1099NAME="DOCBPARSEFILE"
1100></A
1101>docbParseFile ()</H3
1102><TABLE
1103BORDER="0"
1104BGCOLOR="#D6E8FF"
1105WIDTH="100%"
1106CELLPADDING="6"
1107><TR
1108><TD
1109><PRE
1110CLASS="PROGRAMLISTING"
1111><A
1112HREF="libxml-docbparser.html#DOCBDOCPTR"
1113>docbDocPtr</A
1114> docbParseFile (const char *filename,
1115 const char *encoding);</PRE
1116></TD
1117></TR
1118></TABLE
1119><P
1120>parse a Docbook SGML file and build a tree. Automatic support for
1121ZLIB/Compress compressed document is provided by default if found
1122at compile-time.</P
1123><P
1124></P
1125><DIV
1126CLASS="INFORMALTABLE"
1127><P
1128></P
1129><TABLE
1130BORDER="0"
1131WIDTH="100%"
1132BGCOLOR="#FFD0D0"
1133CELLSPACING="0"
1134CELLPADDING="4"
1135CLASS="CALSTABLE"
1136><TR
1137><TD
1138WIDTH="20%"
1139ALIGN="RIGHT"
1140VALIGN="TOP"
1141><TT
1142CLASS="PARAMETER"
1143><I
1144>filename</I
1145></TT
1146>&nbsp;:</TD
1147><TD
1148WIDTH="80%"
1149ALIGN="LEFT"
1150VALIGN="TOP"
1151> the filename</TD
1152></TR
1153><TR
1154><TD
1155WIDTH="20%"
1156ALIGN="RIGHT"
1157VALIGN="TOP"
1158><TT
1159CLASS="PARAMETER"
1160><I
1161>encoding</I
1162></TT
1163>&nbsp;:</TD
1164><TD
1165WIDTH="80%"
1166ALIGN="LEFT"
1167VALIGN="TOP"
1168> a free form C string describing document encoding, or NULL</TD
1169></TR
1170><TR
1171><TD
1172WIDTH="20%"
1173ALIGN="RIGHT"
1174VALIGN="TOP"
1175><I
1176CLASS="EMPHASIS"
1177>Returns</I
1178> :</TD
1179><TD
1180WIDTH="80%"
1181ALIGN="LEFT"
1182VALIGN="TOP"
1183>the resulting document tree</TD
1184></TR
1185></TABLE
1186><P
1187></P
1188></DIV
1189></DIV
1190><HR><DIV
1191CLASS="REFSECT2"
1192><A
1193NAME="AEN17091"
1194></A
1195><H3
1196><A
1197NAME="DOCBFREEPARSERCTXT"
1198></A
1199>docbFreeParserCtxt ()</H3
1200><TABLE
1201BORDER="0"
1202BGCOLOR="#D6E8FF"
1203WIDTH="100%"
1204CELLPADDING="6"
1205><TR
1206><TD
1207><PRE
1208CLASS="PROGRAMLISTING"
1209>void docbFreeParserCtxt (<A
1210HREF="libxml-docbparser.html#DOCBPARSERCTXTPTR"
1211>docbParserCtxtPtr</A
1212> ctxt);</PRE
1213></TD
1214></TR
1215></TABLE
1216><P
1217>Free all the memory used by a parser context. However the parsed
1218document in ctxt-&gt;myDoc is not freed.</P
1219><P
1220></P
1221><DIV
1222CLASS="INFORMALTABLE"
1223><P
1224></P
1225><TABLE
1226BORDER="0"
1227WIDTH="100%"
1228BGCOLOR="#FFD0D0"
1229CELLSPACING="0"
1230CELLPADDING="4"
1231CLASS="CALSTABLE"
1232><TR
1233><TD
1234WIDTH="20%"
1235ALIGN="RIGHT"
1236VALIGN="TOP"
1237><TT
1238CLASS="PARAMETER"
1239><I
1240>ctxt</I
1241></TT
1242>&nbsp;:</TD
1243><TD
1244WIDTH="80%"
1245ALIGN="LEFT"
1246VALIGN="TOP"
1247> an SGML parser context</TD
1248></TR
1249></TABLE
1250><P
1251></P
1252></DIV
1253></DIV
1254><HR><DIV
1255CLASS="REFSECT2"
1256><A
1257NAME="AEN17107"
1258></A
1259><H3
1260><A
1261NAME="DOCBCREATEPUSHPARSERCTXT"
1262></A
1263>docbCreatePushParserCtxt ()</H3
1264><TABLE
1265BORDER="0"
1266BGCOLOR="#D6E8FF"
1267WIDTH="100%"
1268CELLPADDING="6"
1269><TR
1270><TD
1271><PRE
1272CLASS="PROGRAMLISTING"
1273><A
1274HREF="libxml-docbparser.html#DOCBPARSERCTXTPTR"
1275>docbParserCtxtPtr</A
1276> docbCreatePushParserCtxt (<A
1277HREF="libxml-docbparser.html#DOCBSAXHANDLERPTR"
1278>docbSAXHandlerPtr</A
1279> sax,
1280 void *user_data,
1281 const char *chunk,
1282 int size,
1283 const char *filename,
1284 <A
1285HREF="libxml-encoding.html#XMLCHARENCODING"
1286>xmlCharEncoding</A
1287> enc);</PRE
1288></TD
1289></TR
1290></TABLE
1291><P
1292>Create a parser context for using the DocBook SGML parser in push mode
1293To allow content encoding detection, <TT
1294CLASS="PARAMETER"
1295><I
1296>size</I
1297></TT
1298> should be &gt;= 4
1299The value of <TT
1300CLASS="PARAMETER"
1301><I
1302>filename</I
1303></TT
1304> is used for fetching external entities
1305and error/warning reports.</P
1306><P
1307></P
1308><DIV
1309CLASS="INFORMALTABLE"
1310><P
1311></P
1312><TABLE
1313BORDER="0"
1314WIDTH="100%"
1315BGCOLOR="#FFD0D0"
1316CELLSPACING="0"
1317CELLPADDING="4"
1318CLASS="CALSTABLE"
1319><TR
1320><TD
1321WIDTH="20%"
1322ALIGN="RIGHT"
1323VALIGN="TOP"
1324><TT
1325CLASS="PARAMETER"
1326><I
1327>sax</I
1328></TT
1329>&nbsp;:</TD
1330><TD
1331WIDTH="80%"
1332ALIGN="LEFT"
1333VALIGN="TOP"
1334> a SAX handler</TD
1335></TR
1336><TR
1337><TD
1338WIDTH="20%"
1339ALIGN="RIGHT"
1340VALIGN="TOP"
1341><TT
1342CLASS="PARAMETER"
1343><I
1344>user_data</I
1345></TT
1346>&nbsp;:</TD
1347><TD
1348WIDTH="80%"
1349ALIGN="LEFT"
1350VALIGN="TOP"
1351> The user data returned on SAX callbacks</TD
1352></TR
1353><TR
1354><TD
1355WIDTH="20%"
1356ALIGN="RIGHT"
1357VALIGN="TOP"
1358><TT
1359CLASS="PARAMETER"
1360><I
1361>chunk</I
1362></TT
1363>&nbsp;:</TD
1364><TD
1365WIDTH="80%"
1366ALIGN="LEFT"
1367VALIGN="TOP"
1368> a pointer to an array of chars</TD
1369></TR
1370><TR
1371><TD
1372WIDTH="20%"
1373ALIGN="RIGHT"
1374VALIGN="TOP"
1375><TT
1376CLASS="PARAMETER"
1377><I
1378>size</I
1379></TT
1380>&nbsp;:</TD
1381><TD
1382WIDTH="80%"
1383ALIGN="LEFT"
1384VALIGN="TOP"
1385> number of chars in the array</TD
1386></TR
1387><TR
1388><TD
1389WIDTH="20%"
1390ALIGN="RIGHT"
1391VALIGN="TOP"
1392><TT
1393CLASS="PARAMETER"
1394><I
1395>filename</I
1396></TT
1397>&nbsp;:</TD
1398><TD
1399WIDTH="80%"
1400ALIGN="LEFT"
1401VALIGN="TOP"
1402> an optional file name or URI</TD
1403></TR
1404><TR
1405><TD
1406WIDTH="20%"
1407ALIGN="RIGHT"
1408VALIGN="TOP"
1409><TT
1410CLASS="PARAMETER"
1411><I
1412>enc</I
1413></TT
1414>&nbsp;:</TD
1415><TD
1416WIDTH="80%"
1417ALIGN="LEFT"
1418VALIGN="TOP"
1419> an optional encoding</TD
1420></TR
1421><TR
1422><TD
1423WIDTH="20%"
1424ALIGN="RIGHT"
1425VALIGN="TOP"
1426><I
1427CLASS="EMPHASIS"
1428>Returns</I
1429> :</TD
1430><TD
1431WIDTH="80%"
1432ALIGN="LEFT"
1433VALIGN="TOP"
1434>the new parser context or NULL</TD
1435></TR
1436></TABLE
1437><P
1438></P
1439></DIV
1440></DIV
1441><HR><DIV
1442CLASS="REFSECT2"
1443><A
1444NAME="AEN17151"
1445></A
1446><H3
1447><A
1448NAME="DOCBPARSECHUNK"
1449></A
1450>docbParseChunk ()</H3
1451><TABLE
1452BORDER="0"
1453BGCOLOR="#D6E8FF"
1454WIDTH="100%"
1455CELLPADDING="6"
1456><TR
1457><TD
1458><PRE
1459CLASS="PROGRAMLISTING"
1460>int docbParseChunk (<A
1461HREF="libxml-docbparser.html#DOCBPARSERCTXTPTR"
1462>docbParserCtxtPtr</A
1463> ctxt,
1464 const char *chunk,
1465 int size,
1466 int terminate);</PRE
1467></TD
1468></TR
1469></TABLE
1470><P
1471>Parse a Chunk of memory</P
1472><P
1473></P
1474><DIV
1475CLASS="INFORMALTABLE"
1476><P
1477></P
1478><TABLE
1479BORDER="0"
1480WIDTH="100%"
1481BGCOLOR="#FFD0D0"
1482CELLSPACING="0"
1483CELLPADDING="4"
1484CLASS="CALSTABLE"
1485><TR
1486><TD
1487WIDTH="20%"
1488ALIGN="RIGHT"
1489VALIGN="TOP"
1490><TT
1491CLASS="PARAMETER"
1492><I
1493>ctxt</I
1494></TT
1495>&nbsp;:</TD
1496><TD
1497WIDTH="80%"
1498ALIGN="LEFT"
1499VALIGN="TOP"
1500> an XML parser context</TD
1501></TR
1502><TR
1503><TD
1504WIDTH="20%"
1505ALIGN="RIGHT"
1506VALIGN="TOP"
1507><TT
1508CLASS="PARAMETER"
1509><I
1510>chunk</I
1511></TT
1512>&nbsp;:</TD
1513><TD
1514WIDTH="80%"
1515ALIGN="LEFT"
1516VALIGN="TOP"
1517> an char array</TD
1518></TR
1519><TR
1520><TD
1521WIDTH="20%"
1522ALIGN="RIGHT"
1523VALIGN="TOP"
1524><TT
1525CLASS="PARAMETER"
1526><I
1527>size</I
1528></TT
1529>&nbsp;:</TD
1530><TD
1531WIDTH="80%"
1532ALIGN="LEFT"
1533VALIGN="TOP"
1534> the size in byte of the chunk</TD
1535></TR
1536><TR
1537><TD
1538WIDTH="20%"
1539ALIGN="RIGHT"
1540VALIGN="TOP"
1541><TT
1542CLASS="PARAMETER"
1543><I
1544>terminate</I
1545></TT
1546>&nbsp;:</TD
1547><TD
1548WIDTH="80%"
1549ALIGN="LEFT"
1550VALIGN="TOP"
1551> last chunk indicator</TD
1552></TR
1553><TR
1554><TD
1555WIDTH="20%"
1556ALIGN="RIGHT"
1557VALIGN="TOP"
1558><I
1559CLASS="EMPHASIS"
1560>Returns</I
1561> :</TD
1562><TD
1563WIDTH="80%"
1564ALIGN="LEFT"
1565VALIGN="TOP"
1566>zero if no error, the xmlParserErrors otherwise.</TD
1567></TR
1568></TABLE
1569><P
1570></P
1571></DIV
1572></DIV
1573><HR><DIV
1574CLASS="REFSECT2"
1575><A
1576NAME="AEN17183"
1577></A
1578><H3
1579><A
1580NAME="DOCBCREATEFILEPARSERCTXT"
1581></A
1582>docbCreateFileParserCtxt ()</H3
1583><TABLE
1584BORDER="0"
1585BGCOLOR="#D6E8FF"
1586WIDTH="100%"
1587CELLPADDING="6"
1588><TR
1589><TD
1590><PRE
1591CLASS="PROGRAMLISTING"
1592><A
1593HREF="libxml-docbparser.html#DOCBPARSERCTXTPTR"
1594>docbParserCtxtPtr</A
1595> docbCreateFileParserCtxt (const char *filename,
1596 const char *encoding);</PRE
1597></TD
1598></TR
1599></TABLE
1600><P
1601>Create a parser context for a file content.
1602Automatic support for ZLIB/Compress compressed document is provided
1603by default if found at compile-time.</P
1604><P
1605></P
1606><DIV
1607CLASS="INFORMALTABLE"
1608><P
1609></P
1610><TABLE
1611BORDER="0"
1612WIDTH="100%"
1613BGCOLOR="#FFD0D0"
1614CELLSPACING="0"
1615CELLPADDING="4"
1616CLASS="CALSTABLE"
1617><TR
1618><TD
1619WIDTH="20%"
1620ALIGN="RIGHT"
1621VALIGN="TOP"
1622><TT
1623CLASS="PARAMETER"
1624><I
1625>filename</I
1626></TT
1627>&nbsp;:</TD
1628><TD
1629WIDTH="80%"
1630ALIGN="LEFT"
1631VALIGN="TOP"
1632> the filename</TD
1633></TR
1634><TR
1635><TD
1636WIDTH="20%"
1637ALIGN="RIGHT"
1638VALIGN="TOP"
1639><TT
1640CLASS="PARAMETER"
1641><I
1642>encoding</I
1643></TT
1644>&nbsp;:</TD
1645><TD
1646WIDTH="80%"
1647ALIGN="LEFT"
1648VALIGN="TOP"
1649> the SGML document encoding, or NULL</TD
1650></TR
1651><TR
1652><TD
1653WIDTH="20%"
1654ALIGN="RIGHT"
1655VALIGN="TOP"
1656><I
1657CLASS="EMPHASIS"
1658>Returns</I
1659> :</TD
1660><TD
1661WIDTH="80%"
1662ALIGN="LEFT"
1663VALIGN="TOP"
1664>the new parser context or NULL</TD
1665></TR
1666></TABLE
1667><P
1668></P
1669></DIV
1670></DIV
1671><HR><DIV
1672CLASS="REFSECT2"
1673><A
1674NAME="AEN17207"
1675></A
1676><H3
1677><A
1678NAME="DOCBPARSEDOCUMENT"
1679></A
1680>docbParseDocument ()</H3
1681><TABLE
1682BORDER="0"
1683BGCOLOR="#D6E8FF"
1684WIDTH="100%"
1685CELLPADDING="6"
1686><TR
1687><TD
1688><PRE
1689CLASS="PROGRAMLISTING"
1690>int docbParseDocument (<A
1691HREF="libxml-docbparser.html#DOCBPARSERCTXTPTR"
1692>docbParserCtxtPtr</A
1693> ctxt);</PRE
1694></TD
1695></TR
1696></TABLE
1697><P
1698>parse an SGML document (and build a tree if using the standard SAX
1699interface).</P
1700><P
1701></P
1702><DIV
1703CLASS="INFORMALTABLE"
1704><P
1705></P
1706><TABLE
1707BORDER="0"
1708WIDTH="100%"
1709BGCOLOR="#FFD0D0"
1710CELLSPACING="0"
1711CELLPADDING="4"
1712CLASS="CALSTABLE"
1713><TR
1714><TD
1715WIDTH="20%"
1716ALIGN="RIGHT"
1717VALIGN="TOP"
1718><TT
1719CLASS="PARAMETER"
1720><I
1721>ctxt</I
1722></TT
1723>&nbsp;:</TD
1724><TD
1725WIDTH="80%"
1726ALIGN="LEFT"
1727VALIGN="TOP"
1728> an SGML parser context</TD
1729></TR
1730><TR
1731><TD
1732WIDTH="20%"
1733ALIGN="RIGHT"
1734VALIGN="TOP"
1735><I
1736CLASS="EMPHASIS"
1737>Returns</I
1738> :</TD
1739><TD
1740WIDTH="80%"
1741ALIGN="LEFT"
1742VALIGN="TOP"
1743>0, -1 in case of error. the parser context is augmented
1744as a result of the parsing.</TD
1745></TR
1746></TABLE
1747><P
1748></P
1749></DIV
1750></DIV
1751></DIV
1752><DIV
1753CLASS="NAVFOOTER"
1754><BR
1755CLEAR="all"><BR><TABLE
1756WIDTH="100%"
1757BORDER="0"
1758BGCOLOR="#000000"
1759CELLPADDING="1"
1760CELLSPACING="0"
1761><TR
1762><TD
1763WIDTH="25%"
1764BGCOLOR="#C00000"
1765ALIGN="left"
1766><A
1767HREF="libxml-catalog.html"
1768><FONT
1769COLOR="#FFFFFF"
1770SIZE="3"
1771><B
1772>&#60;&#60;&#60; Previous Page</B
1773></FONT
1774></A
1775></TD
1776><TD
1777WIDTH="25%"
1778BGCOLOR="#0000C0"
1779ALIGN="center"
1780><FONT
1781COLOR="#FFFFFF"
1782SIZE="3"
1783><B
1784><A
1785HREF="book1.html"
1786><FONT
1787COLOR="#FFFFFF"
1788SIZE="3"
1789><B
1790>Home</B
1791></FONT
1792></A
1793></B
1794></FONT
1795></TD
1796><TD
1797WIDTH="25%"
1798BGCOLOR="#00C000"
1799ALIGN="center"
1800><FONT
1801COLOR="#FFFFFF"
1802SIZE="3"
1803><B
1804><A
1805HREF="libxml-lib.html"
1806><FONT
1807COLOR="#FFFFFF"
1808SIZE="3"
1809><B
1810>Up</B
1811></FONT
1812></A
1813></B
1814></FONT
1815></TD
1816><TD
1817WIDTH="25%"
1818BGCOLOR="#C00000"
1819ALIGN="right"
1820><A
1821HREF="libxml-parserinternals.html"
1822><FONT
1823COLOR="#FFFFFF"
1824SIZE="3"
1825><B
1826>Next Page &#62;&#62;&#62;</B
1827></FONT
1828></A
1829></TD
1830></TR
1831><TR
1832><TD
1833COLSPAN="2"
1834ALIGN="left"
1835><FONT
1836COLOR="#FFFFFF"
1837SIZE="3"
1838><B
1839>catalog</B
1840></FONT
1841></TD
1842><TD
1843COLSPAN="2"
1844ALIGN="right"
1845><FONT
1846COLOR="#FFFFFF"
1847SIZE="3"
1848><B
1849>parserInternals</B
1850></FONT
1851></TD
1852></TR
1853></TABLE
1854></DIV
1855></BODY
1856></HTML
1857>