When to parse XML strings

wxdqz

New Member
A little background. I've created an application using Java LiveConnect technologythat receives an request (like an parts request) from a html page (usingjavascript) and sends the data to a backend database. The database findsall of the information about the part and sends it back to the javascriptin the html page through the java applett. The program works just fine soI have no problems there. To make it short, when I send a request the argumentlooks like the following:mom.send("<EXEC><PART>" + partnum + "</PART><LOCATION>" + loc + "</LOCATION><AVAIL>"+ instock + "</AVAIL></EXEC>");Note that my string I pass is an XML string. The data I receive back fromthe backend through the Java session it will look the same but all of thevariable fields will be filled with data. Finally my question.When would be the proper time to parse this XML string?I could parse it using Java at the applett before I actually send it backto the javascript. Then instead of sending one large XML string to the htmlpage, I could send back the XML arguments one at a time as I parse them.The second option would be to send the entire XML string to the Javascriptembedded in the html and let the Javascript parse it. I would probably haveto just use string functions to parse it at this level. The end result isI need to update fields that fill my html page by parsing the XML stringat the Java level or Javascript level. Has anyone had to populate a htmlpage using an XML string? The XML string may contain as much as 100+ argumentswhen passed back and forth if this makes a difference. Just asking for opinionshere from anyone who may have done this and ran into any problems eitherway.J. Crew
 
Back
Top