;ELC ;;; Compiled by jjc@pineapple.bkk.thaiopensource.com on Mon Oct 4 11:58:41 2004 ;;; from file /home/jjc/elisp/nxml-parse.el ;;; in Emacs version 21.3.1 ;;; 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 "`nxml-parse.el' was compiled for Emacs 19.29 or later")) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (byte-code "\302\303!\210\302\304!\210\302\305!\210\302\306!\210\301B\307\301!\204\310\310\207" [current-load-list nxml-parse-file-name require nxml-util xmltok nxml-enc nxml-ns boundp nil] 2) #@1618 Nil or a function to be called by `nxml-parse-file' to perform validation. The function will be called once for each start-tag or end-tag. The function is passed two arguments TEXT and START-TAG. For a start-tag, START-TAG is a list (NAME ATTRIBUTES) where NAME and ATTRIBUTES are in the same form as returned by `nxml-parse-file. For an end-tag, START-TAG is nil. TEXT is a string containing the text immediately preceding the tag, or nil if there was no such text. An empty element is treated as a start-tag followed by an end-tag. For a start-tag, the namespace state will be the state after processing the namespace declarations in the start-tag. For an end-tag, the namespace state will be the state before popping the namespace declarations for the corresponding start-tag. The function must return nil if no error is detected or a cons (MESSAGE . LOCATION) where MESSAGE is a string containing an error message and LOCATION indicates what caused the error as follows: - nil indicates the tag as whole caused it; this is always allowed; - text indicates the text caused it; this is allowed only if TEXT is non-nil; - tag-close indicates the close of the tag caused it; this is allowed only if START-TAG is non-nil; - (attribute-name . N) indicates that the name of the Nth attribute caused it; N counts from 0; this is allowed only if START-TAG is non-nil and N must be less than the number of attributes; - (attribute-value . N) indicates that the value of the Nth attribute caused it; N counts from 0; this is allowed only if START-TAG is non-nil and N must be less than the number of attributes. (defvar nxml-validate-function nil (#$ . 819)) #@1557 Parse the XML document in FILE and return it as a list. An XML element is represented as a list (NAME ATTRIBUTES . CHILDREN). NAME is either a string, in the case where the name does not have a namespace, or a cons (NAMESPACE . LOCAL-NAME), where NAMESPACE is a symbol and LOCAL-NAME is a string, in the case where the name does have a namespace. NAMESPACE is a keyword whose name is `:URI', where URI is the namespace name. ATTRIBUTES is an alist of attributes where each attribute has the form (NAME . VALUE), where NAME has the same form as an element name, and VALUE is a string. A namespace declaration is represented as an attribute whose name is (:http://www.w3.org/2000/xmlns/ . LOCAL-NAME). CHILDREN is a list containing strings and child elements; CHILDREN never contains two consecutive strings and never contains an empty string. Processing instructions and comments are not represented. The return value is a list representing the document element. If the XML document is not well-formed, an error having the condition `nxml-file-parse-error' will be signaled; the error data will be a list of the (FILE POSITION MESSAGE), where POSITION is an integer specifying the position where the error was detected, and MESSAGE is a string describing the error. The current contents of FILE will be parsed even if there is a modified buffer currently visiting FILE. If the variable `nxml-validation-function' is non-nil, it will be called twice for each element, and any reported error will be signaled in the same way as well-formedness error. (defalias 'nxml-parse-file #[(file) "\212\302!q\210\303\216\304 +\207" [file nxml-parse-file-name nxml-parse-find-file ((kill-buffer nil)) nxml-parse-instance] 2 (#$ . 2491)]) (defalias 'nxml-parse-find-file #[(file) "\212\302\303!q\210\304 \210\305\306 !\210)p)\207" [set-auto-coding-function file get-buffer-create " *nXML Parse*" erase-buffer nxml-set-xml-coding insert-file-contents] 2]) (defalias 'nxml-parse-instance #[nil "\306\306\211\211\211\211\211\211\211\211\n \f \307 \210\310 \210\311 . \207" [xmltok-dtd xmltok-errors xmltok-dependent-regions xmltok-namespace-attributes xmltok-attributes xmltok-replacement nil xmltok-forward-prolog nxml-check-xmltok-errors nxml-parse-instance-1 xmltok-name-end xmltok-name-colon xmltok-start xmltok-type nxml-ns-initial-state nxml-ns-state] 9]) (defalias 'nxml-parse-instance-1 #[nil "\306\211B\211\306\306\306\306\307 \203\337\310 \210 \311>\203\261\f\2030\312\313\f\237\" \f\306B\241\210 A \314=\204o \204F =\204F\315\306\316\"\210\317 B\320 \210\321 !\322\f !#\210\306 !\306B\241\210 A\211\nB\323!!) \324=\204\254 \325=\204\230 @\326 \232\204\230 \203\223\315\306\327 @#\210\202\230\315\306\330\"\210\322\f \306#\210\306\331 \210 A\n@\nA\306\202 \332>\203 \203\313 \204\303\"\333 \fB\202 \334=\204\315\306\335 \336\236A#\210\202A\204\351\315d\337\"\210\211#A@.\207" [top tail tail-stack open-element-tags text text-pos nil xmltok-forward nxml-check-xmltok-errors (start-tag end-tag empty-element) apply concat end-tag nxml-parse-error "Multiple top-level elements" xmltok-start-tag-qname nxml-ns-push-state nxml-parse-start-tag nxml-validate-tag last start-tag empty-element xmltok-end-tag-qname "Unbalanced end-tag; expected " "Extra end-tag" nxml-ns-pop-state (space data entity-ref char-ref cdata-section) nxml-current-text-string space "%s at top-level" ((data . "Text characters") (entity-ref . "Entity reference") (char-ref . "Character reference") (cdata-section . "CDATA section")) "Missing document element" xmltok-type tag xmltok-start x] 6]) (defalias 'nxml-parse-start-tag #[nil "\306\211\211\211\211\211\211\211\211\211\203@\307 !\206+\310\306\311\"\312 !\313 !\2059\314 !\211\f\235\203H\310\306\315\"\210\202d \204S\316\n!\210\202d\n\203_\317 \n\"\210\202d\310\306\320\"\210 \fB\321\314 !\" BBA\211\204\321\322 \211\203\227\323 !\206\231\310T\324 #\202\231\325 )\326 \" \211\203\373@\313 !\211\205\302\323 !\206\302\310 \211\327H)\324 #)\321\n\314 !\"!\330!\"\203\337\310 \211\327H)\331\"\210!\307 !\206\353\310\306\311\"B)BA\211\204\246\203\244\237. D\207" [name value ns prefix prefixes att nil xmltok-attribute-value nxml-parse-error "Invalid attribute value" nxml-make-namespace xmltok-attribute-prefix xmltok-attribute-local-name "Duplicate namespace declaration" nxml-ns-set-default nxml-ns-set-prefix "Cannot undeclare namespace prefix" nxml-make-name xmltok-start-tag-prefix nxml-ns-get-prefix "Prefix `%s' undeclared" nxml-ns-get-default xmltok-start-tag-local-name 0 assoc "Duplicate attribute" atts parsed-namespace-attributes parsed-attributes xmltok-namespace-attributes nxml-xmlns-namespace-uri xmltok-start xmltok-attributes nm] 10]) (defalias 'nxml-validate-tag #[(text text-pos tag) "\205) \n\"\306\211\205(\307\fA \205 \n#\211\204#\310\311\"\210\312 \f@\"*\207" [nxml-validate-function text tag pos err text-pos nil nxml-validate-error-position error "Incorrect return value from %s" nxml-parse-error] 5]) (defalias 'nxml-validate-error-position #[(location text-pos tag) "\204 \207\306=\203\n\207\307=\203& \205g`\f\310=\203#\311\202$\312Z\207:\205gA 8\211\204?A GZ8?\206f@\313=\203W\211\314H)\202f@\315=\205f\211\316H))\207" [location xmltok-start text-pos tag xmltok-type xmltok-attributes text tag-close empty-element 2 1 attribute-name 0 attribute-value 3 att xmltok-namespace-attributes] 4]) (defalias 'nxml-make-name #[(ns local-name) "\203 B\207 \207" [ns local-name] 2]) (defalias 'nxml-current-text-string #[nil "\303>\203 \304 `\"\207\305=\203\304 \306\\`\307Z\"\207\310>\2054\n\2043\311\312\313=\2030\314\2021\315\"\210\n\207" [xmltok-type xmltok-start xmltok-replacement (space data) buffer-substring-no-properties cdata-section 9 3 (char-ref entity-ref) nxml-parse-error nil char-ref "Reference to unsupported Unicode character" "Unresolvable entity reference"] 4]) (defalias 'nxml-parse-error #[(position &rest args) "\304 \206\n\305\306 \"#\207" [nxml-parse-file-name position xmltok-start args nxml-signal-file-parse-error apply format] 6]) (defalias 'nxml-check-xmltok-errors #[nil "\205\303!@\304\n \211\305H) \211\306H)#)\207" [xmltok-errors err nxml-parse-file-name last nxml-signal-file-parse-error 1 0] 6]) (provide 'nxml-parse)