Results 1 to 12 of 12
- 04-22-2012, 03:22 PM #1
Member
- Join Date
- Aug 2011
- Posts
- 62
- Rep Power
- 0
- 04-23-2012, 11:10 AM #2
Moderator
- Join Date
- Apr 2009
- Posts
- 10,484
- Rep Power
- 16
Re: Client-side or server-side XML parsing?
Where's the XML?
If it's on the server then is the amount of data (ie size) you have after transforming it into whatever format you want to display less than the XML file or more?Please do not ask for code as refusal often offends.
- 04-23-2012, 11:51 AM #3
Member
- Join Date
- Aug 2011
- Posts
- 62
- Rep Power
- 0
Re: Client-side or server-side XML parsing?
The XML is located on the server and it's used to fill the JSP pages with textual content. The parsing could be done client-side with JavaScript or server-side, but I don't know which approach is better.
- 04-23-2012, 02:03 PM #4
Moderator
- Join Date
- Apr 2009
- Posts
- 10,484
- Rep Power
- 16
Re: Client-side or server-side XML parsing?
So that leads to point 2.
Is the data the XML is turned into (HTML tags etc) more or less than that held in the XML?
Would translating on the server require too large an amount of resources (ie memory) under high load?
And so on...
Personally I'd do it on the server unless doing so was unscalable...that is, you can't stream the result directly to the client without having to hold it in memory.Please do not ask for code as refusal often offends.
- 04-23-2012, 02:17 PM #5
Senior Member
- Join Date
- Apr 2012
- Location
- New York State of Confusion, USA
- Posts
- 137
- Blog Entries
- 1
- Rep Power
- 0
Re: Client-side or server-side XML parsing?
Not to contradict Tolls, but XML processing can be expensive (in terms of usage of compute resources) and can contribute to scaling problems if you are do this in high-volume requests. It isn't just a matter of the size of the XML vs. the size of what the XML is used to create. Depending on the circumstances, you can think of the clients as a gang of distributed parallel XML processors. Doing it in the client enables you to push that compute burden out of your server.
If the XML is being used to pass name/value pairs types of data, of constructs of the same, you might consider using JSON instead.
- 04-23-2012, 02:45 PM #6
Moderator
- Join Date
- Apr 2009
- Posts
- 10,484
- Rep Power
- 16
Re: Client-side or server-side XML parsing?
Which is one possibility to where I was heading.
But the OP wasn't exactly open with the requirements.
If your XML and XSLT's aren't convoluted mushes that will require the full loading of the XML into memory in order to parse and transform then the footprint would be negligible.
If the XML is a single hefty file containing static text used to fill in the page, including stuff that may not be included in any one particular page, then dumping this onto the client each time may not be a good idea (as well as being a potential security problem, who knows).
Without knowing what the OP is doing, making any concrete suggestions without huge caveats (eg my "unscalable" one above) is not actually possible.Please do not ask for code as refusal often offends.
- 04-23-2012, 02:56 PM #7
Member
- Join Date
- Aug 2011
- Posts
- 62
- Rep Power
- 0
Re: Client-side or server-side XML parsing?
Ok, thank you. So in case of doubt it is always better to parse the XML on the client-side. Is there any XML parser that can be recommended?
- 04-23-2012, 03:00 PM #8
Moderator
- Join Date
- Apr 2009
- Posts
- 10,484
- Rep Power
- 16
Re: Client-side or server-side XML parsing?
I would disagree.
But without any idea what your requirements are I really couldn't say.Please do not ask for code as refusal often offends.
- 04-23-2012, 03:19 PM #9
Member
- Join Date
- Aug 2011
- Posts
- 62
- Rep Power
- 0
Re: Client-side or server-side XML parsing?
Thanks for all your answers.
The XML file shall contain data about different countries (including tags for the name of the country, the gross domestic product, a textual description, area, population etc.). Basically, the content should be similar to a small wikipedia article.
Another question is, if it is better to build such a small projekt with JSP or JSF. Of course I have read articles about both of them and I know that JSF is based on JSP, but I am not sure if it is advantageous to start with JSF after having read the JSP basics.Last edited by noodle_variation_187-X; 04-23-2012 at 03:32 PM.
- 05-21-2012, 11:23 AM #10
Moderator
- Join Date
- Apr 2009
- Posts
- 10,484
- Rep Power
- 16
Re: Client-side or server-side XML parsing?
Only if you're using an old browser (eg IE5 or 6).
Anything post that has a built in parser.
And as for the potted history of xslt, that's not actually correct. Yes, it is used for that, but that was not the only reason XSLT was created. It was reated to (not surprisingly) allow transformation of the raw XML data, which is not necessarily easily readable, into a more useable format, which not only covers useable by another system, but also useable by humans. So transforming XML data into reports, for example. Providing mutliple stylesheets for different output formats has been one of the most common uses of it since its creation.Please do not ask for code as refusal often offends.
- 05-21-2012, 01:54 PM #11
Moderator
- Join Date
- Apr 2009
- Posts
- 10,484
- Rep Power
- 16
Re: Client-side or server-side XML parsing?
But that, presumably, would be down to the developer (him up there) to determine.
In any case I do agree, it's not something I would like to fob off onto the client, so it's a bit moot in that respect, but I do see it as a tool for basic reporting. After all, if you already have the data then an xslt is pretty easy stuff to put together to produce email, html, or whatever versions. Saves turning it into objects and feeding it to, say, velocity.Please do not ask for code as refusal often offends.
- 05-31-2012, 09:06 AM #12
Member
- Join Date
- Mar 2012
- Posts
- 41
- Rep Power
- 0
Similar Threads
-
Calculations in Server side with client`s data
By thitami in forum Threads and SynchronizationReplies: 8Last Post: 11-19-2011, 03:49 PM -
how to access Ms Access from client side to server side
By arunkumarinfo in forum JDBCReplies: 1Last Post: 03-20-2010, 07:03 PM -
NIO Server: listening on client's side socket
By carek in forum NetworkingReplies: 1Last Post: 12-24-2009, 07:30 AM -
How to open a file located in server from client side
By Malathi in forum Web FrameworksReplies: 4Last Post: 04-20-2009, 09:10 PM -
Copy a .swf file from server side to client using signed applet
By Imoracle in forum Java AppletsReplies: 2Last Post: 10-05-2008, 06:13 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks