Project

General

Profile

Revision 029dc4fd

ID029dc4fdb767026732d3094d0707f8b60ead0740
Parent 949b5cd7
Child 4e56a70e

Added by Andreas Müller over 7 years ago

fix some bugs for eFlora citation import and ISBN for mods

View differences:

cdmlib-io/src/main/java/eu/etaxonomy/cdm/io/markup/MarkupDocumentImportNoComponent.java
64 64
		super(docImport);
65 65
		this.keyImport = new MarkupKeyImport(docImport);
66 66
		this.specimenImport = new MarkupSpecimenImport(docImport);
67
		this.nomenclatureImport = new MarkupNomenclatureImport(docImport, keyImport, specimenImport);
67
		this.nomenclatureImport = new MarkupNomenclatureImport(docImport, specimenImport);
68 68
		this.modsImport = new MarkupModsImport(docImport);
69 69
		this.featureImport = new MarkupFeatureImport(docImport, specimenImport, nomenclatureImport);
70 70
	}
cdmlib-io/src/main/java/eu/etaxonomy/cdm/io/markup/MarkupImportState.java
31 31
import eu.etaxonomy.cdm.model.description.PolytomousKeyNode;
32 32
import eu.etaxonomy.cdm.model.location.NamedArea;
33 33
import eu.etaxonomy.cdm.model.media.Media;
34
import eu.etaxonomy.cdm.model.reference.Reference;
34 35
import eu.etaxonomy.cdm.model.taxon.Taxon;
35 36

  
36 37
/**
37 38
 * @author a.mueller
38 39
 * @created 11.05.2009
39
 * @version 1.0
40 40
 */
41 41
public class MarkupImportState extends XmlImportState<MarkupImportConfigurator, MarkupDocumentImport>{
42 42
	@SuppressWarnings("unused")
......
65 65
	
66 66
	private String latestGenusEpithet = null;
67 67
	
68
	private TeamOrPersonBase<?> latestAuthorInHomotype = null;
69
	private Reference<?> latestReferenceInHomotype = null;
70
	
68 71
	private boolean isCitation = false;
69 72
	private boolean isNameType = false;
70 73
	private boolean isProParte = false;
......
391 394
	}
392 395

  
393 396

  
397
	public TeamOrPersonBase<?> getLatestAuthorInHomotype() {
398
		return latestAuthorInHomotype;
399
	}
400

  
401

  
402
	public void setLatestAuthorInHomotype(TeamOrPersonBase<?> latestAuthorInHomotype) {
403
		this.latestAuthorInHomotype = latestAuthorInHomotype;
404
	}
405

  
406

  
407
	public Reference<?> getLatestReferenceInHomotype() {
408
		return latestReferenceInHomotype;
409
	}
410

  
411

  
412
	public void setLatestReferenceInHomotype(Reference<?> latestReferenceInHomotype) {
413
		this.latestReferenceInHomotype = latestReferenceInHomotype;
414
	}
415

  
416

  
394 417
}
cdmlib-io/src/main/java/eu/etaxonomy/cdm/io/markup/MarkupModsImport.java
16 16
import org.apache.log4j.Logger;
17 17

  
18 18
import eu.etaxonomy.cdm.common.CdmUtils;
19
import eu.etaxonomy.cdm.common.GeneralParser;
19 20
import eu.etaxonomy.cdm.model.reference.Reference;
20 21
import eu.etaxonomy.cdm.model.reference.ReferenceFactory;
21 22

  
......
61 62
					abstractStr = abstractStr.replaceFirst("ABSTRACT", "").trim();
62 63
				}
63 64
				modsRef.setReferenceAbstract(abstractStr);
65
			} else if (isStartingElement(next, MODS_IDENTIFIER)) {
66
				handleIdentifier(state, reader, next, modsRef);
64 67
			} else if (isStartingElement(next, MODS_NAME)) {
65 68
				handleNotYetImplementedElement(next);
66 69
			} else if (isStartingElement(next, MODS_ORIGININFO)) {
67 70
				handleNotYetImplementedElement(next);
68
			} else if (isStartingElement(next, MODS_IDENTIFIER)) {
69
				handleNotYetImplementedElement(next);
70 71
			} else {
71
				fireUnexpectedEvent(next, 0);
72
				state.setUnsuccessfull();
72
				handleUnexpectedElement(next);
73 73
			}
74 74
		}
