convert xml mpp java

XML is abbreviated for Extensible Markup Language. It is like some information stored between different tags for storing and transmitting purposes. On the other hand, we use the MPP file format for Project Management. You can convert XML to MPP as well as MPP to XML format files using Java language. It is helpful when you want to import or export between XML and MPP files as per your requirements. Let us proceed to the following sections for further details:

XML to MPP or Microsoft Project File to XML Conversion – Java API Installation

Aspose.Tasks for Java API support MPP, XML, MPT, HTML, and several other file formats. You can convert or import XML file to Microsoft Project file, as well as from MPP format to XML file in your Java applications. Configuring the API is quite simple as you can quickly download the JAR file from the Downloads section. Otherwise, you can specify the below Repository details in the pom.xml file of your Maven-based Java applications:

Repository:

<repository>
    <id>AsposeJavaAPI</id>
    <name>Aspose Java API</name>
    <url>http://repository.aspose.com/repo/</url>
</repository>

Dependency:

<dependency>
    <groupId>com.aspose</groupId>
    <artifactId>aspose-tasks</artifactId>
    <version>21.2</version>
    <classifier>jdk18</classifier>
</dependency>

Convert or Import XML to MPP File Programmatically using Java

Please follow the steps below for converting XML to MPP file:

  1. Load input XML file.
  2. Then load the template MPP file.
  3. Call copyTo() method of Project class.
  4. Finally, save output MPP (Microsoft Project File).

The following code snippet shows how to convert or import the XML file to MPP programmatically using Java:

Convert MPP to XML File Programmatically in Java

Microsoft Project file, MPP, stores information about project management. MPP to XML conversion is helpful when some information is to be utilized by different systems for some specific purpose. Please follow the steps below for converting MPP to XML format:

  1. Load input MPP file using Project class.
  2. Save output XML file with SaveFileFormat enumeration.

The code snippet below explains how to convert MPP to XMP programmatically with Java:

Conclusion

In conclusion, you have learned the conversion of XML to MPP and MPP to XML file format. Moreover, we have explored this topic with sample code and step by step guide with all the details. Furthermore, you may visit API Documentation to explore other features. Feel free to contact us via the Free Support Forum, in case of any query. We look forward to helping you out with your concerns!

See Also