Questions tagged [nxml]

23 questions
46
votes
4 answers

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) XML editors. nXml mode has stood me well in the…
Mark
  • 1,409
  • 1
  • 15
  • 20
33
votes
6 answers

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
  • 3,657
  • 2
  • 27
  • 46
15
votes
1 answer

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 files, but gives no hint how to set indent to a…
nephewtom
  • 2,219
  • 17
  • 29
5
votes
2 answers

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: ... Let's say the cursor is at the . I'm looking for one shortcut that brings the cursor directly from to , and back if…
5
votes
1 answer

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. Unfortunately, pSGML has fallen into disrepair and I…
Deer Hunter
  • 161
  • 6
4
votes
1 answer

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 in a different buffer, but it didn't allow me. So…
matj1
  • 41
  • 3
4
votes
0 answers

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 document is well-formed, since I edit documents in my…
3
votes
1 answer

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 inconvenient because XML file under source control and…
gavenkoa
  • 3,352
  • 19
  • 36
3
votes
1 answer

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
  • 425
  • 3
  • 13
3
votes
0 answers

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 seemed too complex to set up for me. But it turns out…
David Ongaro
  • 370
  • 4
  • 13
2
votes
1 answer

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: Basic file formats SubRip (.srt) SubViewer (.sbv or…
Trey
  • 865
  • 5
  • 20
2
votes
0 answers

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 this link to see this text. where linktag is one of toc1, toc2, toc 3,…
YoungFrog
  • 3,496
  • 15
  • 27
1
vote
1 answer

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 . Even better: when I type $ it puts and places the cursor between the matching tag pair. I have no…
NWMT
  • 115
  • 4
1
vote
1 answer

Disable flycheck in XML files

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. If I get the chance to turn flycheck-mode off…
salotz
  • 1,370
  • 10
  • 21
1
vote
1 answer

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
  • 949
  • 7
  • 16
1
2