473,396 Members | 2,098 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,396 software developers and data experts.

Change XML elements sequence

Thu
Can anyone help me please..
I am using vb.net to WriteXML from Ms Access tables to an
output stream. Basically, I retrieve data from
3 tables then use DataRelations to link these three
tables, set the Nested property of these DataRelations to
True
so that in the the output XML document, the child node
would be nested within the parent node.

Dim DS as DataSet
Dim Relation_1 As DataRelation = DS.Relations.Add
("Relation_1",
DS.Tables("Table_1").Columns("ID_1"),
DS.Tables("Table_2").Columns("ID_1"))
Relation_1.Nested = True

Dim Relation_2 As DataRelation = DS.Relations.Add
("Relation_2",
DS.Tables("Table_2").Columns("ID_2"),
DS.Tables("Table_3").Columns("ID_2"))
Relation_2.Nested = True

Dim filename As String = "c:\XmlFile.xml"
Dim xmlSW As StreamWriter = New StreamWriter(filename,
True)

DS.WriteXml(xmlSW)

By default, the XML document will display one table after
another, i.e. the second table would be
displayed at the end of the first table & so on.

(1) <Table_1>
(2) <Table_1.Column(0)>
(3) <ID_1>
(4) <Table_1.Column(2)>
(5) <Table_1.Column(3)>
(6) <Table_2>
(7) <ID_1>
(8) <Table_2.Column(1)>
(9) <ID_2>
(10) <Table_2.Column(3)>
(11) </Table_2>
(12) <Table_3>
(13) <ID_2>
(14) <Table_3.Column(1)>
(15) <Table_3.Column(2)>
(16) </Table_3>
(17) </Table_1>
But I need the second table to be displayed where the ID
links.
I.e. Instead of <Table_2> node displayed at line(6), I
need the entire <Table_2> node displays at line (3).
Instead of <Table_3> node displayed at line(12), I need
the entire <Table_3> node displays at line (9).
I also need to hide all the LinkID, i.e. <ID_1>,
<ID_2>.

It should look something like this:

(1) <Table_1>
(2) <Table_1.Column(0)>
(6) <Table_2>
(8) <Table_2.Column(1)>
(12) <Table_3>
(14) <Table_3.Column(1)>
(15) <Table_3.Column(2)>
(16) </Table_3>
(10) <Table_2.Column(3)>
(11) </Table_2>
(4) <Table_1.Column(2)>
(5) <Table_1.Column(3)>
(17) </Table_1>
Does anyone know how to achieve this? Please help me..
thanks.

Nov 12 '05 #1
0 1301

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

Similar topics

4
by: Christine McGavran | last post by:
To continue a previous thread, sort of... I have defined a schema for describing a windows-style user interface. My application correctly parses and uses that schema. I'm now trying to get that...
9
by: Stanimir Stamenkov | last post by:
Using Xerces2 Java I'm trying to validate a CSV data following an XNI example <http://xml.apache.org/xerces2-j/xni-config.html#examples>. The CSV scanner generates XML tree events like: <csv>...
2
by: Nick Calladine | last post by:
Is this possible to ... I wish to get the value of a dropdown select but gets is indexable value (dont know if that is the right term) if that is possible (the position it assigned get assigned...
1
by: Thu | last post by:
I export some database data to an XML file. How do I change the sequence of the elements (fields) appear in the XML document? For example, my XML output from TableA is: <TableA> <Field(0)>...
2
by: Daniel Lidström | last post by:
Hi, I would like to know the cleanest way to change the serialization of my Line class from: <Line staStart="2327.02" length="10.00000003390744"> <End>549016.570965 57945.741122</End>...
1
by: Gi | last post by:
Hi, Can anyone tell me you can I transform this kind of XML: <Cont ID='faqs'> <Conts ID=''> <Elements> <Data></Data> <Pergunta></Pergunta> <Resposta></Resposta> </Elements>
1
by: daldridge | last post by:
I have a unique-elements/sorting question (who doesn't?), but haven't yet been able to get appropriate template/select/for-each processing working. I don't fully grok the Muenchian technique yet...
0
by: jam_planta | last post by:
Hi guys, Hope you can help me.I'm new in using C# and Xml Schema. I have a problem in getting the child element of the base type.. Here is the sample of my xsd file: <xs:complexType...
16
by: kaferro | last post by:
What is the typical way to loop through a vector while deleting certain elements during the loop process? The code below works, but I am wondering if there is a better solution. ...
2
by: jamil | last post by:
Take a look at the following XML doc: <main> <a> <element>123</element> </a> <b> <element>abc</element> </b> <c>
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?
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
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
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.