Altova XMLSpy 2025 Enterprise Edition

YAML Text View

Home Prev Top Next

Text View provides a number of YAML editing features, from pretty-printing to document validation while editing. These features are described below.

 

Note:YAML document structure in Text View is denoted with indentation set with spaces, not tabs. In Text View, block style indentation automatically uses spaces.

 

Pretty-printing, font colors, and display

Pretty-printing formats the YAML document with hierarchical indentation (see screenshot below). You can define pretty-printing options in the Options dialog (Tools | Options | Pretty-printing). The document text is marked in different colors according to their syntax. Font colors are set in the Fonts and Colors section of the Options dialog (Tools | Options | Fonts and Colors).

XSYAMLPrettyPrint

Other useful features of the YAML Text View are (i) line numbers in the line number margin and (ii) text-folding nodes in the folding margin. The text-folding nodes can be collapsed/expanded to better navigate and view the document. Both margins (line numbers and text folding) can be set to be shown or hidden in the Text View Settings dialog (View | Text View Settings); this dialog can also be accessed via the pretty printing options.

 

Node locator expressions in YAML documents

To get the XPath/XQuery location expression of a node in the YAML document, click inside the node and then select the command Edit | Copy XPath. The XPath/XQuery expression will be copied in JSON format to the clipboard. Press Ctrl+V to paste the locator expression to any text entry field.

 

For example, the following expression locates the title of the first track of the second album of the first artist in a YAML document:

 

?Artists?1?Albums?2?Tracks?1?Title

 

For more information about XPath/XQuery expressions in JSON format, see XQuery Expressions for JSON.

 

© 2018-2024 Altova GmbH