| As Excel has strong ability to represent and process data, and it is used easily and with very low cost, it performs a vital role in process of informatization for small and medium-size businesses.At the same time mostly application systems must interact with Excel and provide the function of exporting and importing data. With popularization of XML, and it become the standard of data exchange gradually, some professionals have researched on converting Excel to XML in application. More important, both Microsoft Excel XP and later versions provide great support for XML.With the limited functionality of converting Excel to XML manually, this paper firstly suggests a way to automatically convert Excel to XML. It uses two layer mapping (template maps to template structure tree, and template structure tree maps to XML Schema). Firstly XML Schema is generated automatically from Excel template and the mapping path of each cell data are also automatically recorded; then the related XML document which is in accord with template is automatically separated from Excel report data by the Excel Map mechanism . Then the component of converting Excel to XML automatically is designed and implemented based on the way.This component is implemented under the .NET environment following the CLR component standard finally, and the component released has reusability strongly, not only crossing developing languages under.Net environment but also crossing developing platform throught interoperating with COM. Finally it be applied into the practical project that "The Common Data Acquisition and Summarizing Platform" and the problem of data acquisition and summarizing faced by enterprise is resolved effectively. The core idea is that saved xml converted from Excel into large database to realize data acquisition automatically and queried data from database by means of XQuery and inserted the data into cell of summarizing template to realize data summarizing automatically.Practice has proved that the component used will be much easier to collect data from Excel report and be more advantageous to system's expansion and integration. |