Project

General

Profile

« Previous | Next » 

Revision 49434

major fix of friday

View differences:

OpenAireParser.java
36 36
            ap.declareXPathNameSpace("oaf", "http://namespace.openaire.eu/oaf");
37 37

  
38 38
            final List<VtdUtilityParser.Node> subjectNodes =
39
                    VtdUtilityParser.getTextValuesWithAttributes(ap, vn, "//oaf:result//subject", Arrays.asList("classname", "schemename"));
39
                    VtdUtilityParser.getTextValuesWithAttributes(ap, vn, "//*[local-name()='result']//*[local-name()='subject']", Arrays.asList("classname", "schemename"));
40 40

  
41 41
            //Setting subjects
42 42
            if (subjectNodes != null && subjectNodes.size() > 0) {
......
49 49
            }
50 50

  
51 51
            //Setting Titles
52
            final List<String> titles = VtdUtilityParser.getTextValue(ap, vn, "//oaf:result/title");
52
            final List<String> titles = VtdUtilityParser.getTextValue(ap, vn, "//*[local-name()='result']/*[local-name()='title']");
53 53

  
54 54
            if (titles != null && titles.size() > 0) {
55 55
                currentObject.setTitles(titles);
56 56
            }
57 57

  
58 58
            //Setting authors
59
            final List<String> authorNodes = VtdUtilityParser.getTextValue(ap, vn, "//oaf:result//fullname");
59
            final List<String> authorNodes = VtdUtilityParser.getTextValue(ap, vn, "//*[local-name()='result']//*[local-name()='fullname']");
60 60
            if (authorNodes != null && authorNodes.size() > 0) {
61 61
                currentObject.setAuthors(authorNodes);
62 62
            }
63 63

  
64 64
            //Setting descriptions
65
            final List<String> descriptions = VtdUtilityParser.getTextValue(ap, vn, "//oaf:result//description");
65
            final List<String> descriptions = VtdUtilityParser.getTextValue(ap, vn, "//*[local-name()='result']//*[local-name()='description']");
66 66
            if (descriptions != null && descriptions.size() > 0) {
67 67
                descriptions.forEach(d -> currentObject.addDescription(new Pair<>("unknown", d)));
68 68
            }
69 69

  
70 70
            //resulttype classid
71
            final List<VtdUtilityParser.Node> resutlTypes = VtdUtilityParser.getTextValuesWithAttributes(ap, vn, "//oaf:result/resulttype", Arrays.asList("classid"));
71
            final List<VtdUtilityParser.Node> resutlTypes = VtdUtilityParser.getTextValuesWithAttributes(ap, vn, "//*[local-name()='result']/*[local-name()='resulttype']", Arrays.asList("classid"));
72 72
            if (resutlTypes != null && resutlTypes.size() > 0) {
73 73
                final String type = resutlTypes.get(0).getAttributes().get("classid");
74 74
                setType(currentObject, type);
75 75
            }
76 76

  
77
            ap.selectXPath("//rel[./to/@type='project']");
77
            ap.selectXPath("//*[local-name()='rel'][./to/@type='project']");
78 78
            while (ap.evalXPath() != -1) {
79 79
                final List<String> projectTitles = VtdUtilityParser.getTextValue(ap, vn, "./title");
80 80
                final List<String> projectAcronym = VtdUtilityParser.getTextValue(ap, vn, "./acronym");
......
94 94
                        .setGrantID(projectCodes.get(0))
95 95
                        .setName(projectTitles.get(0)));
96 96
            }
97
            return currentObject;
97
                return currentObject;
98 98
        } catch (Throwable e) {
99 99
            log.error("Error on parsing object ", e);
100 100
            return null;

Also available in: Unified diff