;ELC ;;; Compiled by pot@pot.cnuce.cnr.it on Tue Mar 18 15:53:33 2003 ;;; from file /home/pot/gnu/emacs-pretest.new/lisp/xml.el ;;; in Emacs version 21.3 ;;; with bytecomp version 2.85.4.1 ;;; with all optimizations. ;;; This file uses dynamic docstrings, first added in Emacs 19.29. (if (and (boundp 'emacs-version) (< (aref emacs-version (1- (length emacs-version))) ?A) (or (and (boundp 'epoch::version) epoch::version) (string-lessp emacs-version "19.29"))) (error "`xml.el' was compiled for Emacs 19.29 or later")) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; #@70 Return the tag associated with NODE. The tag is a lower-case symbol. (defalias 'xml-node-name '(macro . #[(node) "\301D\207" [node car] 2 (#$ . 608)])) #@61 Return the list of attributes of NODE. The list can be nil. (defalias 'xml-node-attributes '(macro . #[(node) "\301\302E\207" [node nth 1] 3 (#$ . 767)])) #@82 Return the list of children of NODE. This is a list of nodes, and it can be nil. (defalias 'xml-node-children '(macro . #[(node) "\301D\207" [node cddr] 2 (#$ . 929)])) #@96 Return the children of NODE whose tag is CHILD-NAME. CHILD-NAME should be a lower case symbol. (defalias 'xml-get-children #[(node child-name) "\211AA)\305 \203+ @\203# @@\f\232\203#\302\306\n @C\"L\210\303 AL\210\202 \n*\207" [node x match children child-name nil append] 5 (#$ . 1105)]) #@99 Get from NODE the value of ATTRIBUTE. An empty string is returned if the attribute was not found. (defalias 'xml-get-attribute #[(node attribute) "A@\203\303 A@\"\211\203\nA\202\304)\207\304\207" [node attribute value assoc ""] 4 (#$ . 1408)]) #@201 Parse the well-formed XML FILE. If FILE is already edited, this will keep the buffer alive. Returns the top node with all its children. If PARSE-DTD is non-nil, the DTD is parsed rather than skipped. (defalias 'xml-parse-file #[(file &optional parse-dtd) "\304\305 !\203\305 !q\210`\202\306 !\210\307edp\n$\203'b\210\202+\310p!\210 *\207" [keep file parse-dtd xml nil get-file-buffer find-file xml-parse-region kill-buffer] 5 (#$ . 1668)]) #@309 Parse the region from BEG to END in BUFFER. If BUFFER is nil, it defaults to the current buffer. Returns the XML list for the region, or raises an error if the region is not a well-formed XML file. If PARSE-DTD is non-nil, the DTD is parsed rather than skipped, and returned as the first element of the list (defalias 'xml-parse-region #[(beg end &optional buffer parse-dtd) "\306\211\211\212 \203 q\210\fb\210` W\203W\307\310 \311#\203Q\312u\210\n\204J\301\313 \"L\210 @<\203B\300 @L\210\314\302 A\"\210\202\314\302 \"\210\202\315\316!\210\202 b\210\202\203d\317\n!B\202g\317\n!,\207" [dtd result xml buffer beg end nil search-forward "<" t -1 xml-parse-tag add-to-list error "XML files can have only one toplevel tag" reverse parse-dtd] 4 (#$ . 2126)]) #@403 Parse the tag that is just in front of point. The end tag must be found before the position END in the current buffer. If PARSE-DTD is non-nil, the DTD of the document, if any, is parsed and returned as the first element in the list. Returns one of: - a list : the matching node - nil : the point is not looking at a tag. - a cons cell: the first element is the DTD, the second is the node (defalias 'xml-parse-tag #[(end &optional parse-dtd) "\306\307!\203\310\311\"\210\312\313w\210\314!\207\306\315!\203/\316\225\310\317\320#\204(\321\322!\210\323 \316\224\")\207\306\324!\203]\313 \203D\302\325!L\210\202H\326!\210\312\313w\210\n\203X\n\314!B\202[\314!)\207\306\327!\203p\310\330\"\210\312\313w\210\314!\207\306\331!\203x\313\207\306\332!\203+\333\334!\335\f!C\313/\313\334\225b\210\305\336 \337!C\"L\210\306\340!\203\256\341u\210\312\313w\210\336 \342\"\202)\313f\343=\203&\334u\210\312\313w\210\306\331\f\344Q!\204\306\331!\203\330\321\345\f\346\347`!R!\210\202\274\313f\350U\203\354\305\336 \314!C\"L\210\202\274\301`L\210\310\351\"\210\352u\210\323 `\"\3160\305\336 \3530!C\"L\210*\202\274\316\225b\210\312\313w\210`V\203\"\321\354\f\"\210 \202)\321\355!,\207\321\356!\207" [end pos dtd parse-dtd node-name children looking-at "<\\?" search-forward "?>" " \n" nil xml-parse-tag "" t error "CDATA section does not end anywhere in the document" buffer-substring-no-properties "" " \n]+\\)" match-string 1 intern append xml-parse-attlist "/>" 2 ("") 62 "[ \n]*>" "XML: invalid syntax -- invalid end tag (expecting " ") at pos " number-to-string 60 "<" -1 xml-substitute-special "XML: End tag for %s not found before end of region" "XML: Invalid attribute list" "XML: Invalid character" case-fold-search string] 6 (#$ . 2912)]) #@191 Return the attribute-list that point is looking at. The search for attributes end at the position END in the current buffer. Leaves the point on the first non-blank character after the tag. (defalias 'xml-parse-attlist #[(end) "\303\211\304\303w\210\305\306!\203V\300\307\310\311!!L\210\312\225b\210\305\313!\204*\305\314!\204*\315\316!\210\317 \"\2035\315\320!\210\301\321 \322\311!BC\"L\210\312\225b\210\304\303w\210`\nV\203\315\323!\210\202 *\207" [name attlist end nil " \n" looking-at "\\([a-zA-Z_:][-a-zA-Z0-9._:]*\\)[ \n]*=[ \n]*" intern match-string 1 0 "\"\\([^\"]+\\)\"" "'\\([^']+\\)'" error "XML: Attribute values must be given between quotes" assoc "XML: each attribute must be unique within an element" append match-string-no-properties "XML: end of attribute list not found before end of region"] 6 (#$ . 4795)]) #@217 Skip the DTD that point is looking at. The DTD must end before the position END in the current buffer. The point must be just before the starting tag of the DTD. This follows the rule [28] in the XML specifications. (defalias 'xml-skip-dtd #[(end) "\300Gu\210\301\302!\203\303\304!\210\305\306\307\217\207" ["" error "XML: invalid DTD (excepting name of the document)" nil (byte-code "\301v\210\302\303w\210\304\305!\203\306\307\"\207\310\311\"\207" [end 1 " \n" nil looking-at "\\[" re-search-forward "\\][ \n]*>" search-forward ">"] 3) ((error (error "XML: No end to the DTD")))] 3 (#$ . 5645)]) #@105 Parse the DTD that point is looking at. The DTD must end before the position END in the current buffer. (defalias 'xml-parse-dtd #[(end) "\305\211\211\211\306Gu\210\307\305w\210\310\311!\203\312\313!\210\310\314!\210\303\211\315\316!DL\210\316\225b\210\307\305w\210\310\317!\2038\312\320!\210\305f\321U\204C\312\322!\210\323u\210\310\324!\204\306`\fX\203\306\310\325!\203\277\326\315\323!!\315\327!\300\316\225L\210\330\331\n\"\203u\302\332L\210\202\241\330\333\n\"\203\203\302\334L\210\202\241\330\335\n\"\203\226\302\336\315\323\n\"!L\210\202\241\330\337\n\"\204\241\312\340!\210\341 \"\203\257\312\342\343 !\"\210\303\344 \nDC\"L\210b\210\202F\312\345!\210\202F\346\311\f\"\210 ,\207" [end-pos element type dtd end nil "" error "XML: invalid DTD (excepting name of the document)" "\\sw+" match-string-no-properties 0 "SYSTEM" "XML: Don't know how to handle external DTDs" 91 "XML: Unknown declaration in the DTD" 1 "[ \n]*\\]" "[ \n]*]+\\)>" intern 2 string-match "^EMPTY[ \n]*$" empty "^ANY[ \n]*$" any "^(\\(.*\\))[ \n]*$" xml-parse-elem-type "^%[^;]+;[ \n]*$" "XML: Invalid element type in the DTD" assoc "XML: elements declaration must be unique in a DTD (<%s>)" symbol-name append "XML: Invalid DTD item" search-forward] 5 (#$ . 6289)]) #@63 Convert a STRING for an element type into an elisp structure. (defalias 'xml-parse-elem-type #[(string) "\303\211\304\305\n\"\203C\306\307\n\"\306\310\n\"\304\311 \"\203,\301\312\313\314\315\316 \311\"\"\"L\210\202T\304\317 \"\203T\301\312\320\314\315\316 \317\"\"\"L\210\202T\304\321\n\"\203T\306\307\n\"\306\310\n\" ;\203c \322\230\203c\301\323L\210\324\230\203o\325 D\202\210\326\230\203{\327 D\202\210\330\230\203\207\331 D\202\210 *\207" [modifier elem string nil string-match "(\\([^)]+\\))\\([+*?]?\\)" match-string 1 2 "|" append (choice) mapcar xml-parse-elem-type split-string "," (seq) "[ \n]*\\([^+*?]+\\)\\([+*?]?\\)" "#PCDATA" pcdata "+" + "*" * "?" 32] 8 (#$ . 7653)]) #@57 Return STRING, after subsituting special XML sequences. (defalias 'xml-substitute-special #[(string) "\301\302\"\203\300\303\304\305\306$L\210\202\301\307\"\203&\300\303\310\305\306$L\210\202\301\311\"\2039\300\303\312\305\306$L\210\202&\301\313\"\203L\300\303\314\305\306$L\210\2029\301\315\"\203_\300\303\316\305\306$L\210\202L\207" [string string-match "&" replace-match "&" t nil "<" "<" ">" ">" "'" "'" """ "\""] 6 (#$ . 8367)]) (defalias 'xml-debug-print #[(xml) "\205\301@\302\"\210\300AL\210\202\207" [xml xml-debug-print-internal ""] 3]) #@89 Outputs the XML tree in the current buffer. The first line indented with INDENT-STRING. (defalias 'xml-debug-print-internal #[(xml &optional indent-string) "\305 \204\f\303\306L\210 \307\310\n@!\261\210\301\nA@L\210 \203=\311c\210\310 \211@@)!\312 \211@A)\313\261\210\301 AL\210\202\314c\210\302\n\211AA)L\210\n\203z\n@<\203a\315c\210\316\n@ \317P\"\210\202r\n@;\203n\n@c\210\202r\320\321!\210\302\nAL\210\202I\315 \322\310@!\314\261*\207" [xml attlist tree indent-string x nil "" "<" symbol-name " " "=\"" "\"" ">" "\n" xml-debug-print-internal " " error "Invalid XML tree" "