Click here to Skip to main content
15,884,836 members
Home / Discussions / XML / XSL
   

XML / XSL

 
GeneralRe: How ti create sitemap in xml? Pin
JMecier27-Apr-10 3:57
JMecier27-Apr-10 3:57 
QuestionWord Formatting Pin
Mahesh Kulkarni14-Apr-10 0:09
Mahesh Kulkarni14-Apr-10 0:09 
Questionbuilding an XML page Pin
Farraj13-Apr-10 5:26
Farraj13-Apr-10 5:26 
AnswerRe: building an XML page Pin
Estys14-Apr-10 1:01
Estys14-Apr-10 1:01 
GeneralRe: building an XML page Pin
Farraj14-Apr-10 1:20
Farraj14-Apr-10 1:20 
GeneralRe: building an XML page Pin
Estys14-Apr-10 2:22
Estys14-Apr-10 2:22 
GeneralRe: building an XML page Pin
Farraj14-Apr-10 6:07
Farraj14-Apr-10 6:07 
GeneralRe: building an XML page Pin
Estys14-Apr-10 22:52
Estys14-Apr-10 22:52 
Your form code should look like this :

public partial class choreForm : Form
{
    XmlDocument xDoc = new XmlDocument();

    public choreForm()
    {
        InitializeComponent();
    }

    private void choreForm_Load(object sender, EventArgs e)
    {
        FileInfo fi1 = new FileInfo(GetFileName());

        if (fi1.Exists)
        {
            xDoc.Load(GetFileName());
        }
        else
        {
            xDoc.AppendChild(xDoc.CreateElement("chores"));
        }
    }

    private void button1_Click(object sender, EventArgs e)
    {
        XmlElement xDay = xDoc.SelectSingleNode("descendant::day[@title='" + this.dropdwnlst.selectedvalue + "']") as XmlElement;

        if (xDay == null)
        {
            xDay = xDoc.CreateElement("day");
            xDay.SetAttribute("title", this.dropdwnlst.selectedvalue);
            xDoc.FirstChild.AppendChild(xDay);
        }

        XmlElement xJob = xDoc.CreateElement("job");
        xJob.SetAttribute("a", this.txtBoxProduct.Text);
        xJob.SetAttribute("b", this.txtBoxSize.Text);
        xJob.SetAttribute("c", this.txtBoxPrice.Text);
        xJob.SetAttribute("d", this.txtBoxAmount.Text);
        xDay.AppendChild(xJob);

    }

    private void choreForm_FormClosing(object sender, FormClosingEventArgs e)
    {
        xDoc.Save(GetFileName());
    }

    private string GetFileName()
    {
        return @"c:\temp\chores2.xml";
    }
}

gimme 5 if you like this!

GeneralRe: building an XML page Pin
Farraj15-Apr-10 0:46
Farraj15-Apr-10 0:46 
AnswerRe: building an XML page Pin
Farraj16-Apr-10 4:26
Farraj16-Apr-10 4:26 
GeneralRe: building an XML page Pin
Estys16-Apr-10 6:04
Estys16-Apr-10 6:04 
GeneralRe: building an XML page Pin
Farraj24-Apr-10 9:46
Farraj24-Apr-10 9:46 
QuestionImage in XML Pin
farokhian10-Apr-10 5:08
farokhian10-Apr-10 5:08 
AnswerRe: Image in XML Pin
daveyerwin10-Apr-10 10:29
daveyerwin10-Apr-10 10:29 
Questionhey I need some help with my coding...... I have an xml and a dtd but they dont validate... can someone help me please? Pin
anubir7-Apr-10 9:44
anubir7-Apr-10 9:44 
AnswerRe: hey I need some help with my coding...... I have an xml and a dtd but they dont validate... can someone help me please? Pin
Stuart Dootson7-Apr-10 14:22
professionalStuart Dootson7-Apr-10 14:22 
GeneralRe: hey I need some help with my coding...... I have an xml and a dtd but they dont validate... can someone help me please? Pin
anubir8-Apr-10 3:07
anubir8-Apr-10 3:07 
GeneralRe: hey I need some help with my coding...... I have an xml and a dtd but they dont validate... can someone help me please? Pin
anubir8-Apr-10 3:08
anubir8-Apr-10 3:08 
GeneralRe: hey I need some help with my coding...... I have an xml and a dtd but they dont validate... can someone help me please? Pin
Stuart Dootson8-Apr-10 4:49
professionalStuart Dootson8-Apr-10 4:49 
QuestionXML File is not updated in IE browser Pin
vdtrip7-Apr-10 8:40
vdtrip7-Apr-10 8:40 
QuestionGenerating a new XML file starting with a XML file and applyng XSLT Pin
FJJCENTU5-Apr-10 7:32
FJJCENTU5-Apr-10 7:32 
AnswerRe: Generating a new XML file starting with a XML file and applyng XSLT Pin
FJJCENTU5-Apr-10 8:56
FJJCENTU5-Apr-10 8:56 
QuestionCompiling an XML database with an application Pin
brdavid24-Mar-10 21:19
brdavid24-Mar-10 21:19 
AnswerRe: Compiling an XML database with an application Pin
Stuart Dootson28-Mar-10 21:46
professionalStuart Dootson28-Mar-10 21:46 
QuestionHow can i read or get an XML from another host? Pin
spawneditions24-Mar-10 8:58
spawneditions24-Mar-10 8:58 

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.