Project

General

Profile

« Previous | Next » 

Revision 48847

fix error for empty identifier

View differences:

DmfToHbaseXsltFunctions.java
3 3
import com.google.common.collect.Lists;
4 4
import eu.dnetlib.data.graph.model.DNGFRowKeyDecoder;
5 5
import eu.dnetlib.data.proto.*;
6
import org.apache.commons.lang3.StringUtils;
7
import org.apache.solr.common.util.StrUtils;
6 8
import org.w3c.dom.Node;
7 9
import org.w3c.dom.NodeList;
8 10

  
......
137 139
            if (node.getNodeType() == Node.ELEMENT_NODE) {
138 140
                if (node.getLocalName().equalsIgnoreCase("identifier")) {
139 141
                    pidType = node.getAttributes().getNamedItem("identifierType");
140

  
141
                    pids.add(getStructuredProperty(node.getTextContent(), pidType.getTextContent(), pidType.getTextContent(), "dnet:pid_types",
142
                            "dnet:pid_types"));
142
                    if (node.getTextContent() != null && StringUtils.isNotEmpty(node.getTextContent().trim()))
143
                        pids.add(getStructuredProperty(node.getTextContent(), pidType.getTextContent(), pidType.getTextContent(), "dnet:pid_types",
144
                                "dnet:pid_types"));
143 145
                }
144 146
            }
145 147
        }

Also available in: Unified diff