R
raghudr
Hi all,
I am parsing a .xml file.My main intention is to retrieve the name
value of node "Signal":- "Name Value" which is
"rag".
i want to store only the <signal> "name value" that is only
"rag" ,"rock","yahoo"to my list.
I do not want to add any <subsignals> "name value" to the list.i want
to skip it.
For that i wrote code like this
XmlTextReader reader = new XmlTextReader(signalfilename);
while (reader.Read())
{
if (reader.Name == "Signal")
{
//save the name value to list
}
else if (reader.Name == "SubSignals")
{
Problem:- Which is the API i have to use to skip all the
subnodes of the <subsignals> and go to the
next <signal>
}
}
Fot that i wrote code like this:
<Signal>
<Name Value="rag" />
<Real Value="21@ADVANT" />
<Description Value="Best" />
<Min Value="0" />
<Max Value="40" />
<Unit Value="barh" />
<Item Value="XQ60" />
<MillisCylce Value="20" />
<Resolution Value="1" />
<DataType Value="VT" />
<SubSignals>
<Signal BitIndex="0">
<Name Value="jack" />
<Reference Value="" />
<Description Value="AIR_PRG" />
<Min Value="11" />
<Max Value="13" />
<Unit Value="ACTIVE" />
<DataType Value="VT" />
</Signal>
<Signal BitIndex="1">
<Name Value="jae" />
<Reference Value="" />
<Description Value="AIR_PRG" />
<Min Value="11" />
<Max Value="13" />
<Unit Value="ACTIVE" />
<DataType Value="VT" />
</Signal>
<Signal BitIndex="2">
<Name Value="chuck" />
<Reference Value="" />
<Description Value="AIR_PRG" />
<Min Value="11" />
<Max Value="13" />
<Unit Value="ACTIVE" />
<DataType Value="VT" />
</Signal>
</SubSignals>
</Signal>
<Signal>
<Name Value="rock" />
<Real Value="21@ADVANT" />
<Description Value="Best" />
<Min Value="0" />
<Max Value="40" />
<Unit Value="barh" />
<Item Value="XQ60" />
<MillisCylce Value="20" />
<Resolution Value="1" />
<DataType Value="VT" />
<Signal>
<Signal>
<Name Value="yahoo" />
<Real Value="21@ADVANT" />
<Description Value="Best" />
<Min Value="0" />
<Max Value="40" />
<Unit Value="barh" />
<Item Value="XQ60" />
<MillisCylce Value="20" />
<Resolution Value="1" />
<DataType Value="VT" />
<Signal>
can anyone tell me what changes i need to do to my above code.
thanks in advance,
RAGHU
I am parsing a .xml file.My main intention is to retrieve the name
value of node "Signal":- "Name Value" which is
"rag".
i want to store only the <signal> "name value" that is only
"rag" ,"rock","yahoo"to my list.
I do not want to add any <subsignals> "name value" to the list.i want
to skip it.
For that i wrote code like this
XmlTextReader reader = new XmlTextReader(signalfilename);
while (reader.Read())
{
if (reader.Name == "Signal")
{
//save the name value to list
}
else if (reader.Name == "SubSignals")
{
Problem:- Which is the API i have to use to skip all the
subnodes of the <subsignals> and go to the
next <signal>
}
}
Fot that i wrote code like this:
<Signal>
<Name Value="rag" />
<Real Value="21@ADVANT" />
<Description Value="Best" />
<Min Value="0" />
<Max Value="40" />
<Unit Value="barh" />
<Item Value="XQ60" />
<MillisCylce Value="20" />
<Resolution Value="1" />
<DataType Value="VT" />
<SubSignals>
<Signal BitIndex="0">
<Name Value="jack" />
<Reference Value="" />
<Description Value="AIR_PRG" />
<Min Value="11" />
<Max Value="13" />
<Unit Value="ACTIVE" />
<DataType Value="VT" />
</Signal>
<Signal BitIndex="1">
<Name Value="jae" />
<Reference Value="" />
<Description Value="AIR_PRG" />
<Min Value="11" />
<Max Value="13" />
<Unit Value="ACTIVE" />
<DataType Value="VT" />
</Signal>
<Signal BitIndex="2">
<Name Value="chuck" />
<Reference Value="" />
<Description Value="AIR_PRG" />
<Min Value="11" />
<Max Value="13" />
<Unit Value="ACTIVE" />
<DataType Value="VT" />
</Signal>
</SubSignals>
</Signal>
<Signal>
<Name Value="rock" />
<Real Value="21@ADVANT" />
<Description Value="Best" />
<Min Value="0" />
<Max Value="40" />
<Unit Value="barh" />
<Item Value="XQ60" />
<MillisCylce Value="20" />
<Resolution Value="1" />
<DataType Value="VT" />
<Signal>
<Signal>
<Name Value="yahoo" />
<Real Value="21@ADVANT" />
<Description Value="Best" />
<Min Value="0" />
<Max Value="40" />
<Unit Value="barh" />
<Item Value="XQ60" />
<MillisCylce Value="20" />
<Resolution Value="1" />
<DataType Value="VT" />
<Signal>
can anyone tell me what changes i need to do to my above code.
thanks in advance,
RAGHU