Method and device for processing XML (Extensible Markup Language) packets
A technology of messages and message data, which is applied in the field of data communication and can solve problems such as the inability to parse large batches of XML messages
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Problems solved by technology
Method used
Image
Examples
Embodiment 2
[0057] Embodiment 2 of the present invention provides a method for processing XML messages, such as figure 2 As shown, a method for processing XML messages includes the following steps:
[0058] Step 201: Waiting to receive the XML message, and storing the received XML message in the first buffer area;
[0059] Step 202: updating the first counter according to the currently received XML message;
[0060] In this embodiment, updating the first counter is specifically: updating the count value of the first counter to the sum of the current count value of the first counter and the length of the received XML message;
[0061] Wherein, the initial count value of the first counter is zero;
[0062] Step 203: judging whether the count value of the first counter is smaller than the maximum storage value of the second buffer area, if yes, execute step 209; otherwise, execute step 204;
[0063] Step 204: selecting XML message data from the first buffer area, and storing the selected...
Embodiment 3
[0078] Embodiment 3 of the present invention provides a method for parsing XML message data,
[0079] Such as image 3 shown, including the following steps:
[0080] Step 301: setting a second counter according to the length of the XML message in the second buffer;
[0081] In this embodiment, the second counter is used to count the length of the XML message data in the second buffer;
[0082] Step 302: Initialize the first status bit;
[0083] In this embodiment, the initialization of the first state bit is specifically: initializing the value of the first state bit to a first preset value;
[0084] Step 303: judging whether the count of the second counter is zero, if yes, execute step 306; otherwise, execute step 304;
[0085] Step 304: Read a byte of data from the second buffer area according to the value of the first pointer variable, use the read byte data as the current byte data, and update the first pointer variable and the counting by the second counter;
[0086...
Embodiment 4
[0110] Embodiment 4 of the present invention provides a method for parsing start tags, which will be combined below Figure 4 Describe the method in detail.
[0111] Such as Figure 4 As shown, a method for parsing start tags includes the following steps:
[0112] Step 401: adding one to the value of the first depth variable, and setting a third pointer variable;
[0113] In this embodiment, the third pointer variable is used to record and obtain attribute information, tag name and tag content information;
[0114] Step 402: Initialize the second status bit and the third status bit;
[0115]In this embodiment, the initialization of the second state bit and the third state bit is specifically: initializing the values of the second state bit and the third state bit to the third preset value and the fourth default value;
[0116] Step 403: judging whether the count of the second counter is 0, if yes, execute step 406; otherwise, execute step 404;
[0117] Step 404: Read a...
PUM
Login to View More Abstract
Description
Claims
Application Information
Login to View More 