473,753 Members | 6,232 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1571
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
427
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, but the length should be only of 100 (0 to 99).
4
4738
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 14882:2003(E) §8.5 says:   To zero-initialize an object of type T means: 5   -- if T is a scalar type (3.9), the object is set to the value of 0 (zero) converted to T;
12
1497
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 entered and where along the string (the where part is the first section of below). I'm running into trouble just after that. I tested what the value of breakpt and got 3, which it should be if entering something like 100 + 200. But when I run the for...
3
2327
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 bind that to the datagrid? I have never done either (usually I get a recordset from a stored procedure and bind results directly). I also don't know which is faster. Whichever you suggest, can you give a couple lines of sample code? Thank...
3
3738
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 process to manage the form input. Can you show me what I am doing wrong and or how to correct it ?
0
1040
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 args) { //here we are creating an array of 5 //that elements,taht are unsorted int Array=new int{10,45,23,49,1,0}; int i,j,temp; //total passes=Array.Length-1=5 in our case for(i=(Array.Length-1);i>=0;i--)
2
2033
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 the first 0 index in the array (ie close the default page) it seems to wipe the other one (can't get it to add more that one anymore) from the array also the information is held in sub array $_SESSION each page has its own array of infomation...
2
1270
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 red instead of the left ones. Where's the problem? <HTML> <META HTTP-EQUIV="Refresh" CONTENT=300> <HEAD><TITLE>Parallel Visual Exploring</TITLE></HEAD>
19
5340
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 str(object) does not always attempt to return a string that is acceptable to eval(); its goal is to return a printable string. If no argument is given, returns the empty string, ''.
0
8896
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9653
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...
0
9451
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9421
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
9333
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
8328
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
4771
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4942
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2284
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.