Support mobile phone to use method and the middleware that carries the browser-presented structured document
Technical field
The present invention relates to a kind of mobile phone of supporting and use method and the middleware that carries the browser-presented structured document.
Background technology
Usually mobile phone is if desired to Microsoft office class document in the network system, Adobe PDF document, txt document (text document), and zip compressed format files etc. check that just must corresponding documents editing software to be installed just passable, and the form user of install software not only uses trouble, and the installation of software for the performance requirement of mobile phone terminal also than higher, open bigger slightly document and will cause mobile phone to crash the user experience extreme difference because of consumes resources is more.
XML(Extensible Markup Language) be extend markup language, it is the same with HTML, all is SGML (Standard Generalized Markup Language, standard generalized markup language).
HTML(Hyper Text Mark-up Language) being HTML (Hypertext Markup Language) or HTML, is the language that is most widely used on the present network, also is the main language that constitutes web document.
DOM=Document Object Model, DOM Document Object Model, DOM can visit and revise the content and structure of a document in a kind of mode that is independent of platform and language.In other words, this is expression and the common method of handling a HTML or XML document.
XHTML can expand hypertext markup language (eXtensible HyperText Markup Language), is a kind of markup language, and (HTML) is similar for manifestation mode and hypertext markup language, but strict more on the grammer.
The WML(WAP Markup Language, Wireless Markup Language) be a kind of script, the content that it is write than HTML is wanted consumption network browser internal memory and CPU time still less, makes WML friendly more concerning wide area network and mobile device.
WAP(Wireless Application Protocol) being WAP (wireless application protocol), is a global network communication protocol.
The Office(full name: Microsoft Office), be the office software of a cover by Microsoft exploitation, it is developed for Microsoft Windows and Apple Macintosh operating system.
PDF is the portable file layout of Portable Document Format() abbreviation, be a kind of electronic document format, irrelevant with operating system platform, form by the exploitation of Adobee company.
Summary of the invention
The invention provides a kind of method and middleware of supporting mobile phone to use to carry the browser-presented structured document for addressing the above problem.
The technical scheme that the present invention solves the problems of the technologies described above is as follows: a kind of mobile phone of supporting uses the system that carries the browser-presented structured document, it comprises middleware, described middleware comprise the document flow of obtaining document files the reception information module, with the document flow of reading in resolve to the XML form first parsing module, the file conversion of this XML form is become first modular converter of html format file, html file is carried out second parsing module of DOM structure elucidation and html file is converted to second modular converter of the WAP page form of XHTML or WML.
A kind of mobile phone of supporting uses the method that carries the browser-presented structured document, and it may further comprise the steps:
Step 1: mobile message conversion middleware (middleware is a kind of independently system software or service routine, and Distributed Application software is by this software shared resource between different technology) obtains the document flow of document files;
Step 2: the document flow of reading in is resolved to the XML form;
Step 3: the file conversion of this XML form is become the html format file;
Step 4: html file is carried out the DOM structure elucidation;
Step 5: the WAP page form that html file is converted to XHTML or WML.
Further, the process of obtaining document flow in the described step 1 is:
Step 1.1: receive user's request, and obtain the parameter of the file that the user will open;
Step 1.2: judge whether the parameter in the typelib of setting is corresponding with the parameter in the step 1.1, judge then that as correspondence the type of file is also preserved, as the not corresponding next step that then continues;
Step 1.3: judge whether the file that the user will open is compressed file, if then obtain the tabulation of compressed file and return step 1.1, if not, then continue next step;
Step 1.4: whether the type of judging file is the file type that can resolve, if then judge its type and preservation, if not file type that then is set to give tacit consent to and preservation.
Further, described step 2 becomes document analysis the routine library of XML for by increasing income engineering POI(Point of Interest) document flow of reading in is resolved to the XML form.
Further, described step 3 concerns that with the File mapping of html format the file conversion with this XML form becomes the html format file for the file according to the XML form.
Further, described step 5 is according to HTML that sets and the mapping relations of XHTML or WML, html file is converted to WAP page formatted files such as XHTML or WML.
Further, described step 4 is: middleware carries out the DOM structure elucidation with html file, and nonstandard form in the file is proofreaied and correct.
The invention has the beneficial effects as follows: mobile phone can directly be opened and check doc in the office2000-2007 version, (XLS is exactly a Microsoft Excel worksheet to xls, be a kind of spreadsheet format very commonly used), ppt(PPT, a kind of PowerPoint graphic package is that Power Point is called for short), and Adobe PDF, the ZIP of compressed format, type files such as text TXT need not to install other document softwares or download document.
Description of drawings
Fig. 1 is the structural representation of middleware of the present invention;
Fig. 2 uses the process flow diagram of the method that carries the browser-presented structured document for the present invention supports mobile phone.
Embodiment
Below in conjunction with accompanying drawing principle of the present invention and feature are described, institute gives an actual example and only is used to explain the present invention, is not to be used to limit scope of the present invention.
As shown in Figure 1, a kind of mobile phone of supporting uses the system that carries the browser-presented structured document, it comprises the middleware that is used for mobile message conversion, described middleware comprise the document flow of obtaining document files the reception information module, with the document flow of reading in resolve to the XML form first parsing module, the file conversion of this XML form is become first modular converter of html format file, html file is carried out second parsing module of DOM structure elucidation and html file is converted to second modular converter of the WAP page form of XHTML or WML.
As shown in Figure 2, a kind of mobile phone of supporting uses the method that carries the browser-presented structured document, and it may further comprise the steps:
Step 1: middleware (middleware is a kind of independently system software or service routine, and Distributed Application software is by this software shared resource between different technology) obtains the document flow of document files;
Step 2: by the engineering POI that increases income (Point of Interest becomes document analysis the routine library of XML), middleware resolves to the XML form with the document flow of reading in earlier;
Step 3: middleware becomes the html format file with the file conversion of this XML form;
Step 4: middleware carries out the DOM structure elucidation with html file;
Step 5: middleware converts html file to the WAP page form of XHTML or WML.
The process of obtaining document flow in the described step 1 is:
Step 1.1: middleware receives user's request and obtains the parameter of the file that the user will open;
Step 1.2: judge whether the parameter in the typelib of middleware is corresponding with the parameter in the step 1.1, then judge the type of file and preserve as correspondence, as the not corresponding next step that then continues;
Step 1.3: judge whether the file that the user will open is compressed file, if then obtain the tabulation of compressed file and return step 1.1, if not, then continue next step;
Step 1.4: whether the type of judging file is the file type that can resolve, if then judge its type and preservation, if not file type that then is set to give tacit consent to and preservation.
Described step 3 concerns that for the file of middleware by the XML form and the File mapping of html format the file conversion with this XML form becomes the html format file.
Described step 5 is a middleware according to HTML that sets and the mapping relations of XHTML or WML, html file is converted to WAP page formatted files such as XHTML or WML.
Described step 4 is: middleware carries out the DOM structure elucidation with html file, and nonstandard form in the file is proofreaied and correct, and the format conversion that is about to picture is the size that mobile phone can be browsed, and form that mobile phone can browse etc. is changed in the composing of file.As the paired label<table of XHTML normalized definition〉do not write</table the time, can proofread and correct automatic interpolation</table.
By our mobile message conversion middleware platform (MITM), can be directly with the documents such as word, excle of Microsoft office, Adobe PDF document txt document, and structured document such as zip compressed format files is directly changed into the XHTML that the mobile phone terminal browser directly supports or the text form web page of WML form, format conversion is carried out at server end entirely, mobile phone terminal only need carry the document after browser gets final product the online reading conversion, and need not to install other any document software
The above only is preferred embodiment of the present invention, and is in order to restriction the present invention, within the spirit and principles in the present invention not all, any modification of being done, is equal to replacement, improvement etc., all should be included within protection scope of the present invention.