75 75
		return;
76 76
	}
77 77

  
78
	private void handleIdentifier(MarkupImportState state, XMLEventReader reader, 
79
			XMLEvent parentEvent, Reference<?> modsRef) throws XMLStreamException {
80
		checkNoAttributes(parentEvent);
81
		
82
		
83
		String identifier = getCData(state, reader, parentEvent, true).trim();
84
		
85
		if (GeneralParser.isIsbn(identifier)){
86
			modsRef.setIsbn(identifier);
87
		}else{
88
			String message = "Identifier pattern not recognized: %s";
89
			fireWarningEvent(String.format(message, identifier), parentEvent, 4);
90
		}
91
		
92
		return;
93
	}
94

  
78 95
	/**
79 96
	 * Reads all titleInfo information.
80 97
	 * ! Preliminary implementation !
......
103 120
			}else if (isStartingElement(next, MODS_PARTNUMBER)) {
104 121
				partNumber = this.getCData(state, reader, next);
105 122
			} else {
106
				fireUnexpectedEvent(null, 0);
107
				state.setUnsuccessfull();
123
				handleUnexpectedElement(next);
108 124
			}
109 125
		}
110 126
		return;
cdmlib-io/src/main/java/eu/etaxonomy/cdm/io/markup/MarkupNomenclatureImport.java
45 45
import eu.etaxonomy.cdm.model.taxon.Taxon;
46 46
import eu.etaxonomy.cdm.strategy.exceptions.UnknownCdmTypeException;
47 47
import eu.etaxonomy.cdm.strategy.parser.NameTypeParser;
48
import eu.etaxonomy.cdm.strategy.parser.NonViralNameParserImpl;
49 48

  
50 49
/**
51 50
 * @author a.mueller
......
57 56
	private static final Logger logger = Logger.getLogger(MarkupNomenclatureImport.class);
58 57

  
59 58

  
60
	private NonViralNameParserImpl parser = new NonViralNameParserImpl();
59
//	private NonViralNameParserImpl parser = new NonViralNameParserImpl();
61 60

  
62
	private MarkupKeyImport keyImport;
63 61
	private MarkupSpecimenImport specimenImport;
64 62

  
65
	public MarkupNomenclatureImport(MarkupDocumentImport docImport,
66
			MarkupKeyImport keyImport, MarkupSpecimenImport specimenImport) {
63
	public MarkupNomenclatureImport(MarkupDocumentImport docImport, MarkupSpecimenImport specimenImport) {
67 64
		super(docImport);
68
		this.keyImport = keyImport;
69 65
		this.specimenImport = specimenImport;
70 66
	}
71 67

  
......
97 93
		boolean hasNom = false;
98 94
		while (reader.hasNext()) {
99 95
			XMLEvent next = readNoWhitespace(reader);
100
			if (next.isEndElement()) {
101
				if (isMyEndingElement(next, parentEvent)) {
102
					checkMandatoryElement(hasNom, parentEvent, NOM);
103
					return;
104
				} else {
105
					if (isEndingElement(next, NAME_TYPE)) {
106
						state.setNameType(false);
107
					} else if (isEndingElement(next, NOTES)) {
108
						// NOT YET IMPLEMENTED
109
						popUnimplemented(next.asEndElement());
110
					} else {
111
						handleUnexpectedEndElement(next.asEndElement());
112
					}
113
				}
114
			} else if (next.isStartElement()) {
115
				if (isStartingElement(next, NOM)) {
116
					NonViralName<?> name = handleNom(state, reader, next, homotypicalGroup);
117
					homotypicalGroup = name.getHomotypicalGroup();
118
					hasNom = true;
119
				} else if (isStartingElement(next, NAME_TYPE)) {
120
					state.setNameType(true);
121
					handleNameType(state, reader, next, homotypicalGroup);
122
				} else if (isStartingElement(next, SPECIMEN_TYPE)) {
123
					specimenImport.handleSpecimenType(state, reader, next,
124
							homotypicalGroup);
125
				} else if (isStartingElement(next, NOTES)) {
126
					handleNotYetImplementedElement(next);
127
				} else {
128
					handleUnexpectedStartElement(next);
129
				}
96
			if (isMyEndingElement(next, parentEvent)) {
97
				checkMandatoryElement(hasNom, parentEvent, NOM);
98
				state.setLatestAuthorInHomotype(null);
99
				return;
100
			} else if (isEndingElement(next, NAME_TYPE)) {
101
				state.setNameType(false);
102
			} else if (isStartingElement(next, NOM)) {
103
				NonViralName<?> name = handleNom(state, reader, next, homotypicalGroup);
104
				homotypicalGroup = name.getHomotypicalGroup();
105
				hasNom = true;
106
			} else if (isStartingElement(next, NAME_TYPE)) {
107
				state.setNameType(true);
108
				handleNameType(state, reader, next, homotypicalGroup);
109
			} else if (isStartingElement(next, SPECIMEN_TYPE)) {
110
				specimenImport.handleSpecimenType(state, reader, next, homotypicalGroup);
111
			} else if (isStartingElement(next, NOTES)) {
112
				handleNotYetImplementedElement(next);
130 113
			} else {
131 114
				handleUnexpectedElement(next);
132 115
			}
133 116
		}
117
		state.setLatestAuthorInHomotype(null);
134 118
		// TODO handle missing end element
135 119
		throw new IllegalStateException("Homotypes has no closing tag");
136 120

  
......
207 191
	 * @return
208 192
	 * @throws XMLStreamException
209 193
	 */
