Click here to Skip to main content
15,920,005 members
Home / Discussions / XML / XSL
   

XML / XSL

 
GeneralRe: SImple Problem with XML Pin
Christian Graus31-May-05 12:22
protectorChristian Graus31-May-05 12:22 
GeneralRe: SImple Problem with XML Pin
niansah3-Jun-05 21:37
niansah3-Jun-05 21:37 
Generalworml list style capturing Pin
ramissues30-May-05 19:21
ramissues30-May-05 19:21 
GeneralDOM Component Pin
eshban28427-May-05 23:14
eshban28427-May-05 23:14 
GeneralRe: DOM Component Pin
Christian Graus31-May-05 12:08
protectorChristian Graus31-May-05 12:08 
GeneralRe: DOM Component Pin
eshban2845-Jun-05 23:45
eshban2845-Jun-05 23:45 
GeneralRe: DOM Component Pin
Wilbur J. Pereira6-Jun-05 0:26
Wilbur J. Pereira6-Jun-05 0:26 
GeneralCorrect XPATH Pin
ksanju100026-May-05 4:27
ksanju100026-May-05 4:27 
hi This code is working fine given below
private void button31_Click(object sender, System.EventArgs e)
{
XmlDocument xmldoc = new XmlDocument();
xmldoc.Load("c:/farm-config.xml");

XmlElement databaseElement = xmldoc.CreateElement("database1000");

xmldoc.DocumentElement["farm-config"].PrependChild(databaseElement);



FileStream fsxml = new FileStream("c:/farm-config.xml",FileMode.Truncate,FileAccess.Write,FileShare.ReadWrite);

// XML Document Saved
xmldoc.Save(fsxml);
fsxml.Close();
}


Above code enters <database1000 /> into ram.xml file after farm-config element
I want to enter after farm name=dev1
I get error in this line given below

xmldoc.DocumentElement["//farm[@name='dev1']"].PrependChild(databaseElement);

Rest of the code is same as given above code

my xml file stiructure is given below
-----------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<root>
<farm-config>
<farm name="dev1">
<connection address="192.168.1.13" user="root" selectedConnection="1" password="">
<lastJob>Copy-All</lastJob>
<lastConnection startdate="2005-05-10" starttime="12:43:23" enddate="2005-05-10" endtime="12:58:32" />
<state>1</state>
</connection>
//here i wantto insert database element

</farm>
</farm-config>
<root>

regards
sanjeev

Generaladd control to xslt by asp.net with vb Pin
mathuros_paiboon25-May-05 18:26
mathuros_paiboon25-May-05 18:26 
GeneralRe: add control to xslt by asp.net with vb Pin
Christian Graus25-May-05 18:33
protectorChristian Graus25-May-05 18:33 
GeneralRe: add control to xslt by asp.net with vb Pin
mathuros_paiboon25-May-05 19:28
mathuros_paiboon25-May-05 19:28 
GeneralRe: add control to xslt by asp.net with vb Pin
Christian Graus25-May-05 19:36
protectorChristian Graus25-May-05 19:36 
Generaladd control to xslt by asp.net Pin
mathuros_paiboon25-May-05 18:08
mathuros_paiboon25-May-05 18:08 
Generaladd control to xslt by asp.net Pin
mathuros_paiboon25-May-05 18:02
mathuros_paiboon25-May-05 18:02 
GeneralRe: add control to xslt by asp.net Pin
Christian Graus25-May-05 18:06
protectorChristian Graus25-May-05 18:06 
GeneralRe: add control to xslt by asp.net Pin
mathuros_paiboon25-May-05 18:30
mathuros_paiboon25-May-05 18:30 
Generaladd textbox to web by xslt condition Pin
mathuros_paiboon25-May-05 17:51
mathuros_paiboon25-May-05 17:51 
GeneralRe: add textbox to web by xslt condition Pin
Christian Graus25-May-05 18:05
protectorChristian Graus25-May-05 18:05 
GeneralXMLtransform and windows 2003 server Pin
Jan Foster23-May-05 10:51
Jan Foster23-May-05 10:51 
GeneralInsert node between particular node Pin
ksanju100022-May-05 18:26
ksanju100022-May-05 18:26 
GeneralRe: Insert node between particular node Pin
Christian Graus22-May-05 18:54
protectorChristian Graus22-May-05 18:54 
GeneralRe: Insert node between particular node Pin
Stuart Dootson22-May-05 22:31
professionalStuart Dootson22-May-05 22:31 
GeneralRe: Insert node between particular node Pin
ksanju100025-May-05 0:29
ksanju100025-May-05 0:29 
GeneralCopy/Clone XML node Pin
jeffb_22-May-05 7:35
jeffb_22-May-05 7:35 
GeneralRe: Copy/Clone XML node Pin
DavidNohejl22-May-05 11:50
DavidNohejl22-May-05 11:50 

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.