Skip to main content
Share Your Experience: Take the 2024 Developer Survey

Questions tagged [nxml]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
46 votes
4 answers
8k views

The old "how to fold XML" question

I'm doing quite a bit of manual XML editing (the source definition of some code generation I'm doing is a custom XML format) and of course prefer to use Emacs over any special purpose (usually ugly) ...
Mark's user avatar
  • 1,449
34 votes
6 answers
23k views

How to prettify/format an XML buffer?

I have a file with xml all on one line. Does the functionality already exist to reformat this buffer to be somewhat user-readable?
wdkrnls's user avatar
  • 3,707
15 votes
1 answer
3k views

How to set indent to 4 spaces in nxml-mode?

I wanted to indent my XML files with 4 spaces. I tried to google it, and found this and this one. But they seem pretty old and/or didn't help me. This post is great about how to pretty print XML ...
nephewtom's user avatar
  • 2,261
5 votes
2 answers
1k views

One key shortcut to jump two-ways between matching opening/closing tags in nxml mode?

Context Editing an arbitrary XML file in nxml-mode. Need Let's say I have a structure like this: <a> <b>...</b> </a> Let's say the cursor is at the <a>. I'm ...
Stéphane Gourichon's user avatar
5 votes
1 answer
2k views

How do I edit an XML file in Emacs with tag autocompletion from a known XSD schema?

I'd like to use Emacs for XML editing. A long, long time ago I recall using pSGML to do that. Now that I've returned to Emacs I'd like to have tag autocompletion and easy navigation in XML files. ...
Deer Hunter's user avatar
4 votes
1 answer
1k views

How to see preview of svg file I'm editing?

I'm editing a svg file and want to see how it looks like. I tried opening a window with the same buffer and change to image-mode but it change the mode in both windows. I tried opening the same file ...
matj1's user avatar
  • 41
4 votes
0 answers
742 views

How to disable schema validation in nxml-mode but keep validation of well-formedness?

By default, nxml-mode looks at the name of the root element and decides to validate the document against some schema based on that name. I would like to disable this and just validate that the ...
Lars Haugseth's user avatar
3 votes
1 answer
95 views

Is nxml-mode vulnerable to the billion laughs attack?

I was asked this by a friend, and I couldn't find any information about whether this vulnerability exists in nxml-mode as current or not. I specifically mean this billion laughs attack.
Koz Ross's user avatar
  • 425
3 votes
1 answer
298 views

Prevent hooks from parent mode in derived mode

I have: (add-hook 'text-mode-hook 'turn-on-auto-fill) but in lisp/nxml/nxml-mode.el: (define-derived-mode nxml-mode text-mode "nXML" All XML files is opened with auto-fill-mode. That is ...
gavenkoa's user avatar
  • 3,452
3 votes
0 answers
423 views

How to validate nested xml namespaces with associated schemata in nxml?

I often use emacs to edit oozie workflow/coordinator definitions and nxml mode is pretty handy for that. I never bothered much to get more than basic xml validation since schema-based validation ...
David Ongaro's user avatar
2 votes
1 answer
208 views

Editing subtitles or closed caption files?

I'm having trouble locating any Emacs modes supporting YouTube caption/subtitles files. This YouTube help page details the list of file formats for subtitles and captioning supported by YouTube: ...
Trey's user avatar
  • 905
2 votes
0 answers
175 views

Navigating in an nXML buffer

I'm editing an XML with nXML-mode. The file represents a document and has internal links of the form: Follow <linktag docref="foo">this link</linktag> to see <anchortag docref="foo">...
YoungFrog's user avatar
  • 3,526
1 vote
1 answer
230 views

Replace a character with a string as it is typed

I would like to do the following: activate some mode so that whenener I type the $ character in my buffer, it immediately gets replaced by <m>. Even better: when I type $ it puts <m></m&...
NWMT's user avatar
  • 115
1 vote
1 answer
150 views

Disable flycheck in XML files [duplicate]

When flycheck runs when I am editing largish XML files (I believe it is just nxml mode), it tends to slow things to a crawl and then I have to kill emacs since C-g only works for a fraction of second. ...
salotz's user avatar
  • 1,410
1 vote
1 answer
53 views

Insert another XML element of the same type

In nxml-mode, I would like to insert an XML tag that has the same name as the nearest closing tag before point, without having to retype (or complete) the same tag name each time I do it.
Robin Green's user avatar
0 votes
1 answer
236 views

Keybinding/Function to Close Xml Tag

In LaTeX-mode, there is latex-close-block, bound to C-c C-e. Is there a function to programmatically close an XML tag in nXML-mode?
serv-inc's user avatar
  • 828
0 votes
1 answer
251 views

Automatically highlight elements in an XML buffer

I spend a lot of time in XML buffers using nxml-mode (Emacs 26). Out of hundreds of XML elements, I am only interested in one or two. How can I have Emacs always show the XML elements I'm interested ...
Steve HHH's user avatar
  • 755
0 votes
1 answer
190 views

Indent Continuation Lines in nxml-mode

A style guide for DocBook XML that I must adhere to states "Content within elements should be indented by two spaces if the content runs over more than one line." They give this example. <para>...
jrm's user avatar
  • 422
0 votes
1 answer
81 views

Set schema automatically after auto-insert

I have auto-insert-mode configured to insert a basic XML file in nxml-mode, but nxml-mode is then still configured to use an empty schema, as if the file was still empty. How can I automatically make ...
Robin Green's user avatar
0 votes
1 answer
147 views

What should I do to get xi:include to be recognised and my specified dtd file used?

Pretty simple xml file with: <?xml version="1.0"?> <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" "../../../../tools/docbook-dtd-4.4b2/docbookx.dtd" [ <!...
Donald Locker's user avatar
0 votes
1 answer
805 views

how to fold xml file (or specifically build.xml) [duplicate]

I am using spacemacs nXML mode to edit build.xml (java ant configuration file), the file is very long, how to fold and unfold it?
Daniel Wu's user avatar
  • 1,771
0 votes
1 answer
235 views

Using font-lock with custom faces in nXML mode

I am trying to view XML files in Emacs, but I am not seeing any font highlighting. The entire document appears as white on black (which is my default font). The following note appears on the ...
nispio's user avatar
  • 8,235
-1 votes
1 answer
85 views

How to specify the mode-name displayed in the buffer pop-up list?

I'm working on a couple of XML-format major modes, both of which are derived modes based on nXML, and I cannot get Emacs to display the mode names -- either in the minibuffer or in the buffer-list pop-...
n8willis's user avatar