The EML previewer may not display the exact same results as those shown in the metadata viewer after a package has been uploaded, as the previewer does not apply the whitespace normalization that is a step in creating the Level-1-EML.xml that is displayed after package upload.
Also make sure that any other formatting steps that are performed when creating the Level-1-EML.xml are included in the previewer. Ideally, refactor the two methods to one.
The EML previewer may not display the exact same results as those shown in the metadata viewer after a package has been uploaded, as the previewer does not apply the whitespace normalization that is a step in creating the Level-1-EML.xml that is displayed after package upload.
Also make sure that any other formatting steps that are performed when creating the Level-1-EML.xml are included in the previewer. Ideally, refactor the two methods to one.