Meaningless Drivel is fun!*
The moose likes XML and Related Technologies and the fly likes client's side parsing using IE 5.0 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "client Watch "client New topic
Author

client's side parsing using IE 5.0

Ashish Jain
Ranch Hand

Joined: Sep 23, 2000
Posts: 50
guyz,
i hav developed LAN web-app in-which i am using xml+xslt to generate HTMLs. Right now i am using server-side parsing , but i want to parse at client-side to make it efficient. So is there any tool/control which will load at login page and installs MS paser 3.0 or greater w/o requiring client interrupting anything.
Thanks
...Ashish


Ashish Jain<br />MCP, SJCP, IBM XML, SCEA
Ajith Kallambella
Sheriff

Joined: Mar 17, 2000
Posts: 5782
I'm not a great fan of client side parsing as it incurs significant performance overheads and client(browser) memory. However, it is possible to use inline java code( jsp ) to instantiate MSXML browser. Your best bet for an example program would be one of the MSXML pages.


Open Group Certified Distinguished IT Architect. Open Group Certified Master IT Architect. Sun Certified Architect (SCEA).
Ashish Jain
Ranch Hand

Joined: Sep 23, 2000
Posts: 50
Thanks ajith for reply,
I think, u didn't get my problem situation here.
I am getting XML data from backend EJBs instead of java beans.
Now i am parsing that XML using XSLT into HTMLs. then i send back HTMLs to frontend.
Now in multi-user environment, i am using lot of system resources/time in parsing at server-side. If client's browser is able to parse xml, then i just need to pump xml to client-side. Ofcourse i get other advantages in sending xml to client-side, like performance, less server round trip, more dynamic options on client-side etc etc.
Now my client is not expected to do any technical work in manual installing ms parser 3.0 kinda stuff!!. So i want to automate this, like when he hits login screen, then jscripts detect that whether he got parser ver 3.0 or not. If he hasn't got parser installed, i want to install parser in his browser auotmatically like we do in plug-ins
Thanks
Ashish
Anish Raj
Greenhorn

Joined: Nov 28, 2001
Posts: 5
Hello!!
IE has a built in XML parser( your client doesn't have to do anything special for this) the following is an sample HTML file which works fine for me

<html>
<script language="JavaScript">
var text="<note>"
text=text+"<to>Harish</to><from>Raj</from>"
text=text+"<heading>Reminder</heading>"
text=text+"<body>Don't forget me this weekend!</body>"
text=text+"</note>"
var xmlDoc = new ActiveXObject("Microsoft.XMLDOM")
xmlDoc.async="false"
xmlDoc.loadXML(text)

// ....... processing the document follows
document.write
("The first file was sent to ")
document.write
(xmlDoc.documentElement.childNodes.item(0).text)
document.write
(" by ")
document.write
(xmlDoc.documentElement.childNodes.item(1).text)
</script>
</html>

Anish

Originally posted by Ashish Jain:
Thanks ajith for reply,
I think, u didn't get my problem situation here.
I am getting XML data from backend EJBs instead of java beans.
Now i am parsing that XML using XSLT into HTMLs. then i send back HTMLs to frontend.
Now in multi-user environment, i am using lot of system resources/time in parsing at server-side. If client's browser is able to parse xml, then i just need to pump xml to client-side. Ofcourse i get other advantages in sending xml to client-side, like performance, less server round trip, more dynamic options on client-side etc etc.
Now my client is not expected to do any technical work in manual installing ms parser 3.0 kinda stuff!!. So i want to automate this, like when he hits login screen, then jscripts detect that whether he got parser ver 3.0 or not. If he hasn't got parser installed, i want to install parser in his browser auotmatically like we do in plug-ins
Thanks
Ashish


[This message has been edited by Anish Raj (edited December 05, 2001).]
Ashish Jain
Ranch Hand

Joined: Sep 23, 2000
Posts: 50
thanks for reply!!
well, i know that IE comes with xml parser BUT version 2.6, (except IE 6). And my xslt and xmls are written for msxml parver version 3.0 So i need to upgrade parser of client's browser something using script or control, something automatic!!
...Ashish
Ajith Kallambella
Sheriff

Joined: Mar 17, 2000
Posts: 5782
Ashish,
Now in multi-user environment, i am using lot of system resources/time in parsing at server-side.
Isn't that the reason why server-side processing is better? Server is traditionally defined as a machine that has more memory, computing power and other resources using which it can efficiently handle multiple client requests.
If client's browser is able to parse xml, then i just need to pump xml to client-side. Ofcourse i get other advantages in sending xml to client-side, like performance, less server round trip, more dynamic options on client-side etc etc.
How do you ensure a common degree of compliancy between different parsers on the clients? If the client parser is not compatible with some XML feature that is used in the XML cooked by the EJB, that particular client will not be able to make sense out of data. If you let the client do parsing/processing, aren't you making some assumptions such as all the clients understand the XML that you produce?
Can you explain more about "less server round trip?" In a typical server-side processing scenario the server generates the renderable format and gives it to the client. Where are additional round-trips coming from?
Now my client is not expected to do any technical work in manual installing ms parser 3.0 kinda stuff!!. So i want to automate this, like when he hits login screen, then jscripts detect that whether he got parser ver 3.0 or not. If he hasn't got parser installed, i want to install parser in his browser auotmatically like we do in plug-ins
Have you decided at this point of time that your clients will only be using MS parser? ( if the answer is yes, then ignore my second question ). What if you want to extend your user base and some people want to use Netscape? What if you stump on a shortcoming of MS parser seven months down the line? How do you make sure clients don't upgrade their parsers without telling you? What happens if they do, and the new version of the MS parser( say, 4.0 ) has some features that may change the processing/redering?

As you can see, I am raising some valid concerns about client-side processing. I am not a great advocate of client side logic simply because there are too many variables in the equation. Things can go terribly wrong and it can result in a maintenance nightmare.
Think about it.
Cheers!
------------------
Ajith Kallambella M.
Sun Certified Programmer for the Java�2 Platform.
IBM Certified Developer - XML and Related Technologies, V1.
Co-author of Java 2 Certification Passport
 
Consider Paul's rocket mass heater.
 
subject: client's side parsing using IE 5.0