# Html and json

**URL:** <https://casparcgforum.org/t/html-and-json/6401>\
**Category:** General\
**Created:** [February 7, 2024, 12:24am UTC](https://casparcgforum.org/t/html-and-json/6401 "2024-02-07T00:24:52Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![tue](https://casparcgforum.org/letter_avatar_proxy/v4/letter/t/4491bb/32.png) [@tue](https://casparcgforum.org/u/tue)\
**Post date:** [February 7, 2024, 12:24am UTC](https://casparcgforum.org/t/html-and-json/6401/1 "2024-02-07T00:24:52Z")

</div>

I want to test CasparCG together with Viz Mosart  
Anyone knows wich version I can use when I need to play with HTML templates and not send the data with json?

---

<div class="post-metadata">

**Author:** ![markusnygard](https://casparcgforum.org/user_avatar/casparcgforum.org/markusnygard/32/8_2.png) [@markusnygard](https://casparcgforum.org/u/markusnygard)\
**Post date:** [February 7, 2024, 9:32am UTC](https://casparcgforum.org/t/html-and-json/6401/2 "2024-02-07T09:32:23Z")

</div>

Hi  
I think the easiest way to start is by checking the Sofie project and their MOS-integration

> **[Rundown & Newsroom Systems | Sofie TV Automation Documentation](https://nrkno.github.io/sofie-core/docs/user-guide/installation/installing-a-gateway/rundown-or-newsroom-system-connection/intro/)**
>
> Sofie Core doesn't talk directly to the newsroom systems, but instead via one of the Gateways.

---

<div class="post-metadata">

**Author:** ![andyw](https://casparcgforum.org/letter_avatar_proxy/v4/letter/a/f05b48/32.png) [@andyw](https://casparcgforum.org/u/andyw)\
**Post date:** [February 7, 2024, 9:55am UTC](https://casparcgforum.org/t/html-and-json/6401/3 "2024-02-07T09:55:41Z")

</div>

Last time I saw MosArt connecting to CasparCG (several years ago now) I think MosArt sent XML wrapped instance data to the template.

The coding of the HTML template **update(myData)** function defines if the template handles XML and/or JSON wrapped user data. It is simple to detect the two formats from the first character of the userstring parameter passed to update() - **\<** for XML and **{** for JSON. It is common in the update() function to convert externally delivered XML into JSON for use within the template.

XML was the only format supported by the SVT cliients when HTML templates were made available in server V2.0.7, so it an all newer server versions can be programmed to use XML to deliver instance data.

---

<div class="post-metadata">

**Author:** ![tue](https://casparcgforum.org/letter_avatar_proxy/v4/letter/t/4491bb/32.png) [@tue](https://casparcgforum.org/u/tue)\
**Post date:** [February 7, 2024, 7:18pm UTC](https://casparcgforum.org/t/html-and-json/6401/4 "2024-02-07T19:18:04Z")

</div>

So @andyw if I understand you, it is the template I have to convert, to understand XML

But how?

I have made some templates with:  
[nxtedition/create-caspar-graphics: A tool for building, testing and packaging HTML graphics for CasparCG using code. (github.com)](https://github.com/nxtedition/create-caspar-graphics)

Can I make them to understand XML?

---

<div class="post-metadata">

**Author:** ![andyw](https://casparcgforum.org/letter_avatar_proxy/v4/letter/a/f05b48/32.png) [@andyw](https://casparcgforum.org/u/andyw)\
**Post date:** [February 7, 2024, 10:52pm UTC](https://casparcgforum.org/t/html-and-json/6401/5 "2024-02-07T22:52:09Z")

</div>

I was aware of nxtEdition but have not used it. It is a carefully built application and the parser supports delivery of instance data by both XML and JSON. So they should just work.

There are a couple of very simple lower third templates available as part of my CasparCG documentation [here](https://github.com/amwtech/CasparCG_Documentation/tree/main/templates) on github. Example 1 is a static lower-third, Example 2 has play and stop animations. Both templates include lots of comments intended to aid people understand the processes involved.

Andy
