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

Is XML right for this?

Appologies for the basic XML question...

I have some sales transaction data that is being generated from
various sources. This is aggregated in a file every day and uploaded
to a server. Then, the data is supposed to be fetched from the
individual files and dumped in to a database (in to a single table).
The data in the files is uniform for every record (i.e. date, time,
price, item, code, etc.). Nothing fancy.

I have the following questions regarding use of XML for these files:

1. Basically this data could as easily be stored in a delimited flat-
file (as it is now). So what is the advantage in using XML in this
case? (I know the advantages of XML in general, but in this case where
the data never changes, I am not sure of the advantage). Actually, the
XML markup bloats the file making transfer time more...

2. Should a DTD be used? A XML Schema? Or no need for this. I am
asking this because suppose in the future some new information is
added to the records, I think the processing script would need to know
what version of the XML file is being used and process accordingly?

3. Should every record in the data be stores as a single node with
data as attributes? (see example below). I think this is an age old
dilemma in XML but not sure of the answer...

4. Does the use of XML make the task of dumping the records in to the
database easier? (I think that either using existing classes or
available utilities there is no real effort in doing this?)

5. Should any type of XML transformation be considered? (or when...)

Sample flat file data:
TNo, Date, Time, Price, Qty
100, 010107, 1020, 3.2, 7

Should XML look like this?
<record TNo="100" Date="010107" Time="1020" Price="3.2" Qty="7"></
record>

Or like this?
<record>
<Tno>100</TNo>
<Date>010107</Date>
<Time>1020</Time>
<Price>3.2</Price>
<Qty>7</Qty>
</record>

Jul 1 '07 #1
2 1569
ElderUberGeek wrote:
1. Basically this data could as easily be stored in a delimited flat-
file (as it is now). So what is the advantage in using XML in this
case? (I know the advantages of XML in general, but in this case where
the data never changes, I am not sure of the advantage). Actually, the
XML markup bloats the file making transfer time more...
Yes, the markup is annoying if you are used to
delimited flat files. Are there any chinese characters
in the data ? Are their currency symbols like € ?
Then XML has the advantage that handling Unicode characters
is clearly defined.
2. Should a DTD be used? A XML Schema? Or no need for this. I am
asking this because suppose in the future some new information is
added to the records, I think the processing script would need to know
what version of the XML file is being used and process accordingly?
DTD is more standard, but restricted in what it can specify.
Schema is not quite as standard as DTD, but more powerful
in what it can specify.
3. Should every record in the data be stores as a single node with
data as attributes? (see example below). I think this is an age old
dilemma in XML but not sure of the answer...
Yes it is an old problem. Date, Time, Price, Qty are simple
enough to be stored in attributes. But article descriptions
may be better placed into the node's text.
Should XML look like this?
<record TNo="100" Date="010107" Time="1020" Price="3.2" Qty="7"></
record>
Yes.
Or like this?
<record>
<Tno>100</TNo>
<Date>010107</Date>
<Time>1020</Time>
<Price>3.2</Price>
<Qty>7</Qty>
</record>
If the tool you are using can handle this easily,
you shouldnt worry too much.

Jul 1 '07 #2
On 1 Jul, 17:31, ElderUberGeek <aribl...@gmail.comwrote:
I have some sales transaction data that is being generated from
various sources. This is aggregated in a file every day and uploaded
to a server.
When I do this, I tend to use either RSS or Atom (I'd suggest Atom for
new work). They're both XML, it's just that they've already defined
much of the DTD/Schema I need. With RSS / Atom + Dublin Core I find
that I can solve many of my similar problems without needing to write
any (or much) new code.

Jul 2 '07 #3

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

Similar topics

8
by: Bo Wisén | last post by:
Hi, A project in VB6 recently worked without any problems but now it's complaining when I try to use 'Right$'. In immediate mode, when I'm typing 'print left$("123456",2)' I get the correct...
12
by: Ted Mencini | last post by:
When I replaced older <IMG ALIGN=RIGHT ...> tags with a CSS definition <IMG class=right ...> xxx.css: IMG.right { BORDER: 0; align: right } I notice that the effect is NOT the same....
22
by: Simon | last post by:
Hi, I have written a function to trim char *, but I have been told that my way could be dangerous and that I should use memmove(...) instead. but I am not sure why my code could be 'dangerous'...
10
by: Carolyn Marenger | last post by:
I think this is an easy one, but I have not been able to find it anywhere. In HTML, I used <center><img src="whatever.gif></center> to horizontally center a graphic on a page. What is the CSS...
7
by: Alex | last post by:
Hi Everone, I need some advice on how to setup 4 columns where the outside two are absolute (120px) and the inner two (side by side) are relevent (Fluid) and change with the screen. Here's my...
3
by: deanfamily11 | last post by:
Ok, here's another problem I'm having. I've tried several different things, but I just can't get anything to be right justified. Any thoughts? #include <iostream> #include <iomanip>...
11
by: Terry Olsen | last post by:
How can I catch a right-click on a DropDownMenuItem?
19
by: ashkaan57 | last post by:
Hi, I have a page in a right-to-left language and I am trying to make some bulleted lists using <ul>, but it puts the bullets to the left. Is there any way I can set the bullets to be on the...
11
by: john_aspinall | last post by:
I want to put a simple padding on the right hand side of my text container to stop the text from overflowing out of the box. Ive added a padding-right rule and it refusing to recognise it in...
2
by: Eric Lindsay | last post by:
I hope someone can help, before I start thinking tables have a lot of merit after all. I am trying to achieve a two column layout, with source code div order main content, right side navigation,...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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:
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...

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.