Skip to content

Commit

Permalink
Fixes metadata
Browse files Browse the repository at this point in the history
Various fixes to writing of metadata
  • Loading branch information
ThomasDaheim committed Feb 4, 2018
1 parent 7dcdb2a commit 5045571
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/com/hs/gpxparser/GPXWriter.java
Original file line number Diff line number Diff line change
Expand Up @@ -387,12 +387,12 @@ private void addCopyrightToNode(Copyright copyright, Node n, Document doc) {
if (copyright.getYear() != null) {
Node node = doc.createElement(GPXConstants.NODE_YEAR);
node.appendChild(doc.createTextNode(copyright.getYear()));
n.appendChild(node);
copyrightNode.appendChild(node);
}
if (copyright.getLicense() != null) {
Node node = doc.createElement(GPXConstants.NODE_LICENSE);
node.appendChild(doc.createTextNode(copyright.getLicense()));
n.appendChild(node);
copyrightNode.appendChild(node);
}

n.appendChild(copyrightNode);
Expand All @@ -403,7 +403,7 @@ private void addAuthorToNode(Person author, Node n, Document doc) {
if (author.getName() != null) {
Node node = doc.createElement(GPXConstants.NODE_NAME);
node.appendChild(doc.createTextNode(author.getName()));
n.appendChild(node);
authorNode.appendChild(node);
}
if (author.getEmail() != null) {
this.addEmailToNode(author.getEmail(), authorNode, doc);
Expand All @@ -427,12 +427,12 @@ private void addLinkToNode(Link link, Node n, Document doc) {
if (link.getText() != null) {
Node node = doc.createElement(GPXConstants.NODE_TEXT);
node.appendChild(doc.createTextNode(link.getText()));
n.appendChild(node);
linkNode.appendChild(node);
}
if (link.getType() != null) {
Node node = doc.createElement(GPXConstants.NODE_TYPE);
node.appendChild(doc.createTextNode(link.getType()));
n.appendChild(node);
linkNode.appendChild(node);
}

n.appendChild(linkNode);
Expand All @@ -452,6 +452,7 @@ private void addEmailToNode(Email email, Node n, Document doc) {
attributes.setNamedItem(node);
}

n.appendChild(emailNode);
}

private void addExtensionToNode(Extension e, Node n, Document doc) {
Expand Down

0 comments on commit 5045571

Please sign in to comment.