Each output is sent out about every 5ms.
I'm able to read & capture all the data without issue, but I'm trying to figure out the best way to Parse the data.
The XML parsers appear to not work for this data due to multiple root elements.
Example Raw Data from the Device
<cross-domain-policy> <allow-access-from domain="*" to-ports="*" /> </cross-domain-policy> <FAILSAFE>0</FAILSAFE> <KEY4>0</KEY4> <CATEGORYLIST> <BUTTONITEM INDEX="0" BTNIMG="btnimages/defaults/CG CH2" FLEXIMG="1111">Device 1</BUTTONITEM> <BUTTONITEM INDEX="1" BTNIMG="btnimages/defaults/Clips CH2" FLEXIMG="2222">Device 2</BUTTONITEM> <BUTTONITEM INDEX="2" BTNIMG="btnimages/defaults/Stills CH2" FLEXIMG="3333">Device 3</BUTTONITEM> </CATEGORYLIST> <SOURCEDEVICELIST>Now Line 3 in this Example "</cross-domain-policy> <FAILSAFE>0</FAILSAFE> <KEY4>0</KEY4> <CATEGORYLIST>"
Has the close tag from Line 1, and then an Open Tag <CATEGORYLIST> that doesn't close tell line 7.
So if I try to parse it Line by line, I get errors.
Their is No End to this data, as it's streaming data that might run for hours on end.
What would be the best way to parse the data with XML, or should I drop trying to use any XML parser & just rewrite my own parser for this data from scratch ?


Sign In
Create Account


Back to top









