473,748 Members | 9,416 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Change the XML elements sequence

Thu
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)>
<Field(1)>
<Field(2)>
<Field(3)>
</TableA>

If I want to change the sequence of the fields to:

<TableA>
<Field(0)>
<Field(3)>
<Field(1)>
<Field(2)>
</TableA>

Does anyone know what is the easiest way to do this
without using "select" statement? (Because this example
has been simplified for easier illustration, original
problem involves multiple tables and DataRelations, which
cannot be solved using "Select" statement.)
Can XML schema control the sequence of the elements
appear in XML document? Thanks.
Nov 12 '05 #1
1 1321
If the documents are not too big then you could use XSLT to transform the
first document into the second.

"Thu" <th***********@ hotmail.com> wrote in message
news:08******** *************** *****@phx.gbl.. .
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)>
<Field(1)>
<Field(2)>
<Field(3)>
</TableA>

If I want to change the sequence of the fields to:

<TableA>
<Field(0)>
<Field(3)>
<Field(1)>
<Field(2)>
</TableA>

Does anyone know what is the easiest way to do this
without using "select" statement? (Because this example
has been simplified for easier illustration, original
problem involves multiple tables and DataRelations, which
cannot be solved using "Select" statement.)
Can XML schema control the sequence of the elements
appear in XML document? Thanks.

Nov 12 '05 #2

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

Similar topics

4
3061
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 schema to be legal, so that if I threw my UI.xml and UISchema.xml at a validator it would succeed. I have just learned that the order of elements is important, that is if you define a schema with element a followed by element b, then in the xml...
9
8826
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> <row> <col>Andy Clark</col> <col>16 Jan 1973</col> <col>Cincinnati</col>
2
1863
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 by the position on the list) this is so i can then pass it to the array called pictureimage to get the correct filename (similar to the picturetext part of this routine) and then the final line on the fuction is to change an original image with...
2
2307
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> <Start>549019.590988 57955.274194</Start> </Line>
1
1390
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
1683
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 (still an XSLT n00b), but I'm not sure that's the way to go anyway... What I'm trying to accomplish is generation of XML Schema output from a given XML input, with "xs:import" elements in the output with the "namespace" and "schemaLocation"...
0
1152
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 name="Magazine" abstract="true"> <xs:sequence> <xs:element name="Title" type="xs:string"/> <xs:element name="Editor" type="xs:string"/>
16
2518
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. vector<intvTmp; vTmp.push_back(1); vTmp.push_back(2); vTmp.push_back(1); vTmp.push_back(2);
2
1420
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
8984
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
9530
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9312
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
9238
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
8237
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6073
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
4864
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3300
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
3
2206
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.