Variable: xml-undefined-entity
xml-undefined-entity is a variable defined in xml.el.gz.
Value
"?"
Documentation
What to substitute for undefined entities.
Source Code
;; Defined in /usr/src/emacs/lisp/xml.el.gz
;;; xml.el --- XML parser -*- lexical-binding: t -*-
;; Copyright (C) 2000-2025 Free Software Foundation, Inc.
;; Author: Emmanuel Briot <briot@gnat.com>
;; Maintainer: Mark A. Hershberger <mah@everybody.org>
;; Keywords: xml, data
;; This file is part of GNU Emacs.
;; GNU Emacs is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;; GNU Emacs is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
;;; Commentary:
;; This file contains a somewhat incomplete non-validating XML parser. It
;; parses a file, and returns a list that can be used internally by
;; any other Lisp libraries.
;;; FILE FORMAT
;; The document type declaration may either be ignored or (optionally)
;; parsed, but currently the parsing will only accept element
;; declarations. The XML file is assumed to be well-formed. In case
;; of error, the parsing stops and the XML file is shown where the
;; parsing stopped.
;;
;; It also knows how to ignore comments and processing instructions.
;;
;; The XML file should have the following format:
;; <node1 attr1="name1" attr2="name2" ...>value
;; <node2 attr3="name3" attr4="name4">value2</node2>
;; <node3 attr5="name5" attr6="name6">value3</node3>
;; </node1>
;; Of course, the name of the nodes and attributes can be anything. There can
;; be any number of attributes (or none), as well as any number of children
;; below the nodes.
;;
;; There can be only top level node, but with any number of children below.
;;; LIST FORMAT
;; The functions `xml-parse-file', `xml-parse-region' and
;; `xml-parse-tag' return a list with the following format:
;;
;; xml-list ::= (node node ...)
;; node ::= (qname attribute-list . child_node_list)
;; child_node_list ::= child_node child_node ...
;; child_node ::= node | string
;; qname ::= (:namespace-uri . "name") | "name"
;; attribute_list ::= ((qname . "value") (qname . "value") ...)
;; | nil
;; string ::= "..."
;;
;; Some macros are provided to ease the parsing of this list.
;; Whitespace is preserved. Fixme: There should be a tree-walker that
;; can remove it.
;; TODO:
;; * xml:base, xml:space support
;; * more complete DOCTYPE parsing
;; * pi support
;;; Code:
;; Note that buffer-substring and match-string were formerly used in
;; several places, because the -no-properties variants remove
;; composition info. However, after some discussion on emacs-devel,
;; the consensus was that the speed of the -no-properties variants was
;; a worthwhile tradeoff especially since we're usually parsing files
;; instead of hand-crafted XML.
;;; Macros to parse the list
(defconst xml-undefined-entity "?"
"What to substitute for undefined entities.")