Use XML instead of YAML

Created on 22 April 2019, almost 6 years ago
Updated 25 February 2025, about 1 month ago

Problem/Motivation

YAML is not a great format for a large number of arrays, which is what field data is, which is what makes up what conent entities are. Also, it's not very good at handling large blobs of HTML with line breaks, etc. For these reasons, YAML can be really difficult to read or make sense of when something goes wrong.

Proposed resolution

While XML might seem antiquated XML, it is well suited for large sets of arrays and large HTML blobs can be escaped with CDATA. Drupal already provides the mechanism to serialize/unserialize entities to/from XML.

Remaining tasks

  1. Come to a consensus
  2. Write Tests
  3. Write Patch

User interface changes

None

API changes

Exported content will be in XML format instead of YAML

Data model changes

None

Release notes snippet

TBD

๐Ÿ“Œ Task
Status

Active

Version

2.0

Component

Code

Created by

๐Ÿ‡บ๐Ÿ‡ธUnited States davidwbarratt

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • ๐Ÿ‡จ๐Ÿ‡ฆCanada ergonlogic Montrรฉal, Quรฉbec ๐Ÿ‡จ๐Ÿ‡ฆ

    Just FYI, in my experience SimpleXML uses significantly less memory when manipulating large amounts of structured data than basic PHP arrays. So, even setting aside export formats, if memory exhaustion is a recurring issue (eg. ๐Ÿ› Memory error after install Active and ๐Ÿ› Out of memory on main module page Active ), SimpleXML might be worth exploring.

    Also, David is not wrong about Yaml's limitations on wrt/ large blobs of HTML.

    However, if this were ever to be pursued, it'd be nice to make it pluggable. Personally, I much prefer Yaml's human-readability over JSON and XML.

  • ๐Ÿ‡จ๐Ÿ‡ดColombia andresalvarez Bogota

    YAML is one of the best options for managing configurations due to its lightweight and readable structure, which allows you to define processes efficiently without overloading memory. Its indentation-based format facilitates manual reading and editing, reducing complexity compared to other formats such as JSON or XML. In addition, its compatibility with multiple languages and frameworks makes it an ideal choice for configuration management in scalable environments.

  • ๐Ÿ‡จ๐Ÿ‡ดColombia andresalvarez Bogota

    could you provide us with some sample config yml which has erroneous data to check what improvement could be used

Production build 0.71.5 2024