Willem Cazander
760ebffb6f
All checks were successful
Run test asserts / Test-Asserts (push) Successful in 8s
44 lines
2 KiB
Makefile
44 lines
2 KiB
Makefile
|
||
MB_MAKE_XML_LT := <
|
||
$(call mb-make-call,mb-doc-variable-rock,MB_MAKE_XML_LT,Expanded special char; lesser than.)
|
||
|
||
MB_MAKE_XML_GT := >
|
||
$(call mb-make-call,mb-doc-variable-rock,MB_MAKE_XML_GT,Expanded special char; greater than.)
|
||
|
||
MB_MAKE_XML_CDATA_START := <![CDATA[
|
||
$(call mb-make-call,mb-doc-variable-rock,MB_MAKE_XML_CDATA_START,Expanded special char; XML cdata start.)
|
||
|
||
MB_MAKE_XML_CDATA_END := ]]>
|
||
$(call mb-make-call,mb-doc-variable-rock,MB_MAKE_XML_CDATA_END,Expanded special char; XML cdata end.)
|
||
|
||
|
||
define _escape-xml-attr
|
||
$(MB_ᕽᕽᕽ )$(subst <,\u0026lt\u003B,$(subst >,\u003Cgt\u003B,$(subst $(MB_MAKE_XML_CDATA_START),,$(subst $(MB_MAKE_XML_CDATA_END),,"$(1)"))))
|
||
endef
|
||
define mb-make-xml-open
|
||
$(MB_ᕽᕽᕽ )"$(MB_MAKE_XML_LT)"$(1)$(if $(2), $(2)$(MB_MAKE_EQUALS)\"$(call mb-make-call,_escape-xml-attr,$(3))\")$(if $(4), $(4)$(MB_MAKE_EQUALS)\"$(call mb-make-call,_escape-xml-attr,$(5))\")"$(MB_MAKE_XML_GT)"
|
||
endef
|
||
$(call mb-make-call,mb-doc-function-deep,mb-make-xml-open,Print xml open tag.,<tag> [attr1-name] [attr1-value] [attr2-name] [attr2-value])
|
||
|
||
|
||
define mb-make-xml-close
|
||
$(MB_ᕽᕽᕽ )"$(MB_MAKE_XML_LT)"/$(1)"$(MB_MAKE_XML_GT)"
|
||
endef
|
||
$(call mb-make-call,mb-doc-function-deep,mb-make-xml-close,Print xml close tag.,<tag>)
|
||
|
||
|
||
define _escape-xml-value
|
||
$(MB_ᕽᕽᕽ )$(subst <,\u003C,$(subst >,\u003E,$(subst $(MB_MAKE_XML_CDATA_START),,$(subst $(MB_MAKE_XML_CDATA_END),,"$(1)"))))
|
||
endef
|
||
define mb-make-xml-value
|
||
$(MB_ᕽᕽᕽ )"$(MB_MAKE_XML_CDATA_START)"$(call mb-make-call,_escape-xml-value,$(1))"$(MB_MAKE_XML_CDATA_END)"
|
||
endef
|
||
$(call mb-make-call,mb-doc-function-deep,mb-make-xml-value,Print xml value in cdata wrapper.,<value>)
|
||
|
||
|
||
define mb-make-xml-tag-value
|
||
$(MB_ᕽᕽᕽ )$(if $(2),$(call mb-make-call,mb-make-xml-open,$(1))$(call mb-make-call,mb-make-xml-value,$(2))$(call mb-make-call,mb-make-xml-close,$(1)))
|
||
endef
|
||
$(call mb-make-call,mb-doc-function-deep,mb-make-xml-tag-value,Print xml tag with value inside.,<tag> [value])
|
||
|