Abstract: This paper presents an XML-based mobile terminal web browsing solution that inserts a middleware layer into the traditional client/server browsing model. The middleware layer runs on a backend server, receives client service requests, communicates with the web server to obtain the required HTML files, filters these files according to specifications, reorganizes them into XML format, and transmits them to the client via a wireless network. The client platform uses embedded Linux, which can be customized as needed. After XML parsing, it calls GUI functions to display the webpage. Keywords: Embedded browser, mobile terminal, XML parser I. Introduction Mobile terminals are constrained by mobility and portability, resulting in smaller CPU clock speeds and computing power, as well as limitations on memory capacity, display screen size, and input device size. Simultaneously, wireless data networks have relatively low bandwidth, connection reliability, and network predictability, with higher latency than wired networks. Directly connecting mobile terminals to the Internet wirelessly presents technical challenges. In recent years, the industry has proposed two approaches: First, rewriting existing Internet protocols to ensure compatibility, allowing mobile devices to access WAP-specific information and services via wireless networks through micro-browsers. Another approach is to treat mobile terminals as simplified PCs with built-in HTML browsers. While this allows free access to existing networks, the extensive use of Flash and Shockwave technologies in existing Internet websites results in large file sizes, long transmission times over wireless distances, and requires significant computing power from the mobile terminal, leading to high hardware investment. Therefore, this approach is improved to meet the requirement of small data volumes in wireless network transmission while still allowing users to access most resources on the existing network. II. XML-Based Mobile Terminal Web Browsing Model 1. Model Overview The XML-based web browsing solution inserts a middleware layer into the traditional client/server browsing model. The middleware layer receives service requests from the client, communicates with the web server to obtain the necessary HTML files, filters these files according to certain specifications, removes unnecessary tags and content, and reorganizes them into XML format files for transmission to the client via the wireless network. After passing through the XML parser, GUI graphical interface functions are called to display the webpage on the user interface. The client browser's control section is responsible for responding to user requests and handling user interactions. Its structure is shown in Figure 1. 2. Advantages and Disadvantages of Using XML in Wireless Network Browsing. Extensible Markup Language (XML) is a meta-language used to describe other languages, defining the structure of data transfer between applications. It is text that can be read by any editor. Using this mechanism, programmers can define the underlying data exchange specifications and develop various modules of the entire system on this basis. Data that conforms to established rules is transferred between modules, making it suitable for transferring structured data between computers. The built-in document parser in each browser is one of the most crucial parts, affecting the browser's operating efficiency and space efficiency. Because XML uniformly defines the standard interface specification for its document parser—DOM (Document Object Model)—applications can choose and replace appropriate parsers as needed without making major modifications to the program itself. In the browsing model, computationally intensive tasks such as HTML parsing are handled by the middle-tier server, while the client performs relatively simple XML parsing, conforming to the thin client/server information application architecture model. Currently, the biggest problem with using XML is the limited number of applications that support it; many specific applications still require developers to design them themselves. 3. Mechanism and principle of middle layer implementation VC++ 6.0 is selected as the integrated development environment for middle layer. Middle layer runs on backend server and adopts modular design. Each module is a regular dynamic link library (Regular DLL) unit, which is dynamically loaded by backend server when needed. (1) Several wireless MODEMs are connected to the backend server through multi-serial port cards to form a wireless MODEM pool to provide services to multiple mobile terminal users. When the client establishes a connection with the server, it first applies for idle resources in the MODEM pool and establishes a connection with the backend server, sends a client browser service request, and releases MODEM resources after the task is completed. If there are no available resources, it waits for a certain period of time and then applies again. (2) The backend server accesses the Internet through wired network and uses standard WWW protocol stack (HTTP, TCP/IP, etc.). When communicating with WEB server, it mainly uses three MFC classes: CInternetSession, CHttpConnection and ChttpFile. The core code is as follows: CI Internet Session session; CHttp Connection * p Server = NULL; CHttp File * p File = NULL; AfxParseURL(pURL,…); After initialization, the client's service request is converted into a standard Uniform Resource Locator (URL), and the global function AfxParseURL is called to analyze and map this URL. pServer = session.GetHttpConnection(); pFile = pServer->OpenRequest(); pFile->AddRequestHeaders(); pFile->SendRequest(); Open the client request for a specific HTTP connection and send the corresponding HTTP request message to the WEB server. pFile->ReadString(); The WEB server returns a response message, and the ReadString function of the CHttpFile class is called to obtain the returned data, completing the communication with the WEB server. (3) The parsing engine in the Dillo project browser is selected as the core of the parsing, filtering and assembly module. The process is shown in Figure 2. The HTML parsing section breaks down the input HTML data stream character by character into three categories according to HTML syntax characteristics: ① Space data type: All characters with ASCII code values between 0x09 and 0x0d or 0x20 represent spaces or placeholder information. This data is processed by the Space_proces section to determine its length. To maintain the basic HTML formatting, this type of data is stored entirely in the generated XML file. ② Tag data type: Represents all tags in the HTML data stream. Due to the limitations of HTML syntax rules, the validity of tags must be checked, for example... The label must exist