Mercurial > emacs
annotate src/xml.c @ 110585:677b6dea1d61
gnus-sum.el (gnus-auto-center-group): Transform into a defcustom.
gnus.el (gnus-group-fast-parameter): Return the last matching parameter instead of the first matching parameter.
auth-source.el (auth-source-user-or-password): Query for password, although there are no existing auth sources.
auth-source.el (auth-source-user-or-password): Use the existing auth sources, if any, for creation.
author | Katsumi Yamaoka <yamaoka@jpl.org> |
---|---|
date | Sun, 26 Sep 2010 12:47:09 +0000 |
parents | 52590453d4f9 |
children | 49d445615c07 |
rev | line source |
---|---|
110302
fd8902911ce3
Add support for the libxml2 library.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff
changeset
|
1 /* Interface to libxml2. |
fd8902911ce3
Add support for the libxml2 library.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff
changeset
|
2 Copyright (C) 2010 Free Software Foundation, Inc. |
fd8902911ce3
Add support for the libxml2 library.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff
changeset
|
3 |
fd8902911ce3
Add support for the libxml2 library.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff
changeset
|
4 This file is part of GNU Emacs. |
fd8902911ce3
Add support for the libxml2 library.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff
changeset
|
5 |
fd8902911ce3
Add support for the libxml2 library.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff
changeset
|
6 GNU Emacs is free software: you can redistribute it and/or modify |
fd8902911ce3
Add support for the libxml2 library.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff
changeset
|
7 it under the terms of the GNU General Public License as published by |
fd8902911ce3
Add support for the libxml2 library.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff
changeset
|
8 the Free Software Foundation, either version 3 of the License, or |
fd8902911ce3
Add support for the libxml2 library.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff
changeset
|
9 (at your option) any later version. |
fd8902911ce3
Add support for the libxml2 library.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff
changeset
|
10 |
fd8902911ce3
Add support for the libxml2 library.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff
changeset
|
11 GNU Emacs is distributed in the hope that it will be useful, |
fd8902911ce3
Add support for the libxml2 library.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff
changeset
|
12 but WITHOUT ANY WARRANTY; without even the implied warranty of |
fd8902911ce3
Add support for the libxml2 library.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff
changeset
|
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
fd8902911ce3
Add support for the libxml2 library.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff
changeset
|
14 GNU General Public License for more details. |
fd8902911ce3
Add support for the libxml2 library.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff
changeset
|
15 |
fd8902911ce3
Add support for the libxml2 library.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff
changeset
|
16 You should have received a copy of the GNU General Public License |
fd8902911ce3
Add support for the libxml2 library.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff
changeset
|
17 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ |
fd8902911ce3
Add support for the libxml2 library.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff
changeset
|
18 |
fd8902911ce3
Add support for the libxml2 library.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff
changeset
|
19 #include <config.h> |
fd8902911ce3
Add support for the libxml2 library.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff
changeset
|
20 |
fd8902911ce3
Add support for the libxml2 library.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff
changeset
|
21 #ifdef HAVE_LIBXML2 |
fd8902911ce3
Add support for the libxml2 library.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff
changeset
|
22 |
fd8902911ce3
Add support for the libxml2 library.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff
changeset
|
23 #include <setjmp.h> |
fd8902911ce3
Add support for the libxml2 library.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff
changeset
|
24 #include <libxml/tree.h> |
fd8902911ce3
Add support for the libxml2 library.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff
changeset
|
25 #include <libxml/parser.h> |
fd8902911ce3
Add support for the libxml2 library.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff
changeset
|
26 #include <libxml/HTMLparser.h> |
fd8902911ce3
Add support for the libxml2 library.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff
changeset
|
27 |
fd8902911ce3
Add support for the libxml2 library.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff
changeset
|
28 #include "lisp.h" |
fd8902911ce3
Add support for the libxml2 library.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff
changeset
|
29 #include "buffer.h" |
fd8902911ce3
Add support for the libxml2 library.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff
changeset
|
30 |
fd8902911ce3
Add support for the libxml2 library.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff
changeset
|
31 Lisp_Object make_dom (xmlNode *node) |
fd8902911ce3
Add support for the libxml2 library.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff
changeset
|
32 { |
110472
52590453d4f9
Rename libxml2 functions, and make parse tree format consistent with xml.el.
Chong Yidong <cyd@stupidchicken.com>
parents:
110359
diff
changeset
|
33 if (node->type == XML_ELEMENT_NODE) |
52590453d4f9
Rename libxml2 functions, and make parse tree format consistent with xml.el.
Chong Yidong <cyd@stupidchicken.com>
parents:
110359
diff
changeset
|
34 { |
52590453d4f9
Rename libxml2 functions, and make parse tree format consistent with xml.el.
Chong Yidong <cyd@stupidchicken.com>
parents:
110359
diff
changeset
|
35 Lisp_Object result = Fcons (intern (node->name), Qnil); |
52590453d4f9
Rename libxml2 functions, and make parse tree format consistent with xml.el.
Chong Yidong <cyd@stupidchicken.com>
parents:
110359
diff
changeset
|
36 xmlNode *child; |
52590453d4f9
Rename libxml2 functions, and make parse tree format consistent with xml.el.
Chong Yidong <cyd@stupidchicken.com>
parents:
110359
diff
changeset
|
37 xmlAttr *property; |
52590453d4f9
Rename libxml2 functions, and make parse tree format consistent with xml.el.
Chong Yidong <cyd@stupidchicken.com>
parents:
110359
diff
changeset
|
38 Lisp_Object plist = Qnil; |
110302
fd8902911ce3
Add support for the libxml2 library.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff
changeset
|
39 |
110472
52590453d4f9
Rename libxml2 functions, and make parse tree format consistent with xml.el.
Chong Yidong <cyd@stupidchicken.com>
parents:
110359
diff
changeset
|
40 /* First add the attributes. */ |
52590453d4f9
Rename libxml2 functions, and make parse tree format consistent with xml.el.
Chong Yidong <cyd@stupidchicken.com>
parents:
110359
diff
changeset
|
41 property = node->properties; |
52590453d4f9
Rename libxml2 functions, and make parse tree format consistent with xml.el.
Chong Yidong <cyd@stupidchicken.com>
parents:
110359
diff
changeset
|
42 while (property != NULL) |
52590453d4f9
Rename libxml2 functions, and make parse tree format consistent with xml.el.
Chong Yidong <cyd@stupidchicken.com>
parents:
110359
diff
changeset
|
43 { |
52590453d4f9
Rename libxml2 functions, and make parse tree format consistent with xml.el.
Chong Yidong <cyd@stupidchicken.com>
parents:
110359
diff
changeset
|
44 if (property->children && |
52590453d4f9
Rename libxml2 functions, and make parse tree format consistent with xml.el.
Chong Yidong <cyd@stupidchicken.com>
parents:
110359
diff
changeset
|
45 property->children->content) |
52590453d4f9
Rename libxml2 functions, and make parse tree format consistent with xml.el.
Chong Yidong <cyd@stupidchicken.com>
parents:
110359
diff
changeset
|
46 { |
52590453d4f9
Rename libxml2 functions, and make parse tree format consistent with xml.el.
Chong Yidong <cyd@stupidchicken.com>
parents:
110359
diff
changeset
|
47 plist = Fcons (Fcons (intern (property->name), |
52590453d4f9
Rename libxml2 functions, and make parse tree format consistent with xml.el.
Chong Yidong <cyd@stupidchicken.com>
parents:
110359
diff
changeset
|
48 build_string (property->children->content)), |
52590453d4f9
Rename libxml2 functions, and make parse tree format consistent with xml.el.
Chong Yidong <cyd@stupidchicken.com>
parents:
110359
diff
changeset
|
49 plist); |
52590453d4f9
Rename libxml2 functions, and make parse tree format consistent with xml.el.
Chong Yidong <cyd@stupidchicken.com>
parents:
110359
diff
changeset
|
50 } |
52590453d4f9
Rename libxml2 functions, and make parse tree format consistent with xml.el.
Chong Yidong <cyd@stupidchicken.com>
parents:
110359
diff
changeset
|
51 property = property->next; |
52590453d4f9
Rename libxml2 functions, and make parse tree format consistent with xml.el.
Chong Yidong <cyd@stupidchicken.com>
parents:
110359
diff
changeset
|
52 } |
52590453d4f9
Rename libxml2 functions, and make parse tree format consistent with xml.el.
Chong Yidong <cyd@stupidchicken.com>
parents:
110359
diff
changeset
|
53 result = Fcons (Fnreverse (plist), result); |
52590453d4f9
Rename libxml2 functions, and make parse tree format consistent with xml.el.
Chong Yidong <cyd@stupidchicken.com>
parents:
110359
diff
changeset
|
54 |
52590453d4f9
Rename libxml2 functions, and make parse tree format consistent with xml.el.
Chong Yidong <cyd@stupidchicken.com>
parents:
110359
diff
changeset
|
55 /* Then add the children of the node. */ |
52590453d4f9
Rename libxml2 functions, and make parse tree format consistent with xml.el.
Chong Yidong <cyd@stupidchicken.com>
parents:
110359
diff
changeset
|
56 child = node->children; |
52590453d4f9
Rename libxml2 functions, and make parse tree format consistent with xml.el.
Chong Yidong <cyd@stupidchicken.com>
parents:
110359
diff
changeset
|
57 while (child != NULL) |
52590453d4f9
Rename libxml2 functions, and make parse tree format consistent with xml.el.
Chong Yidong <cyd@stupidchicken.com>
parents:
110359
diff
changeset
|
58 { |
52590453d4f9
Rename libxml2 functions, and make parse tree format consistent with xml.el.
Chong Yidong <cyd@stupidchicken.com>
parents:
110359
diff
changeset
|
59 result = Fcons (make_dom (child), result); |
52590453d4f9
Rename libxml2 functions, and make parse tree format consistent with xml.el.
Chong Yidong <cyd@stupidchicken.com>
parents:
110359
diff
changeset
|
60 child = child->next; |
52590453d4f9
Rename libxml2 functions, and make parse tree format consistent with xml.el.
Chong Yidong <cyd@stupidchicken.com>
parents:
110359
diff
changeset
|
61 } |
52590453d4f9
Rename libxml2 functions, and make parse tree format consistent with xml.el.
Chong Yidong <cyd@stupidchicken.com>
parents:
110359
diff
changeset
|
62 |
52590453d4f9
Rename libxml2 functions, and make parse tree format consistent with xml.el.
Chong Yidong <cyd@stupidchicken.com>
parents:
110359
diff
changeset
|
63 return Fnreverse (result); |
110302
fd8902911ce3
Add support for the libxml2 library.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff
changeset
|
64 } |
110472
52590453d4f9
Rename libxml2 functions, and make parse tree format consistent with xml.el.
Chong Yidong <cyd@stupidchicken.com>
parents:
110359
diff
changeset
|
65 else if (node->type == XML_TEXT_NODE) |
52590453d4f9
Rename libxml2 functions, and make parse tree format consistent with xml.el.
Chong Yidong <cyd@stupidchicken.com>
parents:
110359
diff
changeset
|
66 { |
52590453d4f9
Rename libxml2 functions, and make parse tree format consistent with xml.el.
Chong Yidong <cyd@stupidchicken.com>
parents:
110359
diff
changeset
|
67 if (node->content) |
52590453d4f9
Rename libxml2 functions, and make parse tree format consistent with xml.el.
Chong Yidong <cyd@stupidchicken.com>
parents:
110359
diff
changeset
|
68 return build_string (node->content); |
52590453d4f9
Rename libxml2 functions, and make parse tree format consistent with xml.el.
Chong Yidong <cyd@stupidchicken.com>
parents:
110359
diff
changeset
|
69 else |
52590453d4f9
Rename libxml2 functions, and make parse tree format consistent with xml.el.
Chong Yidong <cyd@stupidchicken.com>
parents:
110359
diff
changeset
|
70 return Qnil; |
110302
fd8902911ce3
Add support for the libxml2 library.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff
changeset
|
71 } |
110472
52590453d4f9
Rename libxml2 functions, and make parse tree format consistent with xml.el.
Chong Yidong <cyd@stupidchicken.com>
parents:
110359
diff
changeset
|
72 else |
110302
fd8902911ce3
Add support for the libxml2 library.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff
changeset
|
73 return Qnil; |
fd8902911ce3
Add support for the libxml2 library.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff
changeset
|
74 } |
fd8902911ce3
Add support for the libxml2 library.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff
changeset
|
75 |
fd8902911ce3
Add support for the libxml2 library.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff
changeset
|
76 static Lisp_Object |
110359
a828354ee483
* xml.c (parse_string): Renamed to parse_string(), since that's
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
110331
diff
changeset
|
77 parse_string (Lisp_Object string, Lisp_Object base_url, int htmlp) |
110302
fd8902911ce3
Add support for the libxml2 library.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff
changeset
|
78 { |
fd8902911ce3
Add support for the libxml2 library.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff
changeset
|
79 xmlDoc *doc; |
fd8902911ce3
Add support for the libxml2 library.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff
changeset
|
80 xmlNode *node; |
110359
a828354ee483
* xml.c (parse_string): Renamed to parse_string(), since that's
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
110331
diff
changeset
|
81 Lisp_Object result = Qnil; |
110302
fd8902911ce3
Add support for the libxml2 library.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff
changeset
|
82 int ibeg, iend; |
fd8902911ce3
Add support for the libxml2 library.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff
changeset
|
83 char *burl = ""; |
110303
fdcc2e819a9b
Remove some trailing white space.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
110302
diff
changeset
|
84 |
110302
fd8902911ce3
Add support for the libxml2 library.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff
changeset
|
85 LIBXML_TEST_VERSION; |
110303
fdcc2e819a9b
Remove some trailing white space.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
110302
diff
changeset
|
86 |
110302
fd8902911ce3
Add support for the libxml2 library.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff
changeset
|
87 CHECK_STRING (string); |
fd8902911ce3
Add support for the libxml2 library.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff
changeset
|
88 |
110472
52590453d4f9
Rename libxml2 functions, and make parse tree format consistent with xml.el.
Chong Yidong <cyd@stupidchicken.com>
parents:
110359
diff
changeset
|
89 if (! NILP (base_url)) |
52590453d4f9
Rename libxml2 functions, and make parse tree format consistent with xml.el.
Chong Yidong <cyd@stupidchicken.com>
parents:
110359
diff
changeset
|
90 { |
52590453d4f9
Rename libxml2 functions, and make parse tree format consistent with xml.el.
Chong Yidong <cyd@stupidchicken.com>
parents:
110359
diff
changeset
|
91 CHECK_STRING (base_url); |
52590453d4f9
Rename libxml2 functions, and make parse tree format consistent with xml.el.
Chong Yidong <cyd@stupidchicken.com>
parents:
110359
diff
changeset
|
92 burl = SDATA (base_url); |
52590453d4f9
Rename libxml2 functions, and make parse tree format consistent with xml.el.
Chong Yidong <cyd@stupidchicken.com>
parents:
110359
diff
changeset
|
93 } |
110303
fdcc2e819a9b
Remove some trailing white space.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
110302
diff
changeset
|
94 |
110472
52590453d4f9
Rename libxml2 functions, and make parse tree format consistent with xml.el.
Chong Yidong <cyd@stupidchicken.com>
parents:
110359
diff
changeset
|
95 doc = htmlp |
52590453d4f9
Rename libxml2 functions, and make parse tree format consistent with xml.el.
Chong Yidong <cyd@stupidchicken.com>
parents:
110359
diff
changeset
|
96 ? htmlReadMemory (SDATA (string), SBYTES (string), burl, "utf-8", |
52590453d4f9
Rename libxml2 functions, and make parse tree format consistent with xml.el.
Chong Yidong <cyd@stupidchicken.com>
parents:
110359
diff
changeset
|
97 HTML_PARSE_RECOVER|HTML_PARSE_NONET| |
52590453d4f9
Rename libxml2 functions, and make parse tree format consistent with xml.el.
Chong Yidong <cyd@stupidchicken.com>
parents:
110359
diff
changeset
|
98 HTML_PARSE_NOWARNING|HTML_PARSE_NOERROR) |
52590453d4f9
Rename libxml2 functions, and make parse tree format consistent with xml.el.
Chong Yidong <cyd@stupidchicken.com>
parents:
110359
diff
changeset
|
99 : xmlReadMemory (SDATA (string), SBYTES (string), burl, "utf-8", |
52590453d4f9
Rename libxml2 functions, and make parse tree format consistent with xml.el.
Chong Yidong <cyd@stupidchicken.com>
parents:
110359
diff
changeset
|
100 XML_PARSE_NONET|XML_PARSE_NOWARNING| |
52590453d4f9
Rename libxml2 functions, and make parse tree format consistent with xml.el.
Chong Yidong <cyd@stupidchicken.com>
parents:
110359
diff
changeset
|
101 XML_PARSE_NOERROR); |
110302
fd8902911ce3
Add support for the libxml2 library.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff
changeset
|
102 |
110472
52590453d4f9
Rename libxml2 functions, and make parse tree format consistent with xml.el.
Chong Yidong <cyd@stupidchicken.com>
parents:
110359
diff
changeset
|
103 if (doc != NULL) |
52590453d4f9
Rename libxml2 functions, and make parse tree format consistent with xml.el.
Chong Yidong <cyd@stupidchicken.com>
parents:
110359
diff
changeset
|
104 { |
52590453d4f9
Rename libxml2 functions, and make parse tree format consistent with xml.el.
Chong Yidong <cyd@stupidchicken.com>
parents:
110359
diff
changeset
|
105 node = xmlDocGetRootElement (doc); |
52590453d4f9
Rename libxml2 functions, and make parse tree format consistent with xml.el.
Chong Yidong <cyd@stupidchicken.com>
parents:
110359
diff
changeset
|
106 if (node != NULL) |
52590453d4f9
Rename libxml2 functions, and make parse tree format consistent with xml.el.
Chong Yidong <cyd@stupidchicken.com>
parents:
110359
diff
changeset
|
107 result = make_dom (node); |
52590453d4f9
Rename libxml2 functions, and make parse tree format consistent with xml.el.
Chong Yidong <cyd@stupidchicken.com>
parents:
110359
diff
changeset
|
108 xmlFreeDoc (doc); |
52590453d4f9
Rename libxml2 functions, and make parse tree format consistent with xml.el.
Chong Yidong <cyd@stupidchicken.com>
parents:
110359
diff
changeset
|
109 xmlCleanupParser (); |
52590453d4f9
Rename libxml2 functions, and make parse tree format consistent with xml.el.
Chong Yidong <cyd@stupidchicken.com>
parents:
110359
diff
changeset
|
110 } |
110303
fdcc2e819a9b
Remove some trailing white space.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
110302
diff
changeset
|
111 |
110302
fd8902911ce3
Add support for the libxml2 library.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff
changeset
|
112 return result; |
fd8902911ce3
Add support for the libxml2 library.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff
changeset
|
113 } |
fd8902911ce3
Add support for the libxml2 library.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff
changeset
|
114 |
110472
52590453d4f9
Rename libxml2 functions, and make parse tree format consistent with xml.el.
Chong Yidong <cyd@stupidchicken.com>
parents:
110359
diff
changeset
|
115 DEFUN ("xml-parse-html-string-internal", Fxml_parse_html_string_internal, |
52590453d4f9
Rename libxml2 functions, and make parse tree format consistent with xml.el.
Chong Yidong <cyd@stupidchicken.com>
parents:
110359
diff
changeset
|
116 Sxml_parse_html_string_internal, |
110331
7363111f3713
* xml.c (Fxml_parse_string, Fxml_parse_string): Revert last
Andreas Schwab <schwab@linux-m68k.org>
parents:
110328
diff
changeset
|
117 1, 2, 0, |
7363111f3713
* xml.c (Fxml_parse_string, Fxml_parse_string): Revert last
Andreas Schwab <schwab@linux-m68k.org>
parents:
110328
diff
changeset
|
118 doc: /* Parse STRING as an HTML document and return the parse tree. |
110472
52590453d4f9
Rename libxml2 functions, and make parse tree format consistent with xml.el.
Chong Yidong <cyd@stupidchicken.com>
parents:
110359
diff
changeset
|
119 If BASE-URL is non-nil, it is used to expand relative URLs. */) |
110331
7363111f3713
* xml.c (Fxml_parse_string, Fxml_parse_string): Revert last
Andreas Schwab <schwab@linux-m68k.org>
parents:
110328
diff
changeset
|
120 (Lisp_Object string, Lisp_Object base_url) |
110302
fd8902911ce3
Add support for the libxml2 library.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff
changeset
|
121 { |
110359
a828354ee483
* xml.c (parse_string): Renamed to parse_string(), since that's
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
110331
diff
changeset
|
122 return parse_string (string, base_url, 1); |
110302
fd8902911ce3
Add support for the libxml2 library.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff
changeset
|
123 } |
fd8902911ce3
Add support for the libxml2 library.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff
changeset
|
124 |
110472
52590453d4f9
Rename libxml2 functions, and make parse tree format consistent with xml.el.
Chong Yidong <cyd@stupidchicken.com>
parents:
110359
diff
changeset
|
125 DEFUN ("xml-parse-string-internal", Fxml_parse_string_internal, |
52590453d4f9
Rename libxml2 functions, and make parse tree format consistent with xml.el.
Chong Yidong <cyd@stupidchicken.com>
parents:
110359
diff
changeset
|
126 Sxml_parse_string_internal, |
110331
7363111f3713
* xml.c (Fxml_parse_string, Fxml_parse_string): Revert last
Andreas Schwab <schwab@linux-m68k.org>
parents:
110328
diff
changeset
|
127 1, 2, 0, |
7363111f3713
* xml.c (Fxml_parse_string, Fxml_parse_string): Revert last
Andreas Schwab <schwab@linux-m68k.org>
parents:
110328
diff
changeset
|
128 doc: /* Parse STRING as an XML document and return the parse tree. |
110472
52590453d4f9
Rename libxml2 functions, and make parse tree format consistent with xml.el.
Chong Yidong <cyd@stupidchicken.com>
parents:
110359
diff
changeset
|
129 If BASE-URL is non-nil, it is used to expand relative URLs. */) |
110331
7363111f3713
* xml.c (Fxml_parse_string, Fxml_parse_string): Revert last
Andreas Schwab <schwab@linux-m68k.org>
parents:
110328
diff
changeset
|
130 (Lisp_Object string, Lisp_Object base_url) |
110302
fd8902911ce3
Add support for the libxml2 library.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff
changeset
|
131 { |
110359
a828354ee483
* xml.c (parse_string): Renamed to parse_string(), since that's
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
110331
diff
changeset
|
132 return parse_string (string, base_url, 0); |
110302
fd8902911ce3
Add support for the libxml2 library.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff
changeset
|
133 } |
fd8902911ce3
Add support for the libxml2 library.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff
changeset
|
134 |
fd8902911ce3
Add support for the libxml2 library.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff
changeset
|
135 |
fd8902911ce3
Add support for the libxml2 library.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff
changeset
|
136 /*********************************************************************** |
fd8902911ce3
Add support for the libxml2 library.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff
changeset
|
137 Initialization |
fd8902911ce3
Add support for the libxml2 library.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff
changeset
|
138 ***********************************************************************/ |
fd8902911ce3
Add support for the libxml2 library.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff
changeset
|
139 void |
fd8902911ce3
Add support for the libxml2 library.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff
changeset
|
140 syms_of_xml (void) |
fd8902911ce3
Add support for the libxml2 library.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff
changeset
|
141 { |
110472
52590453d4f9
Rename libxml2 functions, and make parse tree format consistent with xml.el.
Chong Yidong <cyd@stupidchicken.com>
parents:
110359
diff
changeset
|
142 defsubr (&Sxml_parse_html_string_internal); |
52590453d4f9
Rename libxml2 functions, and make parse tree format consistent with xml.el.
Chong Yidong <cyd@stupidchicken.com>
parents:
110359
diff
changeset
|
143 defsubr (&Sxml_parse_string_internal); |
110302
fd8902911ce3
Add support for the libxml2 library.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff
changeset
|
144 } |
fd8902911ce3
Add support for the libxml2 library.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff
changeset
|
145 |
fd8902911ce3
Add support for the libxml2 library.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff
changeset
|
146 #endif /* HAVE_LIBXML2 */ |