Click here to Skip to main content
15,900,431 members
Home / Discussions / XML / XSL
   

XML / XSL

 
AnswerRe: Preventing and encrypting data from breaking Xml Structure Pin
Stuart Dootson12-Aug-09 21:41
professionalStuart Dootson12-Aug-09 21:41 
GeneralRe: Preventing and encrypting data from breaking Xml Structure Pin
Saksida Bojan12-Aug-09 23:09
Saksida Bojan12-Aug-09 23:09 
GeneralRe: Preventing and encrypting data from breaking Xml Structure Pin
Stuart Dootson12-Aug-09 23:19
professionalStuart Dootson12-Aug-09 23:19 
GeneralRe: Preventing and encrypting data from breaking Xml Structure Pin
Saksida Bojan12-Aug-09 23:24
Saksida Bojan12-Aug-09 23:24 
QuestionWindows Forms Layout using Xml Pin
Devaang1110-Aug-09 20:52
Devaang1110-Aug-09 20:52 
AnswerRe: Windows Forms Layout using Xml Pin
annathor10-Aug-09 21:11
annathor10-Aug-09 21:11 
GeneralRe: Windows Forms Layout using Xml Pin
Devaang1110-Aug-09 21:31
Devaang1110-Aug-09 21:31 
GeneralRe: Windows Forms Layout using Xml [modified] Pin
annathor10-Aug-09 21:48
annathor10-Aug-09 21:48 
well, lets asume you have created a class that contain the data parsed from the xml (lets call it LabelData) and that you have a list with objects of that type containing the data for all the lables you wants to add to the form (lets call the list LabelDataList). the code will look something like this.

public class LabelData
{
   public string Name;
   public string Text;
   public int x,y;
   public int width,height;
   ....
   // you should use get/set methodes insted of public variables
};

List<LabelData> LabelDataList;

LabelDataList=new List<LabelData>();

//parse the xml
....
....
if (Node.NodeType == XmlNodeType.Element)
                    {
                        if (Node.Name == "Label")
                        {
                            XmlElement NodeElement = Node as XmlElement;
                            LabelData tmpLD=new LabelData();
                            //sett the variables in the tmpLD object to the values in the xml using the XmlElement methode GetAttribute
                            LabelDataList.add(tmpLD);  
                        }
                    }
....
....

//loop through the parsed data
foreach(LabelData ld in LabelDataList)
{
  Label newLabel=new Label();
  newLabel.Name=ld.Name;
  newLabel.Text=ld.Text;
  newLabel.Location=new Point(ld.x, ld.y);
  newLabel.Size=new Size(ld.width, ld.height);
  ....
  ....
  this.Controls.Add(newLabel);
}


ofcourse you can create the labels and add them to the form directly in the loop you use to parse the xml too, when it comes to parsing the XML there is many ways to do it, maybe the easiest one is to load the data into a DataTable and loop through the rows in the DataTable.

modified on Tuesday, August 11, 2009 4:11 AM

GeneralRe: Windows Forms Layout using Xml Pin
Devaang1110-Aug-09 23:45
Devaang1110-Aug-09 23:45 
GeneralRe: Windows Forms Layout using Xml Pin
annathor11-Aug-09 0:26
annathor11-Aug-09 0:26 
QuestionAdd up elements value by matching name element Pin
RossBradley10-Aug-09 11:49
RossBradley10-Aug-09 11:49 
AnswerRe: Add up elements value by matching name element Pin
Stuart Dootson10-Aug-09 21:58
professionalStuart Dootson10-Aug-09 21:58 
Questioncan i format xml file, suggestion please ? Pin
lazy_dude5-Aug-09 20:35
lazy_dude5-Aug-09 20:35 
AnswerRe: can i format xml file, suggestion please ? Pin
annathor10-Aug-09 21:21
annathor10-Aug-09 21:21 
GeneralRe: can i format xml file, suggestion please ? Pin
lazy_dude16-Aug-09 18:39
lazy_dude16-Aug-09 18:39 
QuestionHelp Pin
MrMcIntyre1-Aug-09 4:54
MrMcIntyre1-Aug-09 4:54 
AnswerRe: Help Pin
Mike Ellison1-Aug-09 10:52
Mike Ellison1-Aug-09 10:52 
AnswerRe: Help Pin
MrMcIntyre2-Aug-09 10:25
MrMcIntyre2-Aug-09 10:25 
GeneralRe: Help Pin
Mike Ellison3-Aug-09 3:28
Mike Ellison3-Aug-09 3:28 
AnswerRe: Help Pin
Richard MacCutchan31-Aug-09 23:37
mveRichard MacCutchan31-Aug-09 23:37 
AnswerRe: Help - Further Information Pin
Richard MacCutchan1-Sep-09 5:47
mveRichard MacCutchan1-Sep-09 5:47 
QuestionHow to response XMl format using SOAP protocol Pin
Sasmi_Office30-Jul-09 22:55
Sasmi_Office30-Jul-09 22:55 
QuestionxmlTextWriter error Pin
newXMLdeveloper28-Jul-09 6:57
newXMLdeveloper28-Jul-09 6:57 
QuestionRegarding the SOAP message Request and Response Pin
Sasmi_Office27-Jul-09 20:01
Sasmi_Office27-Jul-09 20:01 
Questioncreate xml .. [modified] Pin
Rajeshwar Code- Developer27-Jul-09 4:35
Rajeshwar Code- Developer27-Jul-09 4:35 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.