XML technologies / JSON for XML professionals / JSON in publishing and CMSs
In publishing, JSON is often encountered not as a replacement for a complete book document, but as an interchange format at a system boundary. A shop needs different views of the data than a typesetting workflow. A search interface needs results, facets and IDs; an editorial system, by contrast, must preserve editable content. The same publication can therefore appear in several JSON views without abandoning the XML master file.
The following examples use data2type GmbH as the company. A simple organization record looks like this:
File: data/company.json
{
"id": "organization-001",
"name": "data2type GmbH",
"url": "https://www.data2type.de/",
"publicationPage": "https://www.data2type.de/publikationen/schematron/"
}This organization data does not make data2type the book’s publisher: for the Schematron book, the publisher is still dpunkt.verlag. An API can provide company data, publications and authors separately and connect them through identifiers. The CMS responses and component models shown here are examples created specifically for this purpose, not exports from the data2type website. [Q43]
Typical uses along the publishing chain
A sensible architectural decision starts with the task. The following table describes possible project roles; it does not claim that every CMS or publisher implements all these functions in the same way.
Use case | What JSON can carry | What else must be agreed |
|---|---|---|
CMS API | Titles, teasers, content, media references, language variants | Field model, permissions, revisions, URL rules |
Headless frontend | Page components and their data | Component model, renderer, preview and error behavior |
Product and metadata service | Book titles, prices, availability, people | Identities, currencies, editions and freshness |
Search service | Result lists, facets, text snippets | Ranking, index version, stable references |
Production control | Jobs, status messages, validation reports | Process states, repeatability, error codes |
Semantic web output | Descriptions of a publication in JSON-LD | Vocabulary, IRIs, truthfulness of statements |
Knowledge or RAG system | Text sections with sources and structural metadata | Citation anchors, versions, rights and traceable provenance |
For all these roles, it is important to check whether JSON is merely a transport envelope. An API can return a JSON response whose large body field contains unstructured text or HTML. The media type alone guarantees neither the quality of the content model nor the possibility of lossless downstream processing.
WordPress, Drupal and TYPO3
The WordPress REST API exposes content and other resources as JSON. Its documentation describes posts, pages, taxonomies and media, among other things. Posts have separate object fields for the title and content. The API is an interface to the system; this does not mean that WordPress stores all content internally as native JSON documents. [Q12], [Q13]
Simplified, synthetic example of an API response containing rendered HTML:
File: data/cms-html.json
{
"id": 101,
"title": {
"rendered": "Schematron"
},
"content": {
"rendered": "<p>Manuel Montero Pineda explains <em>Schematron</em> at data2type.</p>"
}
}The text inside content.rendered remains HTML. Anyone wishing to find semantic inline elements or divide content for other output channels must parse that HTML again. The JSON object makes transport easier but does not eliminate the second content syntax.
Drupal has a core JSON:API module that connects to the system’s entities and fields. JSON:API is an additional interface standard, not simply another name for JSON. It specifies, among other things, the representation of resources and relationships. [Q14], [Q15]
A vendor-neutral, synthetic JSON:API example:
File: data/jsonapi-example.json
{
"data": {
"type": "books",
"id": "book-001",
"attributes": {
"title": "Schematron"
},
"relationships": {
"authors": {
"data": [
{
"type": "people",
"id": "person-001"
},
{
"type": "people",
"id": "person-002"
},
{
"type": "people",
"id": "person-003"
}
]
}
}
},
"included": [
{
"type": "people",
"id": "person-001",
"attributes": {
"name": "Manuel Montero Pineda"
}
},
{
"type": "people",
"id": "person-002",
"attributes": {
"name": "Marko Hedler"
}
},
{
"type": "people",
"id": "person-003",
"attributes": {
"name": "Nico Kutscherauer"
}
}
]
}The relationship authors refers to all three identified book authors. The included field contains the corresponding person records. This is useful for an API, but does not automatically create an RDF graph. relationships and included derive their meaning from JSON:API, not from general JSON syntax.
For TYPO3, the extension friendsoftypo3/headlessdocuments how content can be emitted as JSON for a separate frontend. Fields, naming and nesting are customizable. This is a specific extension-based solution, not a claim that every TYPO3 installation provides the same API without configuration. Version compatibility and project configuration must be checked during integration. [Q16]
This article therefore does not present unverified TypoScript recipes as universally usable configurations. The companion package supplies content, HTML fragments and a page manifest. Integrating them into the actual TYPO3 project is a separate task.
Headless means separating editing from output
A component-oriented frontend can use a model like this:
File: data/cms-components.json
{
"site": {
"id": "organization-001",
"name": "data2type GmbH",
"url": "https://www.data2type.de/",
"publicationPage": "https://www.data2type.de/publikationen/schematron/"
},
"id": "page-001",
"language": "en",
"title": "Schematron at data2type",
"content": [
{
"type": "heading",
"level": 2,
"text": "Introduction"
},
{
"type": "paragraph",
"children": [
{
"type": "text",
"value": "Manuel Montero Pineda explains "
},
{
"type": "emphasis",
"children": [
{
"type": "text",
"value": "Schematron"
}
]
},
{
"type": "text",
"value": " at data2type. See "
},
{
"type": "xref",
"target": "chapter-2",
"children": [
{
"type": "text",
"value": "the workflow"
}
]
},
{
"type": "text",
"value": "."
}
]
},
{
"type": "bookList",
"bookIds": [
"book-001",
"book-002"
]
}
]
}Here, bookList denotes a project-specific component. The JSON parser does not know what it looks like. A renderer determines whether it becomes an HTML list, cards, an app element or some other output. An unknown component type must therefore be handled visibly. Silently ignoring it can result in incomplete publications.
This separation resembles XML-based single-source workflows: structure is stored independently of a particular output. The difference lies in the respective content models and tools. A component-oriented JSON model may suit a website well yet still express too little to represent a complex scholarly book without extensions.
JSON as an intermediate format, not automatically a final format
An EPUB is not created simply by putting a JSON document into a ZIP file. EPUB 3.3 defines a publication with container, package and content requirements, including XML-based package information and XHTML or SVG content documents. JSON can supply data for generating them, but does not replace these requirements. [Q17]
A publishing workflow can therefore reasonably combine XML as an editorially controlled source, JSON as an API view, and HTML, EPUB or PDF as output. A JSON-based editorial system may be equally reasonable if its model expresses the required structures and reliably generates the target outputs. Format choices must follow requirements, not the popularity of a file extension.