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
|
|
|
|
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]
|
|
|
|
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 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
|
|
|
|
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.
|
|
|
|
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.
|
1 user thanked kjones9999 for this useful post.
|
|
|
Rank: Administration
Groups: Administrators
Joined: 1/13/2010(UTC) Posts: 5,208 Location: Gold Coast, Australia Was thanked: 4286 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
|
1 user thanked admin for this useful post.
|
|
|
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 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
|
|
|
|
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.
Important Information:
The vMix Forums uses cookies. By continuing to browse this site, you are agreeing to our use of cookies.
More Details
Close