fj-doc-guides

Venus Guidelines : From XML to JSON or YAML source

Venus Guides index

Version : 1 (2023-08-13)

Description : Information on how to use JSON or YAML as source.

Refer to Venus DOC Format for information on how to write the source XML Document.

It is possible to use JSON or YAML as source. It is just needed to follow some conversion rules.

As the inherent differences between XML and JSON/YAML the conversion rules are as follow :

{
	"xmlns" : "http://javacoredoc.fugerit.org",
	"xsi:schemaLocation" : "http://javacoredoc.fugerit.org https://www.fugerit.org/data/java/doc/xsd/doc-2-0.xsd",
	"xmlns:xsi" : "http://www.w3.org/2001/XMLSchema-instance",
	"_t" : "doc",
	"_e" : [ {
		"_t" : "metadata",
		"_e" : [ {
			"name" : "margins",
			"_t" : "info",
			"_v" : "10;10;10;30"
		}, {
			"name" : "doc-title",
			"_t" : "info",
			"_v" : "Hello World"
		}, {
			"name" : "doc-author",
			"_t" : "info",
			"_v" : "fugerit79"
		}, {
			"name" : "doc-language",
			"_t" : "info",
			"_v" : "en"
		} ]
	}, {
		"_t" : "body",
		"_e" : [ {
			"_t" : "para",
			"_v" : "Hello World!"
		} ]
	} ]
}

NOTES :

  1. As it is possible to directly convert JSON and YAML, rules for YAML are the same as for JSON format.
  2. All XML comments are ignored