It is currently April 26th, 2024, 6:09 pm

100 data points from an XML file

Get help with creating, editing & fixing problems with skins
eddie2302
Posts: 6
Joined: December 12th, 2018, 3:46 pm

100 data points from an XML file

Post by eddie2302 »

I'm reading an XML file in a skin using code similar to the following:

Code: Select all

Measure=Plugin
Plugin=WebParser
URL=file://ExampleFile.XML
RegExp=(?siU)<Capital>(.*)</Capital>.*<Capital>(.*)</Capital>.*<Capital>(.*)</Capital>.*
The data points are between <Capital> and </Capital> on the XML file. It works fine up to the point when I reach 100 data values (i.e. in the code <Capital>(.*)</Capital>.* is copied and pasted 100 times). At this point it completely stops reading any data points. 99 points works beautifully but as soon as the 100th point comes into play the graph that is being plotted ceases to exist, it doesn't even give me the first 99 points any more.

Has anyone else had this problem and if so is there a solution so that 100 points can be read?

P.s. If you would like the full Rainmeter code to work with just ask for it in a comment but it is fairly long and much of it is unimportant. You would also need the XML file with 100 data points to show the problem.
User avatar
balala
Rainmeter Sage
Posts: 16173
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: 100 data points from an XML file

Post by balala »

99 is the limit of number of data which can be acquired by a single parent WebParser measure. You can't get more. Read the Note here.
eddie2302
Posts: 6
Joined: December 12th, 2018, 3:46 pm

Re: 100 data points from an XML file

Post by eddie2302 »

Thanks balala, your knowledge is always appreciated.

It seems like a design flaw in the system though. I guess I will have to write a workaround by using numerous WebParser commands when I get time.
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5407
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: 100 data points from an XML file

Post by eclectic-tech »

eddie2302 wrote: February 28th, 2019, 1:11 pm Thanks balala, your knowledge is always appreciated.

It seems like a design flaw in the system though. I guess I will have to write a workaround by using numerous WebParser commands when I get time.
Depending on your XML file formatting, you may be able to use StringIndex2 to parse more than 99 items.

If your XML has 'sections' that contain related information e.g.; <item>...</item> which can be captured, you could use StringIndex2 to parse the captured section and capture individual parts from that section. This would allow almost unlimited captures.

More info can be found here: https://docs.rainmeter.net/tips/webparser-using-stringindex2/

Checkout JSMorley's WXData skin to see how he found ways to capture tons of data! 8-)