🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

2 total messages Started by emoh Mon, 23 Jul 2007 13:19
mssql i xml
#9406
Author: emoh
Date: Mon, 23 Jul 2007 13:19
17 lines
1343 bytes
Witam,

Dostaję xml'a z mssql.
XmlReader reader = cmd.ExecuteXmlReader();

Zazwyczaj dodawałem do swojego xml xmldocument elementy w ten sposób 
wydaje mi sie najprostszy a innego też nie znam.
         XmlElement node = xml.DocumentElement;
         XmlElement link = xml.DocumentElement;
         node = node.GetElementsByTagName("linki")[0] as XmlElement;
         link = xml.CreateElement("link");
         link.SetAttribute("name", "Strt");
         link.SetAttribute("href", "Default.aspx");
         node.AppendChild(link);
Teraz nie wiem jak w węzeł linki załadować ten xml który jest w reader.
Prosił bym o jakąś sugestię.
Pozdrawiam
Re: mssql i xml
#9407
Author: szomiz
Date: Mon, 23 Jul 2007 18:50
14 lines
1428 bytes
Użytkownik "emoh" <emoh@op.pl> napisał w wiadomości 
news:f829t1$jcd$1@news.onet.pl...

> Teraz nie wiem jak w węzeł linki załadować ten xml który jest w reader.
> Prosił bym o jakąś sugestię.

Zapytac tak, zeby od razu dostac xml'a takiego jak trzeba.

A w obecnej wersji: pewnie przez appenChild, bo w ktoryms miejscu xml'a z 
odpowiedzia pojawia sie klasyczny xmlElement, ktorego mozna cloneNode...

Kiedy wreszcie poczytasz o DOM'ie?!?

sz. 
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads