473,473 Members | 1,805 Online
Bytes | Software Development & Data Engineering Community
Create 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 1306
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
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...
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
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
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,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
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...
0
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
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...

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.