473,396 Members | 2,020 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.

should I use xml or array?

I am creating a page where I want to dynamically fillin the contents of a
table based on user selections.

The page is created from a cgi.

I have a number of rows, say 150 that I want to hide in the page, either
with a xml or in an array as per below.

I don't which one I'd like to use

The xml would look like:
<xml id="test1">
<root>
<data>
<col1></col1> <col2></col2>
</data>
<data>
<col1></col1> <col2></col2>
</data>
Jul 23 '05 #1
1 1544
Michael Hill wrote:

Your post has sat for a few hours, probably because it is unclear what
you are trying to do. I don't think a choice of XML or array is your
problem - they aren't really competing technologies. XML is for
transmitting data, arrays are for storing, manipulating and retrieving
data in memory.
I am creating a page where I want to dynamically fillin the contents of a
table based on user selections.
This points to using a select with options. The values you want in the
table can be either the value of the option or the displayed text (or
both) that the user selects. You can use different elements to
populate your table, it doesn't have to use just one type of UI
element.

You could also use radio buttons or checkboxes where appropriate.

The page is created from a cgi.
Is this relevant? I presume you want the client to be doing this
stuff, not the server?

I have a number of rows, say 150 that I want to hide in the page, either
with a xml or in an array as per below.
Rows? Or do you mean records? How are you associating data items with
user selections? It doesn't necessarily preclude using select and
option elements as above, but it might.

I don't which one I'd like to use [...]

So either XML or CSV? How do the data get into the array? Do you
want to read a file from the server or load the data in the page?
Using selects and options will still do the trick.
I have the requirement to dynamically use javascript to populate some
portions of my page from either the array or xml structure.

I also have the requirement to present some of my data in sorted form.
You can use XSLT to sort XML, but as far as I know, there are no
cross-browser solutions (but I haven't looked at it seriously in a
little while).

But an array would be very much faster, since it would be already in
memory.

My questions then are:

1) Which method would be faster to post to the page, a) data from the array,
or 2) data from the xml.
Post? Do you mean load into the page? Almost certainly CSV, though it
is not in vogue. XML would be 3 to 5 times more bulky and costs a lot
more to parse.

2) Seeing that I have a requirement to sort, is there anyway I can sort the
contents of the xml in place, then pull from it.
"in place"? Is that on the server? On the client? Pull it from where?

3) I typically have some problems with data loaded to arrays, because users
like to add double and single quotes to data structures and once put into an
array produce errors and prevent the page froml loading so if the data is
loaded in an xml structure I shouldn't have this problem should I?
So users can not only select data, they can key it in too? When you
read the value of a text or textarea, it is a string. You do not need
to worry about what is in the string unless you are going to parse it
or do something with it (like send it back to the server) but using
escape() fixes that.

Any comments appreciated.


Sorry I couldn't be more helpful. Perhaps if you posted a small
example of what you are trying to do...

--

Fred.

Jul 23 '05 #2

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

Similar topics

8
by: User | last post by:
Hi, This is very basic, It may be a repost, if so I'm sorry. The problem is that this declaration : Private strMyArray(100) As String will create an array of string with a length of 101,...
4
by: Steven T. Hatton | last post by:
I mistakenly set this to the comp.std.c++ a few days back. I don't believe it passed the moderator's veto - and I did not expect or desire anything different. But the question remains: ISO/IEC...
12
by: melanieab | last post by:
Hi, I'm trying to check and see if something other than numbers (either the +, -, *, or /) are entered into a textbox, where bigR is what I call the text in the textbox. I can get what was...
3
by: AFN | last post by:
I need to manually create the data to be shown in a datagrid (or some data table object). Should I create an array and bind the array to the datagrid OR should I create a temporary dataset and...
3
by: assgar | last post by:
Hi I thought I had resolved this problem but I am intermittently the receving the warnings below. This code consist of a 1) HTML form, 2) a display function on the HTML form and 3) a...
0
by: neehakale | last post by:
This is the code for the bubble sort Algorithm in c#....pls anybody tel me where should i write the display statment in thos code to see the output of every iteration... static void Main(string...
2
by: gm04030276 | last post by:
hey, i'm basically trying to use php sessions and a bit of javascript to make tabbed browsing within a web page using sessions to store the data of the different opened pages. Problem: when i unset...
2
by: javamama | last post by:
Hi, I programmed a web page where two parallel maps can be explored with moving the cursor on the summer and winter buttons. The active button should turn red but now the right hand buttons turn...
19
by: est | last post by:
From python manual str( ) Return a string containing a nicely printable representation of an object. For strings, this returns the string itself. The difference with repr(object) is that...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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?
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
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
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
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
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...

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.