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
Ash  
#1 Posted : Saturday, February 23, 2019 7:41:23 AM(UTC)
Ash

Rank: Advanced Member

Groups: Registered
Joined: 11/19/2013(UTC)
Posts: 127
Location: Hobart Tasmania Australia

Thanks: 13 times
Was thanked: 11 time(s) in 8 post(s)
Hi

I have an XML document with a large number of fields.

I want to select a block of data using 'position' eg


<?xml version="1.0" encoding="UTF-8"?>
<Main>
<Data>
<Field no="1">Name1</Field>
<Field no="2">Name2</Field>
.....
.....

</Data?
</Main>

I used //Field[5 <= position() and position() <= 10] which gives me a result using https://www.freeformatte...th-tester.html#ad-output

<Field no="1">Name1</Field>
<Field no="2">Name2</Field>
<Field no="3">Name3</Field>
<Field no="4">Name4</Field>
<Field no="5">Name5</Field>

ok good, so i plugged that into vMixx and get

|no|#text
|5|name1
|6|name2
|7|name3
|8|name4
|9|name5

So I don't want the "no" column just the name data. [EDIT it's returning the attribute 'no' ? ]

I tried //Field[position() <= 5 and position() <= 10]/text() in https://www.freeformatte...th-tester.html#ad-output

and it returns

name1
name2
name3
name4
name5

Plug that into Xpath in Data Sources and I get an "ERROR: Object reference not set to an instance of an object"

Sorta stumped, has anyone some advice?

Regards
Ash
kjones9999  
#2 Posted : Saturday, February 23, 2019 3:30:52 PM(UTC)
kjones9999

Rank: Advanced Member

Groups: Registered
Joined: 8/20/2014(UTC)
Posts: 388

Thanks: 29 times
Was thanked: 80 time(s) in 51 post(s)
I am not getting the same based on the post BUT

try this:
//Field [position() >=2 and position() <= 10]

If that doesn't work try this
//Field [position() >=1 and position() <= 10]
Ash  
#3 Posted : Sunday, February 24, 2019 4:51:52 AM(UTC)
Ash

Rank: Advanced Member

Groups: Registered
Joined: 11/19/2013(UTC)
Posts: 127
Location: Hobart Tasmania Australia

Thanks: 13 times
Was thanked: 11 time(s) in 8 post(s)
Originally Posted by: kjones9999 Go to Quoted Post
I am not getting the same based on the post BUT

try this:
//Field [position() >=2 and position() <= 10]

If that doesn't work try this
//Field [position() >=1 and position() <= 10]


Thanks kjones9999, tried both and it still returns the "no" attribute as a column.

Seems I am getting an error when ever I try to use the /text() to extrat the inner text value of "Field", maybe text() is not installed in XML version in vMix or I am not understanding the usage correctly

In any case I have used a work around in vMix Data Source by assigning the Column for each text place holder in the GT title and that works.

Incidently I do not have control over the XML file as that is generated from a 3rd party app from the scoreboard source.

Ash




kjones9999  
#4 Posted : Sunday, February 24, 2019 4:27:11 PM(UTC)
kjones9999

Rank: Advanced Member

Groups: Registered
Joined: 8/20/2014(UTC)
Posts: 388

Thanks: 29 times
Was thanked: 80 time(s) in 51 post(s)
I see-- you must be leaving something out of the feed because I posted what you had and it worked in the validator.
kjones9999  
#5 Posted : Monday, February 25, 2019 2:16:16 AM(UTC)
kjones9999

Rank: Advanced Member

Groups: Registered
Joined: 8/20/2014(UTC)
Posts: 388

Thanks: 29 times
Was thanked: 80 time(s) in 51 post(s)
Actually I loaded in to vmix and that first row is treated as a column label and vmix does not use it.
thanks 1 user thanked kjones9999 for this useful post.
Ash on 2/25/2019(UTC)
admin  
#6 Posted : Monday, February 25, 2019 12:16:04 PM(UTC)
admin

Rank: Administration

Groups: Administrators
Joined: 1/13/2010(UTC)
Posts: 5,208
Man
Location: Gold Coast, Australia

Was thanked: 4287 time(s) in 1520 post(s)
Hi,

Based on the XML shown, using //Field by itself should work just fine or //Field[5 <= position() and position() <= 10]
There will be a column for the attribute no, but you can ignore that and just assign the title fields to the #Text column without issue..

Regards,

Martin
vMix
thanks 1 user thanked admin for this useful post.
Ash on 2/25/2019(UTC)
Ash  
#7 Posted : Monday, February 25, 2019 4:50:59 PM(UTC)
Ash

Rank: Advanced Member

Groups: Registered
Joined: 11/19/2013(UTC)
Posts: 127
Location: Hobart Tasmania Australia

Thanks: 13 times
Was thanked: 11 time(s) in 8 post(s)
Originally Posted by: admin Go to Quoted Post
Hi,

Based on the XML shown, using //Field by itself should work just fine or //Field[5 <= position() and position() <= 10]
There will be a column for the attribute no, but you can ignore that and just assign the title fields to the #Text column without issue..

Regards,

Martin
vMix


Hi Martin

Thanks for the input and your suggestion is exactly what I did.

Regards
Ash

Users browsing this topic
Guest (2)
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.