|
| |||||||||
| Tags: j2me, java, parse xml, parser, xml, xml in j2me |
![]() |
| | Thread Tools | Search this Thread |
|
#1
| |||
| |||
| How to parse XML in J2ME
Hi all, XML has been widely used in the field of data exchange, xml is based on plain text, with excellent cross-platform features. I want how to parse XML in J2ME for data transmission. Please suggest. Thanks in advance. |
|
#2
| ||||
| ||||
| How to parse XML in J2ME
Before the use of XML, you must consider the good and not have to use it to transmit data, because xml parsing is more resource-intensive, especially in the CPU and memory resources are precious conditions. If we can use DataInputStream and DataOutputStream, then transfer to try not to use XML. XML parser, there are two, one is sure of, he would have xml parsing of the document prior to the effectiveness of verification, to ensure that it is the application needed. Check and reply. |
|
#3
| |||
| |||
| How to parse XML in J2ME
Written in XML is relatively simple and very easy to people to read. But it must be the client and server-side XML parser can have a normal communication, because of the initial mobile information device memory and processor on the lack of, so MIDP1.0 did not provide XML support.You can use kxml. To use the kxml, you must first get a XmlParser instance, it uses Reader as the constructor parameters. Check that and reply. Code: try ( Reader r123 = .....; XmlParser parser = new XmlParser (r123); } catch (java.io.IOException e) ( / / Handle exception .... } |
|
#4
| ||||
| ||||
| How to parse XML in J2ME
If you want to use nanoxml for parsing XML in J2ME, then you must first create an kXMLElement instance, and then call parseFromReader, parseString or parseCharArray. Because it is the first step parser, then it will parse the entire document exhausted generate an Object tree. Each node is a kXMLElement instance, by calling getChildren methods such as navigation in this tree. Code: HttpConnection conn123 = ....; InputStreamReader doc123 = new InputStreamReader (conn.openInputStream ()); kXMLElement root123 = new kXMLElement (); try ( root.parseFromReader (doc123); } catch (kXMLParseException pe) ( } catch (IOException ie) ( } |
|
#5
| ||||
| ||||
| How to parse XML in J2ME
With the improvement of memory and processors of XML support as possible. JSR182 is provided in the XML parser, but this is not the standard MIDP in the API require a specific implementation can support. Fortunately, there is a third-party API provides support for parsing xml to compare well-known is the kxml and nanoxml. You can download this parser from website. Best of luck. |
|
#6
| ||||
| ||||
| Re: How to parse XML in J2ME
The other parser is non-confirmation in nature, They does not do validation work directly parsing, no doubt such a speed would be faster. kxml and parser nanoxml are like this. They are also differences, kxml incremental parser that he will bit by bit resolution, so that when parsing large documents will be more efficient. nanoxml parser is the first step, once put the document parsing finished, if the document is very large, it will undoubtedly cost a great memory. Check and reply. ![]() |
![]() |
|
| Thread Tools | Search this Thread |
| |
Similar Threads for: "How to parse XML in J2ME" | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to add parse in scanner in java? | MAGAR | Software Development | 5 | 02-03-2010 04:30 PM |
| How to Parse XML in ASP | Dwarner | Software Development | 4 | 24-01-2010 04:27 AM |
| How to parse msExchRecordedName? | Kartik Subbarao | Active Directory | 1 | 03-12-2009 01:01 AM |
| How to Parse CSV file using PERL | Xena | Software Development | 3 | 31-08-2009 11:38 AM |
| PHP Parse error: parse error unexpected $ in main.php on line 12 | ΘN-TH3-ЯΘCKZ | Software Development | 3 | 20-08-2009 07:07 PM |