473,411 Members | 1,968 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,411 software developers and data experts.

Beginner needs help

I'm a beginner in XML language and I'm trying to create an XML file that could be viewed in Excel as a table that has rows and columns like this:

Q1 Q2
Row1 3 5
Row2 4 1
Row3 2 3
But my table ends up like this: When I write to another column, the program continues writing from the next row instead of returning to Row1.

/attribuutit /Q19 /Q20 /Q21
Row1
Row2
Row3
Row4
10
12
14
15
10
12
14
15
10
12
14
15

----------------
The code I use is like this:

Dim enc As Encoding
Dim objXMLTW As New XmlTextWriter("c:\officet\testi2.xml", enc)

Dim r1 As DataRow, r2 As DataRow, r0 As DataRow

---- the first column -----
objXMLTW.WriteStartElement("attribuutit")

For Each r0 In datasetAttribuutti.Tables("ATTRIBUUTTI").Rows

objXMLTW.WriteElementString("attribuutit", r0.Item("NIMI"))

Next

objXMLTW.WriteEndElement()
---- columns after that, using loops ----

For Each r1 In datasetOsaalueet.Tables("OSAALUEET").Rows

For Each r2 In datasetKysymykset.Tables("KYSYMYKSET").Rows

If r1.Item("OSAALUENUMERO") = r2.Item("OSAALUENUMERO") Then

objXMLTW.WriteStartElement("Q" & r2.Item("KYSYMYSNUMERO"))

For Each r0 In dsAttribuutti.Tables("ATTRIBUUTTI").Rows

value = .....

objXMLTW.WriteElementString("Q" & r2.Item("KYSYMYSNUMERO"), value)

Next

objXMLTW.WriteEndElement()

End If

Next

Next

This is probably a very amateurish question, but I hope someone could help me with this, anyway. Thanks in advance.

Toni Sevastjanoff

Mar 22 '06 #1
0 1048

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

Similar topics

7
by: BobJohnson | last post by:
Just started learning C++ and I need some help with my homework, shouldn't take long for people around here. I need to create a simple money calculator but I don't know how to make the output...
12
by: Blaze | last post by:
I am doing the first walk through on the Visual Studio .Net walkthrough book to learn a little about programming. I am having issues with the first tutorial not running correctly. It seems that...
18
by: mitchellpal | last post by:
Hi guys, am learning c as a beginner language and am finding it rough especially with pointers and data files. What do you think, am i being too pessimistic or thats how it happens for a beginner?...
2
by: stargate03 | last post by:
Hi there I have a MYSQL database which has the following table CREATE TABLE `#__content` ( `id` int(11) unsigned NOT NULL auto_increment, `title` varchar(100) NOT NULL default '', ...
22
by: ddg_linux | last post by:
I have been reading about and doing a lot of php code examples from books but now I find myself wanting to do something practical with some of the skills that I have learned. I am a beginner php...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.