logo

Live Production Software Forums


Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
ckshofner  
#1 Posted : Friday, May 12, 2023 12:57:53 AM(UTC)
ckshofner

Rank: Member

Groups: Registered
Joined: 12/15/2022(UTC)
Posts: 11
United States
Location: Minnsota

Is it possible to bring in a single XPath attribute rather than a node as a data source? I have an issue with the XML file/data I receive for a production that I think could be solved if my data source is only showing one attribute rather than an entire spreadsheet of various attributes under that node.

For example: XPath = //bsgame/team[1]/player/hitting (this brings in all baseball batting data attributes and works but not for my application since some needed attributes only display when there is a value - EX: there is no attribute for "strikeout" [@so] until someone actually strikes out so AUTO COLUMN will always find the wrong data field until it exists)

I need a working XPath with attribute: //bsgame/team[1]/player/hitting@so - returns ERROR: Object reference not set to an instance of an object.

My new idea is to have one attribute to display at a time in the data source so that I can lock it to the source rather than a column.

I have no control over the XML file and was told there can be no changes made to what I receive.

Is there a way to get just one attribute? Other ideas for a solution?
doggy  
#2 Posted : Friday, May 12, 2023 1:37:48 AM(UTC)
doggy

Rank: Advanced Member

Groups: Registered
Joined: 12/27/2012(UTC)
Posts: 5,216
Belgium
Location: Belgium

Thanks: 291 times
Was thanked: 955 time(s) in 790 post(s)
Originally Posted by: ckshofner Go to Quoted Post
Is it possible to bring in a single XPath attribute rather than a node as a data source? I have an issue with the XML file/data I receive for a production that I think could be solved if my data source is only showing one attribute rather than an entire spreadsheet of various attributes under that node.

For example: XPath = //bsgame/team[1]/player/hitting (this brings in all baseball batting data attributes and works but not for my application since some needed attributes only display when there is a value - EX: there is no attribute for "strikeout" [@so] until someone actually strikes out so AUTO COLUMN will always find the wrong data field until it exists)

I need a working XPath with attribute: //bsgame/team[1]/player/hitting@so - returns ERROR: Object reference not set to an instance of an object.

My new idea is to have one attribute to display at a time in the data source so that I can lock it to the source rather than a column.

I have no control over the XML file and was told there can be no changes made to what I receive.

Is there a way to get just one attribute? Other ideas for a solution?


if an attiribute is missing you will always get an erro in vMix ( datasources)
One can however check an xpath in a script (see vb.net) and trap the "error" so one can decide what to do when the att is available or not

https://www.w3schools.com/xml/xpath_syntax.asp
doggy  
#3 Posted : Friday, May 12, 2023 1:47:38 AM(UTC)
doggy

Rank: Advanced Member

Groups: Registered
Joined: 12/27/2012(UTC)
Posts: 5,216
Belgium
Location: Belgium

Thanks: 291 times
Was thanked: 955 time(s) in 790 post(s)
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.