Announcement

Collapse
No announcement yet.

Read and Prase xml files in a scene script

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Read and Prase xml files in a scene script

    Background:
    I have several xml files with election data which will be used in some interactive scenes – and the same data will also be used in a transition logic scene.

    Each xml file contains around 3-400 variables.

    The data need to be accessible on 3 engines simultaneously: 2 touch screens in the studio and on 1 on-air engine for full screen graphic and lower third etc.

    So, I am looking for the best way to read and prase the xml files and populate the data to shared memory.

    Plan:
    My current plan is to:
    1. Read the files into shared memory using Datapool – and keep the output format from Datapool as XML – when the presenter presses a button on touchscreen 1 (this screen act as something like a Main-Menu)
    2. Prase the Shared memory (format as XML) on touchscreen 2 and on-air engine.
    Problem:
    I can’t find any real XML-tool in Artist script language.

    I know I can prase the data the manual-way ( as ravisharma describe on http://forum.vizrt.com/forum/viz-art...859-xml-in-viz).

    Does there exist a better way to prase xml data in a scene script?
    – or am I wrong in my approach to create these scenes?


    Regards
    Jogvan olsen

  • #2
    Hi Jogvan,

    Can't you get the data in TXT format instead of XML? That way you dont need any parser and VSL has its commands for fetching the data from text files. I used delimiter separated TXT files in my 2009 interactive scenes and it worked perfectly fine. Just a suggestion.

    Comment


    • #3
      Hi ravisharma

      Thank you for your suggestion. Xml-files are easier to handle in our workflow. But I agree it would be easier to use delimiter separated TXT files in Vizrt.

      I came across this 'vsl-xml-parser' implemented by Rune Bjerke.

      If works fine when the xml-tree has only one level, and it also handles attributes. But I can't get it parse multilevel xml files.

      So I will try if it can solve my problem...

      Se more here:
      http://forum.vizrt.com/forum/viz-art...ring-is-caring

      Script can be downloadet here:
      https://github.com/sp00x/vsl-xml-parser

      regards
      jogvan olsen

      Comment


      • #4
        Hi,

        I use xpath in Content Pilot for parsing xml. I don't know is it working in vizrt artist. But maybe it give a idea.

        This is simple example.

        PHP Code:
        Sub loadengineip()
        Set XMLName CreateObject("Microsoft.XMLDOM")
        if 
        XMLName.Load("C:\ProgramData\vizrt\Media Sequencer\engine_list.xml"then
        Dim Name
        Set Name 
        XMLName.documentElement
        Set NameNodes 
        Name.selectNodes("engine")
        For 
        Each NameNode In NameNodes
        if Instr(NameNode.Attributes.getNamedItem("id").Text,"19"Then
        wallengine
        .text=NameNode.Attributes.getNamedItem("ip").Text
        End 
        if
        Next
        else
        wallengine.text=""
        End if
        End Sub 


        Xpath syntax example:
        https://www.w3schools.com/xml/xpath_syntax.asp

        Comment


        • #5
          Hi meret

          I have tried, but can't get this to work in Artist...

          jogvan

          Comment


          • #6
            Hi Jogvan,

            Have you tried DPDataReader? And if you are using Vizrt 4, there is option to use JavaScript as well..

            Comment

            Working...
            X