Re: XML editor using MFC
I've never done what you're trying to do, but I'd go through the following
steps:
1. Create a tree item for each Element and a sub-tree item for each
sub-element. There may be duplicate elements and sub elements depending on
how the XML is formed.
2. Have a CObList (or other container) to hold the Attributes and store them
all as strings. I'd display these in a list control in a right window (sort
of like Explorer does with folders and files) I'd store a pointer to a list
of objects for each tree node in the tree nodes item data. The attributes
will have a key and a value. If you use CStrings it will be easy to modify
them. I'd just create a simple object type and store those in the list and
a pointer to the list in the tree.
3. When a user moves up and down the tree you could display the
corresponding attributes and even allow in place editing if you want.
4. I'd modify everything in place in the tree and string arrays then walk
the whole tree at the end to recreate the XML when the user indicates some
action.
This link will give you some help in starting with a tree control:
http://msdn2.microsoft.com/en-us/library/8ws6dh1y(VS.80).aspx
Storing data in the tree:
http://www.ucancode.net/faq/MFC_CTreeCtrl-CListCtrl.htm
This is a simplistic set of steps, but hopefully it gives you some ideas.
Tom
<chobhe.amruta@gmail.com> escribiC en el mensaje de noticias
news:0df3e27c-37c3-4aca-9f07-7fd82cb2b463@e23g2000prf.googlegroups.com...
- Show quoted text -
m doing project..thatz why i need it..i hav got code 4 parsing
seperately.....bt dnt knw how to attach it to my window's code...so
plz let me knw how to do that