473,789 Members | 2,634 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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>
<ExecuteProcess 1 />
<ExecuteProcess 2>
Test
</ExecuteProcess2 >
<ExecuteProcess 3>
123
</ExecuteProcess3 >
</Device>

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

<Device>
<ExecuteProcess 1 />
<ExecuteProcess 2>
<DeviceName>I BM 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 >
<ExecuteProcess 3>
<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>
<ExecuteProcess 1 />
<DeviceName>I BM PC</DeviceName>
<DeviceLength>6 </DeviceLength>
<ExecuteProcess 2>
</ExecuteProcess2 >
<Calculate id="1">123</Calculate>
<ExecuteProcess 3>
</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 1154

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******** *************** ***********@mic rosoft.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>
<ExecuteProcess 1 />
<ExecuteProcess 2>
Test
</ExecuteProcess2 >
<ExecuteProcess 3>
123
</ExecuteProcess3 >
</Device>

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

<Device>
<ExecuteProcess 1 />
<ExecuteProcess 2>
<DeviceName>I BM 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 >
<ExecuteProcess 3>
<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>
<ExecuteProcess 1 />
<DeviceName>I BM PC</DeviceName>
<DeviceLength>6 </DeviceLength>
<ExecuteProcess 2>
</ExecuteProcess2 >
<Calculate id="1">123</Calculate>
<ExecuteProcess 3>
</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
7359
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 written to the output stream. We are willing to pay $ to any expert (e.g. MVP) consultant who has to time to help us track down this problem. (we will discuss rates if you can prove your expertise, and problem solving approach).
1
3640
by: Casper JH Erasmus | last post by:
How do I save the contents of a TreeView to a XML Document?
1
1613
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 listed below. Using XmlDocument, I can create the <books> and the individual <name> and <price> elements, but I am unsure how to create the <category> and <title> elements and close them after creating the detail elements. Eg. how can I go 2+...
2
3151
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. **************************************** <Root_Element> <Topic index="1"> <Sub_Topic> <Notes></Notes>
0
9663
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10195
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10136
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9979
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6765
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5415
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5548
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4090
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3695
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.