210
	private NonViralName<?> handleNom(MarkupImportState state,
211
			XMLEventReader reader, XMLEvent parentEvent,
212
			HomotypicalGroup homotypicalGroup) throws XMLStreamException {
194
	private NonViralName<?> handleNom(MarkupImportState state, XMLEventReader reader, 
195
			XMLEvent parentEvent, HomotypicalGroup homotypicalGroup) throws XMLStreamException {
213 196
		boolean isSynonym = false;
214 197
		boolean isNameType = state.isNameType();
215 198
		// attributes
......
232 215
		Map<String, String> nameMap = new HashMap<String, String>();
233 216
		String text = "";
234 217
		
218
		boolean nameFilled = false;
235 219
		while (reader.hasNext()) {
236 220
			XMLEvent next = readNoWhitespace(reader);
237 221
			if (isMyEndingElement(next, parentEvent)) {
238
				// fill the name with all data gathered
239
				fillName(state, nameMap, name, next);
222
				// fill the name with all data gathered, if not yet done before
223
				if (nameFilled == false){
224
					fillName(state, nameMap, name, next);
225
				}
240 226
				handleNomText(state, parentEvent, text, isNameType);
241 227
				return name;
242 228
			} else if (isEndingElement(next, ANNOTATION)) {
......
250 236
			} else if (isStartingElement(next, NAME)) {
251 237
				handleName(state, reader, next, nameMap);
252 238
			} else if (isStartingElement(next, CITATION)) {
239
				//we need to fill the name here to have nomenclatural author available for the following citations
240
				fillName(state, nameMap, name, next);
241
				nameFilled = true;
253 242
				handleCitation(state, reader, next, name, nameMap);
254 243
			} else if (next.isCharacters()) {
255 244
				text += next.asCharacters().getData();
......
357 346
				nameMap.put(classValue, text);
358 347
				return;
359 348
			} else if (isStartingElement(next, ANNOTATION)) {
360
				handleNotYetImplementedElement(next); // TODO test
361
														// handleSimpleAnnotation
349
				handleNotYetImplementedElement(next); // TODO test handleSimpleAnnotation
362 350
			} else if (next.isCharacters()) {
363 351
				text += next.asCharacters().getData();
364 352
			} else {
......
393 381
			testRankAuthorConsistency(name, event, authorStr, paraut,infrParAut, infrAut);
394 382

  
395 383
			// authors
396
			makeNomenclaturalAuthors(name, event, authorStr, paraut, infrParAut, infrAut);
384
			makeNomenclaturalAuthors(state, event, name, authorStr, paraut, infrParAut, infrAut);
397 385
		}
398 386

  
399 387
		// status
......
406 394
			try {
407 395
				// TODO handle trim earlier
408 396
				statusStr = statusStr.trim();
409
				NomenclaturalStatusType nomStatusType = NomenclaturalStatusType
410
						.getNomenclaturalStatusTypeByAbbreviation(statusStr);
397
				NomenclaturalStatusType nomStatusType = NomenclaturalStatusType.getNomenclaturalStatusTypeByAbbreviation(statusStr);
411 398
				name.addStatus(NomenclaturalStatus.NewInstance(nomStatusType));
412 399
			} catch (UnknownCdmTypeException e) {
413 400
				String message = "Status '%s' could not be recognized";
......
505 492
	}
506 493

  
507 494
	/**
495
	 * @param state 
508 496
	 * @param name
509 497
	 * @param event
510 498
	 * @param authorStr
......
512 500
	 * @param infrParAut
513 501
	 * @param infrAut
514 502
	 */
515
	private void makeNomenclaturalAuthors(NonViralName name, XMLEvent event,
503
	private void makeNomenclaturalAuthors(MarkupImportState state, XMLEvent event, NonViralName<?> name, 
516 504
			String authorStr, String paraut, String infrParAut, String infrAut) {
517 505
		if (name.getRank() != null && name.getRank().isInfraSpecific()) {
518 506
			if (StringUtils.isNotBlank(infrAut)) {
......
545 533
				name.setExBasionymAuthorTeam(authorAndEx[1]);
546 534
			}
547 535
		}
536
		
537
		//remember author for following citations
538
		state.setLatestAuthorInHomotype((TeamOrPersonBase<?>)name.getCombinationAuthorTeam());
548 539
	}
549 540

  
550
	private TeamOrPersonBase[] authorAndEx(String authorAndEx, XMLEvent xmlEvent) {
541
	private TeamOrPersonBase<?>[] authorAndEx(String authorAndEx, XMLEvent xmlEvent) {
551 542
		authorAndEx = authorAndEx.trim();
552
		TeamOrPersonBase[] result = new TeamOrPersonBase[2];
543
		TeamOrPersonBase<?>[] result = new TeamOrPersonBase[2];
553 544

  
554 545
		String[] split = authorAndEx.split("\\sex\\s");
555 546
		if (split.length > 2) {
......
584 575
			if (homotypicalGroup != null) {
585 576
				name.setHomotypicalGroup(homotypicalGroup);
586 577
			}
587
			SynonymRelationshipType synonymType = SynonymRelationshipType
588
					.HETEROTYPIC_SYNONYM_OF();
578
			SynonymRelationshipType synonymType = SynonymRelationshipType.HETEROTYPIC_SYNONYM_OF();
589 579
			if (taxon.getHomotypicGroup().equals(homotypicalGroup)) {
590 580
				synonymType = SynonymRelationshipType.HOMOTYPIC_SYNONYM_OF();
591 581
			}
......
597 587
	}
598 588

  
599 589
	private void handleCitation(MarkupImportState state, XMLEventReader reader,
600
			XMLEvent parentEvent, NonViralName name, Map<String, String> nameMap) throws XMLStreamException {
590
			XMLEvent parentEvent, NonViralName<?> name, Map<String, String> nameMap) throws XMLStreamException {
601 591
		String classValue = getClassOnlyAttribute(parentEvent);
602 592

  
603 593
		state.setCitation(true);
......
655 645

  
656 646
	}
657 647

  
658
	private void doCitation(MarkupImportState state, NonViralName name,
659
			String classValue, Reference reference, String microCitation,
648
	private void doCitation(MarkupImportState state, NonViralName<?> name,
649
			String classValue, Reference<?> reference, String microCitation,
660 650
			XMLEvent parentEvent) {
661 651
		if (PUBLICATION.equalsIgnoreCase(classValue)) {
662 652
			name.setNomenclaturalReference(reference);
663 653
			name.setNomenclaturalMicroReference(microCitation);
664
			if (reference.getAuthorTeam() == null ){
665
				reference.setAuthorTeam((TeamOrPersonBase<?>)name.getCombinationAuthorTeam());
666
			}
667 654
		} else if (USAGE.equalsIgnoreCase(classValue)) {
668 655
			Taxon taxon = state.getCurrentTaxon();
669 656
			TaxonDescription td = getTaxonDescription(taxon, state.getConfig().getSourceReference(), false, true);
......
690 677
	 * @param infrParAut
691 678
	 * @param infrAut
692 679
	 */
693
	private void testRankAuthorConsistency(NonViralName name, XMLEvent event,
680
	private void testRankAuthorConsistency(NonViralName<?> name, XMLEvent event,
694 681
			String authorStr, String paraut, String infrParAut, String infrAut) {
695 682
		if (name.getRank() == null) {
696 683
			return;
......
738 725
			reference = handleNonCitationSpecific(type, authorStr, titleStr,
739 726
					titleCache, volume, edition, editors, pubName);
740 727
		}
741
		reference.setVolume(volume);
742
		reference.setDatePublished(TimePeriod.parseString(year));
728

  
729
		//year
730
		TimePeriod timeperiod = TimePeriod.parseString(year);
731
		if (reference.getType().equals(ReferenceType.BookSection)){
732
			reference.getInBook().setDatePublished(timeperiod);
733
		}
734
		reference.setDatePublished(timeperiod);
743 735
		
744 736
		// TODO
745 737
		String[] unhandledList = new String[] { ALTERNATEPUBTITLE, ISSUE, NOTES, STATUS };
......
781 773
				IJournal journal = ReferenceFactory.newJournal();
782 774
				journal.setTitle(pubName);
783 775
				article.setInJournal(journal);
776
				article.setVolume(volume);
777
				if (isNotBlank(edition)){
778
					String message = "Article must not have an edition.";
779
					fireWarningEvent(message, parentEvent, 4);
780
				}
784 781
			}
785 782
			reference = (Reference<?>) article;
786 783
		} else if (refType == RefType.BookSection) {
......
789 786
			IBook  book = ReferenceFactory.newBook();
790 787
			reference.setInBook(book);
791 788
			book.setTitle(pubName);
792

  
789
			book.setVolume(volume);
790
			book.setEdition(edition);
791
			
793 792
			if (state.getConfig().isUseEditorAsInAuthorWhereNeeded()){
794 793
				TeamOrPersonBase<?> inAuthor = createAuthor(editors);
795 794
				book.setAuthorTeam(inAuthor);
......
799 798
			//Book
800 799
			reference = ReferenceFactory.newBook();
801 800
			reference.setTitle(pubName);
801
			reference.setVolume(volume);
802
			reference.setEdition(edition);
802 803
		}else if (refType == RefType.Generic){
803 804
			//Generic - undefinable
804
			String message = "Can't define the type of the reference. Use generic instead";
805
			fireWarningEvent(message, parentEvent, 4);
805
//			String message = "Can't define the type of the reference. Use generic instead";
806
//			fireWarningEvent(message, parentEvent, 4);
806 807
			reference = ReferenceFactory.newGeneric();
807 808
			reference.setTitle(pubName);
809
			reference.setEdition(edition);
810
			
811
			//volume indicates an in-reference
812
			if (isNotBlank(volume)){
813
				Reference<?> partOf = ReferenceFactory.newGeneric();
814
				partOf.setVolume(volume);
815
				partOf.setInReference(reference);
816
				reference = partOf;
817
			}
818
		}else if (refType == RefType.LatestUsed){
819
			Reference<?> latestReference = state.getLatestReferenceInHomotype();
820
			if (latestReference == null){
821
				String message = "No former reference available for incomplete citation";
822
				fireWarningEvent(message, parentEvent, 6);
823
				reference = ReferenceFactory.newGeneric();
824
			}else{
825
				if (latestReference.getInReference() != null){
826
					reference = (Reference<?>)latestReference.clone();
827
				}else{
828
					String message = "Latest reference is not an in-reference. This is not yet handled.";
829
					fireWarningEvent(message, parentEvent, 6);
830
					reference = ReferenceFactory.newGeneric();
831
				}
832
			}
833
			reference.setVolume(volume);
834
			if (isNotBlank(edition)){
835
				String message = "Edition not yet handled for incomplete citations";
836
				fireWarningEvent(message, parentEvent, 4);
837
			}
808 838
			
809 839
		}else{
810 840
			String message = "Unhandled reference type: %s" ;
......
812 842
			reference = ReferenceFactory.newGeneric();
813 843
		}
814 844
		
815
		//volume
816
		reference.setVolume(volume);
817
		
818 845
		//author
819
		// TODO use existing author from name or before
820
		TeamOrPersonBase<?> author = createAuthor(authorStr);
821
		reference.setAuthorTeam(author);
846
		TeamOrPersonBase<?> author;
847
		if (isBlank(authorStr)){
848
			if (refType != RefType.LatestUsed){
849
				author = state.getLatestAuthorInHomotype();
850
				reference.setAuthorTeam(author);
851
			}
852
		}else{
853
			author = createAuthor(authorStr);
854
			state.setLatestAuthorInHomotype(author);
855
			reference.setAuthorTeam(author);
856
		}
857
		
822 858

  
823 859
		//title, titleCache
824 860
		handleTitlesInCitation(titleStr, titleCache, parentEvent, reference);
825
		
826
		//edition
827
		reference.setEdition(edition);
861

  
828 862
		//editors
829 863
		handleEditorsInCitation(edition, editors, reference, parentEvent);
830 864
		
831 865
		//pages
832 866
		handlePages(state, refMap, parentEvent, reference, pages);
833 867
		
868
		//remember reference for following citation
869
		state.setLatestReferenceInHomotype(reference);
870
		
834 871
		return reference;
835 872
	}
836 873

  
......
845 882

  
846 883
	private void handleTitlesInCitation(String titleStr, String titleCache,
847 884
			XMLEvent parentEvent, Reference<?> reference) {
848
		reference.setTitle(titleStr);
885
		if (isNotBlank(titleStr)){
886
			reference.setTitle(titleStr);
887
		}
849 888
		//titleCache
850 889
		if (StringUtils.isNotBlank(titleCache)) {
851 890
			reference.setTitleCache(titleCache, true);
......
860 899
		Article,
861 900
		BookSection,
862 901
		Book,
863
		Generic
902
		Generic,
903
		LatestUsed
864 904
	}
865 905
	
866 906
	private RefType defineRefTypeForCitation(String type, String volume, String editors, 
867 907
			String authorStr, String pubName, XMLEvent parentEvent) {
868 908
		if ("journal".equalsIgnoreCase(type)){
869 909
			return RefType.Article;
870
		} else if (volume != null){
871
			//with volume
872
			if (editors == null){
873
				//with editor
874
				return RefType.Article;  //not always true, there may also be books with volumes, however FM does not have an "in" to distinguish books and articles 
875
			}else{
876
				return RefType.Generic;
877
			}
878 910
		}else {
879
			// no volume
880 911
			if (editors == null){
881 912
				//no editors
882
				return RefType.Book;  //Book must not have in-authors
913
				if (pubName == null){
914
					//looks like we need to use reference info from former citations here
915
					return RefType.LatestUsed;
916
				}else if (volume == null){
917
					return RefType.Book;  //Book must not have in-authors
918
				}else{
919
					return RefType.Generic;
920
				}
921

  
883 922
			}else{
923
				//editors
884 924
				if (pubName != null){
885 925
					return RefType.BookSection;
886 926
				}else{
927
					String message = "Unexpected state: Citation has editors but no pubName";
928
					fireWarningEvent(message, parentEvent, 4);
887 929
					return RefType.Generic;
888 930
				}
889 931
			}
......
900 942
		}
901 943
	}
902 944

  
945
	/**
946
	 * in work
947
	 * @return
948
	 */
903 949
	private Reference<?> handleNonCitationSpecific(String type, String authorStr,
904 950
			String titleStr, String titleCache, String volume, String edition,
905 951
			String editors, String pubName) {
......
922 968
		TeamOrPersonBase<?> author = createAuthor(authorStr);
923 969
		reference.setAuthorTeam(author);
924 970

  
971
		//title
925 972
		reference.setTitle(titleStr);
926 973
		if (StringUtils.isNotBlank(titleCache)) {
927 974
			reference.setTitleCache(titleCache, true);
928 975
		}
976
		
977
		//edition
929 978
		reference.setEdition(edition);
930 979
		reference.setEditor(editors);
931 980

  
981
		//pubName
932 982
		if (pubName != null) {
933 983
			Reference<?> inReference;
934 984
			if (reference.getType().equals(ReferenceType.Article)) {
......
939 989
			inReference.setTitle(pubName);
940 990
			reference.setInReference(inReference);
941 991
		}
992
		
993
		//volume
994
		reference.setVolume(volume);
942 995
		return reference;
943 996
	}
944 997

  
......
974 1027
		while (reader.hasNext()) {
975 1028
			XMLEvent next = readNoWhitespace(reader);
976 1029
			if (isMyEndingElement(next, parentEvent)) {
977
				checkMandatoryElement(hasRefPart, parentEvent.asStartElement(),
978
						REF_PART);
1030
				checkMandatoryElement(hasRefPart, parentEvent.asStartElement(), REF_PART);
979 1031
				Reference<?> reference = createReference(state, refMap, next);
980 1032
				return reference;
981 1033
			} else if (isStartingElement(next, REF_PART)) {

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)