Книга: Learning GNU Emacs, 3rd Edition
8.4.1 Writing XML with SGML Mode
8.4.1 Writing XML with SGML Mode
Emacs's own SGML mode provides support for entering tags. We covered much of this earlier under HTML mode, so we provide just one brief example here. Inserting, hiding, and showing tags are especially helpful features provided by SGML mode.
Let's look at a chapter on enumerated types by Java in a Nutshell author David Flanagan. This chapter uses the DocBook DTD.
Initial state:
Editing a document that uses the DocBook DTD (Mac OS X).
Note that Emacs displays XML on the mode line. XML mode in this context is a subset of SGML mode. Actually, despite this name, all the commands in this mode start with sgml, not xml. The menu of relevant commands is called SGML as well. Emacs doesn't pretend to have extensive XML support.
We want to insert a paragraph before the first paragraph.
Add a blank line following the title and type: C-c C-t
Emacs inserts an open angle bracket and prompts for the tag name (Mac OS X).
Type: para Enter
Emacs inserts opening and closing paragraph tags (Mac OS X).
Note that Emacs is not following our indentation style. We can correct it by moving to the beginning of the line and pressing Tab. See Table 8-4 earlier in this chapter for details on SGML mode commands.
- 8.4 Writing XML
- Тестирование Web-сервиса XML с помощью WebDev.WebServer.exe
- Преобразование XML в реляционную базу данных
- Using Double Quotes to Resolve Variables in Strings with Embedded Spaces
- Drawbacks with restore
- 7. AGGREGATION WITH INDEPENDENT WORKS
- Конструкция with-do
- 1.1.4. Model Explorer - навигатор модели
- XMLHttpRequest
- 3. Hexadecimal – the way we communicate with micros
- CHAPTER 3 Working with GNOME
- CHAPTER 8 Printing with Fedora