P
Pat Ford
Hi All;
I'm working on a data acquisition system, the system runs on Linux, and the
config files are Xml like.
eg
<CHANNELS>
<META>
Short Label,textbox,width=5,Alpha,required
Long Label,textbox,width=15,Alpha,required
Crate,select,1,2
Channel,textbox,width=5,Numeric,Min=0,Max=9999
ESP flag,checkbox
RMS flag,checkbox
Rate LS,select,1,10,100,1000
Rate HS,select,1,10,100,1000
Cal Factor,textbox,width=7,Numeric
Zero offset,textbox,width=7,Numeric
Exc. Voltage,textbox,width=7,Numeric
Amp Gain,select,1,10,20,50,100,200,500,1000
LP filter,select,1=10Hz,2=100Hz,3=1KHz
RMS gain,select,1,10,20,50,100
PS#,select,1,2,3,4,5
DIN#,special,type=din
</META>
<FIELDNAMES>
Short Label,Long Label,Crate,Channel,ESP flag,RMS flag,Rate LS,Rate HS,Cal
Factor,Zero offset,Exc. Voltage,Amp Gain,LP filter,RMS gain,PS#,DIN#
</FIELDNAMES>
<DATA>
TM,TM,0,142,,,1,,0.00046566,0,1,1,0,1,77,0
--,--,0,143,,,1,,30.5176,0,1,1,0,1,77,0
P0,P0,0,4042,,,1,,30.5176,0,1,1,0,1,77,6204
TP,TP,0,231,,,1,,30,-0.12976,1,1,0,1,77,0
LF,LF,0,224,,,1,,41.666,-10.194,1,1,0,1,77,0
FP,FP,0,226,,,1,,5.0505,-333.97,1,1,0,1,77,0
</DATA>
</CHANNELS>
Using libxml, I've parsed out the fields using the tree1 example, but I
can't figure out how to rewind the stream, so I can start looking for a
different block. I have ~12 programs that need to access different blocks so
I'm thinking I'll make a parser.lib, but I need a way to rewind.
Any ideas?
I'm working on a data acquisition system, the system runs on Linux, and the
config files are Xml like.
eg
<CHANNELS>
<META>
Short Label,textbox,width=5,Alpha,required
Long Label,textbox,width=15,Alpha,required
Crate,select,1,2
Channel,textbox,width=5,Numeric,Min=0,Max=9999
ESP flag,checkbox
RMS flag,checkbox
Rate LS,select,1,10,100,1000
Rate HS,select,1,10,100,1000
Cal Factor,textbox,width=7,Numeric
Zero offset,textbox,width=7,Numeric
Exc. Voltage,textbox,width=7,Numeric
Amp Gain,select,1,10,20,50,100,200,500,1000
LP filter,select,1=10Hz,2=100Hz,3=1KHz
RMS gain,select,1,10,20,50,100
PS#,select,1,2,3,4,5
DIN#,special,type=din
</META>
<FIELDNAMES>
Short Label,Long Label,Crate,Channel,ESP flag,RMS flag,Rate LS,Rate HS,Cal
Factor,Zero offset,Exc. Voltage,Amp Gain,LP filter,RMS gain,PS#,DIN#
</FIELDNAMES>
<DATA>
TM,TM,0,142,,,1,,0.00046566,0,1,1,0,1,77,0
--,--,0,143,,,1,,30.5176,0,1,1,0,1,77,0
P0,P0,0,4042,,,1,,30.5176,0,1,1,0,1,77,6204
TP,TP,0,231,,,1,,30,-0.12976,1,1,0,1,77,0
LF,LF,0,224,,,1,,41.666,-10.194,1,1,0,1,77,0
FP,FP,0,226,,,1,,5.0505,-333.97,1,1,0,1,77,0
</DATA>
</CHANNELS>
Using libxml, I've parsed out the fields using the tree1 example, but I
can't figure out how to rewind the stream, so I can start looking for a
different block. I have ~12 programs that need to access different blocks so
I'm thinking I'll make a parser.lib, but I need a way to rewind.
Any ideas?