The invention relates to the field of computer document conversion and provides a method for converting an
XML Schema document into an SCORM document in order to solve the problems that an existing
XML conversion method is large in manual interaction amount and
algorithm calculation amount and often not ideal in division result, and the method comprises the steps that 1, a temporary
directory and subdirectories of the temporary
directory under an SCORM data packet
directory are emptied; 2, clearing a directory where the
XML data packet is located and a subdirectory of the
XML data packet after the
XML data packet is decompressed; step 3, decompressing the
XML data packet; step 4, obtaining a plurality of
data source packets after the
source data packet is decompressed, and storing the
data source packets into Listt; the method comprises the following steps of: carrying out extraction and purification on Pu < {EN0} > Modulet; middle; 5, traversing the
source data packet in the
List to obtain a
current source data packet; 6, analyzing the
xml file in the
source data packet, extracting data from the XML file, and constructing a
data structure; constructing
directory structure information according to an analysis result; and step 7, packaging the data packet, and publishing the data packet as an SCORM data packet. According to the method, a plurality of
xml files are analyzed by using an
open source framework VTD-XML, and rapid analysis, traversal and the like are also provided.