Just a heads up, I'm fairly new to Java, XML, and XSL, so bear with me. :)
I'm working on a uni assignment which has asked me to combine two XML files using Java.
While something like this would be much more straight-forward using XSL exclusively, my task was to use Java to combine said files and sort parts of the XML document in order of date attributes.
So; I have the combining working correctly but I'm trying to format my output and sort the parts in question.
In my Java code I have had to remove certain elements from the final (combined) output XML file; and I have been using x.getParentNode().removeChild(x) to do so.
This is leaving me with blank text nodes everywhere, so I have the following XSL to re-format at the final stage:
<!-- Code removed due to possible plagiarism -->
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE authors
SYSTEM "output.dtd">
<authors>
<author>
<name>AMADEO, Giovanni Antonio</name>
<born-died>b. ca. 1447, Pavia, d. 1522, Milano</born-died>
<nationality>Italian</nationality>
<biography>Giovanni Antonio was....</biography>
<artworks form="architecture">
<artwork date="1473">
<title>Façade of the church</title>
<technique>Marble</technique>
<location>Certosa, Pavia</location>
</artwork>
</artworks>
</author>
</authors>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE authors SYSTEM "output.dtd">
<authors>
<author>
<name>AMADEO, Giovanni Antonio</name>
<born-died>b. ca. 1447, Pavia, d. 1522, Milano</born-died>
<nationality>Italian</nationality>
<biography>Giovanni Antonio Amadeo was an Italian early Renaissance sculptor, architect, and engineer. In 1466 he was engaged as a sculptor, with his brother Protasio, at the famous Certosa, near Pavia. He was a follower of the style of Bramantino of Milan, and he represents, like him, the Lombard direction of the Renaissance. He practised cutting deeply into marble, arranging draperies in cartaceous folds, and treating surfaces flatly even when he sculptured figures in high relief. Excepting in these technical points he differed from his associates completely, and so far surpassed them that he may be ranked with the great Tuscan artists of his time, which can be said of hardly any other North-Italian sculptor.</biography>
<artworks form="architecture">
<artwork date="1473">
<title>Façade of the church</title>
<technique>Marble</technique>
<location>Certosa, Pavia</location>
</artwork>
</artworks>
</author>
// Code removed due to possible plagiarism.
We determined in the comment thread that you were loading Saxon in your Eclipse project, but Xalan in your standalone Java application.