E
enigma261
Hi,
I am a XML beginner.
I need some guidance in intrepreting a XML file
and then populating my object model.
Following is an example of the XML file ..
<Tom>
<Version>x.0</Version>
<Ref>
<Id>5555</Id>
<SubList>
<Sub>
<Type>zzzz</Type>
</Sub>
<Sub>
<Type>tttt</Type>
</Sub>
</SubList>
<VarList>
<Var>
<Type>kkkk</Type>
</Var>
<Var>
<Type>mmmm</Type>
</Var>
</VarList>
</Ref>
</Tom>
After, I parse this file, I end up with a name-value pair,
that looks like following
..Tom.Version x.0
..Tom.Ref.Id 5555
..Tom.Ref.SubList.Sub.Type zzzz
..Tom.Ref.SubList.Sub.Type tttt
..Tom.Ref.VarList.Var.Type kkkk
..Tom.Ref.VarList.Var.Type mmmm
After I have this name-value pair, I would like to populate my object
model, which looks something like following
There is a class called "Tom" that has a property called "Version".
"Tom" has a pointer to another class called "Ref" which in turn
has a property called "Id". "Ref" also holds two lists each holding
pointers to "Sub" and "Var".
This is just an example. But the general model is very similar.
I need some guidance in populating my object model after I have the
name-value pair. ( At this point, I don't think it is really an
XMl issue).
Any other better way would also be highyl appreciated.
thanks
I am a XML beginner.
I need some guidance in intrepreting a XML file
and then populating my object model.
Following is an example of the XML file ..
<Tom>
<Version>x.0</Version>
<Ref>
<Id>5555</Id>
<SubList>
<Sub>
<Type>zzzz</Type>
</Sub>
<Sub>
<Type>tttt</Type>
</Sub>
</SubList>
<VarList>
<Var>
<Type>kkkk</Type>
</Var>
<Var>
<Type>mmmm</Type>
</Var>
</VarList>
</Ref>
</Tom>
After, I parse this file, I end up with a name-value pair,
that looks like following
..Tom.Version x.0
..Tom.Ref.Id 5555
..Tom.Ref.SubList.Sub.Type zzzz
..Tom.Ref.SubList.Sub.Type tttt
..Tom.Ref.VarList.Var.Type kkkk
..Tom.Ref.VarList.Var.Type mmmm
After I have this name-value pair, I would like to populate my object
model, which looks something like following
There is a class called "Tom" that has a property called "Version".
"Tom" has a pointer to another class called "Ref" which in turn
has a property called "Id". "Ref" also holds two lists each holding
pointers to "Sub" and "Var".
This is just an example. But the general model is very similar.
I need some guidance in populating my object model after I have the
name-value pair. ( At this point, I don't think it is really an
XMl issue).
Any other better way would also be highyl appreciated.
thanks