473,395 Members | 1,666 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Generare XML - XmlDocument and XmlElement - need some help?

Hi,

I am away from my office PC now, so i can't get my problem codes up.

I can achieve this in C# with xmldocument and xmlelement

<Device>
<ExecuteProcess1 />
<ExecuteProcess2>
Test
</ExecuteProcess2>
<ExecuteProcess3>
123
</ExecuteProcess3>
</Device>

But, when i try to generate more than this...

<Device>
<ExecuteProcess1 />
<ExecuteProcess2>
<DeviceName>IBM PC</DeviceName> // not sure how to get it to be part of
ExecuteProcess 2
<DeviceLength>6</DeviceLength> // not sure how to get it to be part of
ExecuteProcess 2
</ExecuteProcess2>
<ExecuteProcess3>
<Calculate id="1">123</Calculate> // not sure how to get it to be part
of ExecuteProcess 3 and place id right here!
</ExecuteProcess3>
</Device>

I fail a lot of times when i try to do like above and always get the
results to be like this below.

<Device>
<ExecuteProcess1 />
<DeviceName>IBM PC</DeviceName>
<DeviceLength>6</DeviceLength>
<ExecuteProcess2>
</ExecuteProcess2>
<Calculate id="1">123</Calculate>
<ExecuteProcess3>
</ExecuteProcess3>
</Device>

Any help? I just want to get things right? Sorry that i can't attached my
code here at home but can anyone share some thoughts on this please -
probably some code snippets :)

Cheers.

--
Regards,
Chua Wen Ching
Visit us at http://www.necoders.com
Nov 16 '05 #1
1 1139

To clarify, your struggling with the code that makes DeviceName /
DeviceLength / Calculate nodes children of the relevant ExecuteProcess's?

I suspect your referencing the "Device" node when adding these children,
rather than the ExecuteProcess nodes into which you want to place them.

If you post your code we'll be able to steer where you're going wrong.

Dan.
"Chua Wen Ching" <ch************@nospam.hotmail.com> wrote in message
news:66**********************************@microsof t.com...
Hi,

I am away from my office PC now, so i can't get my problem codes up.

I can achieve this in C# with xmldocument and xmlelement

<Device>
<ExecuteProcess1 />
<ExecuteProcess2>
Test
</ExecuteProcess2>
<ExecuteProcess3>
123
</ExecuteProcess3>
</Device>

But, when i try to generate more than this...

<Device>
<ExecuteProcess1 />
<ExecuteProcess2>
<DeviceName>IBM PC</DeviceName> // not sure how to get it to be part
of
ExecuteProcess 2
<DeviceLength>6</DeviceLength> // not sure how to get it to be part of
ExecuteProcess 2
</ExecuteProcess2>
<ExecuteProcess3>
<Calculate id="1">123</Calculate> // not sure how to get it to be part
of ExecuteProcess 3 and place id right here!
</ExecuteProcess3>
</Device>

I fail a lot of times when i try to do like above and always get the
results to be like this below.

<Device>
<ExecuteProcess1 />
<DeviceName>IBM PC</DeviceName>
<DeviceLength>6</DeviceLength>
<ExecuteProcess2>
</ExecuteProcess2>
<Calculate id="1">123</Calculate>
<ExecuteProcess3>
</ExecuteProcess3>
</Device>

Any help? I just want to get things right? Sorry that i can't attached my
code here at home but can anyone share some thoughts on this please -
probably some code snippets :)

Cheers.

--
Regards,
Chua Wen Ching
Visit us at http://www.necoders.com

Nov 16 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Yechezkal Gutfreund | last post by:
I have been using the following code (successfully) to read Xml formated text packets from a TCP stream. The output from the server stream consists of a sequence of well formed Xml documents...
1
by: Casper JH Erasmus | last post by:
How do I save the contents of a TreeView to a XML Document?
1
by: David | last post by:
I need to find a good online resource which teaches the use of the XmlDocument framework in more depth than is covered in MS's online doc. I need to create a multi-level XML document like the one...
2
by: James Fifth | last post by:
Hello and God Bless, I am stumped trying to get a simple xml database replacing certain data with other data programmatically. This is what my xml looks like. ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.