Click here to Skip to main content
15,891,033 members
Home / Discussions / XML / XSL
   

XML / XSL

 
Questionhow to display xml data in treecheckbox using javascript Pin
snitu6-Apr-07 22:15
snitu6-Apr-07 22:15 
QuestionJavascript in XSLT --> formatting Error with Quotes Pin
Ollie19865-Apr-07 22:22
Ollie19865-Apr-07 22:22 
QuestionDeserialize XML Database Pin
swguy234-Apr-07 19:57
swguy234-Apr-07 19:57 
AnswerRe: Deserialize XML Database Pin
led mike5-Apr-07 4:42
led mike5-Apr-07 4:42 
AnswerRe: Deserialize XML Database Pin
BoneSoft9-Apr-07 5:20
BoneSoft9-Apr-07 5:20 
Questionxml codes [modified] Pin
veasna_f2o4-Apr-07 6:17
veasna_f2o4-Apr-07 6:17 
AnswerRe: xml codes Pin
PIEBALDconsult4-Apr-07 7:10
mvePIEBALDconsult4-Apr-07 7:10 
QuestionAppendChild problem Pin
Rob Grainger4-Apr-07 4:23
Rob Grainger4-Apr-07 4:23 
I'm attempting to modify an XML Document using System.Xml's DOM methods. I'm loading a template document, then modifying it with values from my application.

The final document has some repeating nodes, where the template document includes only one template node for these. I use the following technique to create the required nodes:

XmlNode node = requestedMessagesElement.SelectSingleNode(
"//Message");
XmlElement firstMessageElement = (XmlElement)node;

// Add message nodes for each message
for (long i = 0; i < numMessages; ++i)
{
XmlElement messageElement;

// For first element, modify existing message
if (i == 0)
messageElement = firstMessageElement;

// For successive elements, copy existing element to modify
else
{
messageElement = (XmlElement)firstMessageElement.Clone();
messageElement =
(XmlElement)requestedMessagesElement.AppendChild(
messageElement);
}

// Other modifications here
}

For some reason, when I execute the code, the resulting XML misplaces the resulting nodes. For example, if the nodes are appended in order "1, 2, 3", I'm consistently getting results in order "3, 1, 2".

Any suggestions greatly appreciated.

PS. I use the value returned from "AppendChild" as the documentation states that the method returns the appended node - just covering tracks in case the system decides to insert a copy of the passed node for some reason.
QuestionReading an Xml file Pin
honeyss3-Apr-07 18:08
honeyss3-Apr-07 18:08 
AnswerRe: Reading an Xml file Pin
Stefan Troschuetz3-Apr-07 21:22
Stefan Troschuetz3-Apr-07 21:22 
AnswerRe: Reading an Xml file Pin
led mike4-Apr-07 4:39
led mike4-Apr-07 4:39 
QuestionLooking for a way to output CSV Pin
PIEBALDconsult2-Apr-07 13:01
mvePIEBALDconsult2-Apr-07 13:01 
AnswerRe: Looking for a way to output CSV [modified] Pin
PIEBALDconsult3-Apr-07 9:44
mvePIEBALDconsult3-Apr-07 9:44 
QuestionStructured HTML to XML Pin
RichardInToronto30-Mar-07 5:49
RichardInToronto30-Mar-07 5:49 
AnswerRe: Structured HTML to XML Pin
PIEBALDconsult2-Apr-07 14:56
mvePIEBALDconsult2-Apr-07 14:56 
GeneralRe: Structured HTML to XML Pin
RichardInToronto2-Apr-07 15:50
RichardInToronto2-Apr-07 15:50 
GeneralRe: Structured HTML to XML Pin
PIEBALDconsult3-Apr-07 3:27
mvePIEBALDconsult3-Apr-07 3:27 
QuestionI'm confused Pin
Mike Hankey29-Mar-07 15:53
mveMike Hankey29-Mar-07 15:53 
AnswerRe: I'm confused Pin
Christian Graus29-Mar-07 16:00
protectorChristian Graus29-Mar-07 16:00 
GeneralRe: I'm confused Pin
Mike Hankey29-Mar-07 16:12
mveMike Hankey29-Mar-07 16:12 
QuestionXml - Element or CDATA Pin
Mike Hankey28-Mar-07 16:59
mveMike Hankey28-Mar-07 16:59 
AnswerRe: Xml - Element or CDATA Pin
Stefan Troschuetz28-Mar-07 23:20
Stefan Troschuetz28-Mar-07 23:20 
GeneralRe: Xml - Element or CDATA Pin
Mike Hankey29-Mar-07 1:12
mveMike Hankey29-Mar-07 1:12 
Questionxmlwriter [modified] Pin
Tkml23628-Mar-07 8:56
Tkml23628-Mar-07 8:56 
AnswerRe: xmlwriter Pin
led mike28-Mar-07 10:26
led mike28-Mar-07 10:26 

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.