After reading the relevant information, it is summarized as follows: We need to consider the use of Microsoft's Open XML SDK architecture; Under Microsoft's structure, all Word files are actually a zip file package, where there is a document.xml file that needs to be replaced by the file; The approximate process is: Prepare a Word template file, There are document.xml files (which can be opened for viewing with WinRAR software); Prepare XML files that need to be converted, such as Demo.xml, and write XSLT files that convert demo.xml files that need to be converted to Document.xml, based on the first two; Then use the Word software to open the Word template file (which has the Word template file renamed: docx-> zip-> docx). Related information: Generate Word documents with Xslt-stefan kapfererusing XSLT and Open XML to Create a Word Document or consider the second way : Use Apache's poi to write Java applications to consider conversions. Apache Poi-case Studies
Using XSLT to convert XML to Word