This version has the global list included. The one in my original response may not.
Original Message:
Sent: 09-25-2024 16:39
From: Brishen Thompson
Subject: XML Sports Live Stats Organization
Hello! This workflow can be tackled from a couple different directions. I have my preferred method, which is utilizing datalinq keys and global user input lists to drive what stats are pulled.
To start, I have the XML link you provided added as a RSS/HTTP data source in Datalinq.
Next, I looked through the XML to see how it is organized. I used this to develop a Global User Input List inside of XPression. You can access those lists under Project > Global User Input Lists. Add a new list on the left side and then you can begin populating it with columns and data. The way I have set mine up, there is a description column for a user friendly selection title, a CAT (category) column for telling XPression what type of stat we're looking for (i.e. defense/pass/rush) in our XML, a STAT column to grab the data for the desired stat (so yds inside of the pass category would be Passing Yards), and lastly a column for the unit I was to display for this stat (10 YDS/5 TD/3 TACKLES). My global user input list is on the bottom of this image with the datalinq source opened above it.
Inside of XPression, I have created a scene with two datalinq keys: one for the team selection (V or H) and one for the player selection called Jersey.
We can then use those datalinq keys to drive what player we'd like to see the stats for. For example, I want to pull the Name of the player on a text object. Set the text object to datalinq, select the XML data source, then we can use the datalinq keys in the Column entry for my text object like this: team<vh=%Team%>\player<uni=%Jersey%> ....team<vh=%Team%> is used for selecting the Home or Visitor team we'd like to pull data from based on our Team datalinq key and player<uni=%Jersey%> is used to select which player # we'd like to grab data from.
This is the concept we will use for pulling stats as well, with a couple additions. For this example, I have a couple different text objects I am using to pull 3 separate stats.
STAT 1-3 will be what actually pulls data from our datalinq source, STAT SELECT 1-3 is what the operator will use to select what stat data to display, and STAT UNIT 1-3 will drive what units display for each stat.
On STAT SELECT 1-3, I set them all to static text and enable user input controls. For the Input Source, we are going to use our Stat Select Global User Input List we made earlier. Additionally, I used the Assign Columns feature to send the Stat Unit associated with the stat we select to a text object to use later when we put all our data together (this will change to STAT UNIT 2 text obj for STAT SELECT 2 and so on for STAT SELECT 3).
Now we can finally use all this to grab the data based on our selection. On the STAT 1 Text Object, we can set it up the same as our name, but this time we'll add \@STAT SELECT 1.CAT@ to the column entry. This will be used to navigate to the category of stat we're requesting (i.e. defense, pass, rush, etc.). For the row, we use the same concept to grab the stat we want to get the data for (yds, td, etc.) with @STAT SELECT 1.STAT@. It is important to understand that we are using a single text object (STAT SELECT) to fulfill a couple different data navigation needs. This concept is the same for each other STAT 1-3, but we change the STAT SELECT # accordingly.
At this point, we should have all our data. I typically will use visual logic to format it nicely.
For operation, all the operator needs to do is select the team (V or H), the player # (Jersey), and which stats they'd like to show. They can even use %relid% in the Jersey datalinq key to have them populated automatically.
I will attach the scene that I used here for you to look through and dissect. You can import it into XPression using File > Import > From Project/File. I named the datalinq source "Chapman FB", so as long as you name yours the same in your datalinq server it should work with no issues.
One of the reasons I like this workflow is because it's easily flexible. Need to add additional stat categories? Just add it to the Global List. Need to implement this in your basketball project? Just modify the global list to follow the basketball XML. And it works for both teams out of the box.
Let me know if you run into any issues with this. Hope it helps!
------------------------------
Brishen Thompson
Demonstration Artist & Trainer - Generalist
Ross Video
Original Message:
Sent: 09-25-2024 01:52
From: Nathaniel Rudolph
Subject: XML Sports Live Stats Organization
This is the live XML file. https://sidearmstats.com/chapman/football/1.xml
I found this thread and was wondering if this is how I could do it with the XML?
https://rossvideo.community/communities/community-home/digestviewer/viewthread?GroupId=199&MID=24202&CommunityKey=91812bfd-9393-4a3f-8a74-7f8035df130e
------------------------------
Nathaniel Rudolph
Xpression Graphics Operator
CSBN
Original Message:
Sent: 09-24-2024 12:18
From: Aukhojee Nidhish kumar
Subject: XML Sports Live Stats Organization
Try the xml file directly into datalinq and link the data to xpression instead of extract data to excel sheet... , do you have a copy of the live xml file, can you load it
Sent from my phone
Original Message:
Sent: 9/23/2024 9:05:00 PM
From: Nathaniel Rudolph
Subject: XML Sports Live Stats Organization
I have been struggling for a while now on how to get live stats into Xpression and it being easily organized.
The sports I am broadcasting use Genius Sports. While I have tried all their different inputs, none of them are easily readable and able to quickly pull from for different player graphics. However, they do send the Live XML file to place they display them on SideArm Sports. I was able to get access to this file.
I was able to write some code is Python to be able to extract the data from the live XML file every 10 seconds and organize it into an Excel sheet which Xpression can pull from locally. You can see how it is organized here: Link
We also have a different Excel sheet that contains the data of the players such as their name, position, headshot address, etc.
I am trying to find a way to be able to quickly pull up the information and stats for any specific player onto a graphic. It should pull the header of the stat and the stat itself. I tried using two Datalinq Keys however I can't figure out how to get that to work.
Is there some visual logic or scripts inside of Xpression I can utilize?
Any help would be appreciated, thank you!
------------------------------
Nathaniel Rudolph
Xpression Graphics Operator
CSBN
------------------------------