newbie needs HELP: howto parse a single line 2003-01-20 - By Christopher Ebert
Hi,
There are examples* of reading a simple document for DOM and SAX -- wrap your input in an appropriate reader (e.g. if you read it into a string a StringReader) and parse from that. If you're wondering whether to use SAX or DOM -- well for such a small document I'd say it won't matter much. I think DOM is easier to work with (you get an object that represents the document and you can twiddle it and fetch data out of it...) so I'd go with that.
Cheers, Chris
* samples/dom/DOMCount.java reads a file from a URI and does some stuff with it.
-----Original Message----- From: Ray Clouse [mailto:clouse@(protected)] Sent: Monday, January 20, 2003 9:49 AM To: xerces-j-user@(protected) Subject: newbie needs HELP: howto parse a single line
I've not done much with Java and never done anything with XML, and I've looked all over for a simple example with no luck. So please excuse my newbieness.
My Java client opens a socket and reads the following XML data:
<wind_status><source>TOWER1</source><azimuth>052</azimuth><speed>195</speed>< /wind_status> How do I parse this so I can use it? I'm going to use the data to draw a vector showing wind strength & direction.
-- ------------------------------------------------------------------------ Ray Clouse STICS Lab ray.clouse AT boeing.com Don't fear the penguins. clouse AT rayclouse.org
--------------------------------------------------------------------- To unsubscribe, e-mail: xerces-j-user-unsubscribe@(protected) For additional commands, e-mail: xerces-j-user-help@(protected)
--------------------------------------------------------------------- To unsubscribe, e-mail: xerces-j-user-unsubscribe@(protected) For additional commands, e-mail: xerces-j-user-help@(protected)
|
|