[HepData-svn] r1668 - trunk/hepdata-webapp/src/main/java/cedar/hepdata/formats

blackhole at projects.hepforge.org blackhole at projects.hepforge.org
Mon Nov 11 15:14:49 GMT 2013


Author: whalley
Date: Mon Nov 11 15:14:49 2013
New Revision: 1668

Log:
fix for no spires etc id

Modified:
   trunk/hepdata-webapp/src/main/java/cedar/hepdata/formats/HepMLFormatter.java

Modified: trunk/hepdata-webapp/src/main/java/cedar/hepdata/formats/HepMLFormatter.java
==============================================================================
--- trunk/hepdata-webapp/src/main/java/cedar/hepdata/formats/HepMLFormatter.java	Mon Nov 11 15:09:56 2013	(r1667)
+++ trunk/hepdata-webapp/src/main/java/cedar/hepdata/formats/HepMLFormatter.java	Mon Nov 11 15:14:49 2013	(r1668)
@@ -25,9 +25,12 @@
         s.append("<hepml>\n");
         s.append("  <data timestamp='" + _getTimestamp() + "'>\n");
         s.append("    <paper");
-        s.append(" spiresId='" + p.getSpiresId() + "'");
-        s.append(" inspireId='" + p.getInspireId() + "'");
-        s.append(" redId='" + p.getRedId() + "'");
+        if(p.getSpiresId() != null) { s.append(" spiresId='" + p.getSpiresId() + "'"); }
+        else { s.append(" spiresId=''"); }
+        if(p.getInspireId() != null) { s.append(" inspireId='" + p.getInspireId() + "'"); }
+        else { s.append(" inspireId=''"); }
+        if(p.getRedId() != null) { s.append(" redId='" + p.getRedId() + "'"); }
+        else { s.append(" RedId=''"); }
         s.append(" preprintDate=''>\n");
         s.append("      <title>\n");
         s.append("        " + p.getTitle() + "\n");


More information about the HepData-svn mailing list