Revision 2356
tmp/org.txm.core/src/java/org/txm/importer/AddAttributeInXml.java (revision 2356) | ||
---|---|---|
85 | 85 |
for (Pair<String, String> meta : attributes) { |
86 | 86 |
if (stopAtFirst) |
87 | 87 |
stopInsertion = true; |
88 |
if (!exists.contains(meta.getFirst())) // I can add the new attribute |
|
88 |
if (!exists.contains(meta.getFirst())) {// I can add the new attribute
|
|
89 | 89 |
writer.writeAttribute(meta.getFirst(), meta.getSecond()); |
90 |
} |
|
90 | 91 |
} |
91 | 92 |
} else if (attributesMap != null) { |
92 | 93 |
for (String name : attributesMap.keySet()) { |
93 | 94 |
if (stopAtFirst) |
94 | 95 |
stopInsertion = true; |
95 |
if (!exists.contains(name)) // I can add the new attribute |
|
96 |
if (!exists.contains(name)) {// I can add the new attribute
|
|
96 | 97 |
writer.writeAttribute(name, attributesMap.get(name)); |
98 |
} |
|
97 | 99 |
} |
98 | 100 |
} |
99 | 101 |
} |
tmp/org.txm.core/src/java/org/txm/metadatas/Metadatas.java (revision 2356) | ||
---|---|---|
615 | 615 |
|
616 | 616 |
if (metas == null) { |
617 | 617 |
System.out.println("\nError: can't find metadata for text of id=" + key); |
618 |
System.out.println("Maybe the metadata file doesn't have the right format (comma separated values are needed)");
|
|
618 |
System.out.println("Maybe the metadata file doesn't have the right format (comma or tab separated values?)");
|
|
619 | 619 |
return false; |
620 | 620 |
} |
621 | 621 |
|
622 |
//ensure attribute names format |
|
623 |
for (org.txm.metadatas.Entry e : metas) { |
|
624 |
e.o1 = AsciiUtils.buildAttributeId(e.o1); |
|
625 |
} |
|
626 |
|
|
622 | 627 |
AddAttributeInXml builder = new AddAttributeInXml(infile, tag, metas); |
623 | 628 |
builder.onlyOneElement(); |
624 | 629 |
return builder.process(outfile); |
Also available in: Unified diff