Skip to content

Commit

Permalink
TIKA-4171 -- fix regression when field names are missing in the XFAEx…
Browse files Browse the repository at this point in the history
…tractor (#1679)
  • Loading branch information
tballison authored Mar 25, 2024
1 parent d3553b3 commit a323ee5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,9 @@ void extract(InputStream xfaIs, XHTMLContentHandler xhtml, Metadata m, ParseCont
(field.toolTip == null || field.toolTip.trim().length() == 0) ? fieldName :
field.toolTip;
String[] fieldValues = pdfObjRToValues.getValues(fieldName);
if (fieldValues.length == 0) {
fieldValues = new String[]{""};
}
for (String fieldValue : fieldValues) {
AttributesImpl attrs = new AttributesImpl();
attrs.addAttribute("", "fieldName", "fieldName", "CDATA", fieldName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -986,7 +986,7 @@ public void testXFAExtractionBasic() throws Exception {
while (matcher.find()) {
listItems++;
}
assertEquals(24, listItems);
assertEquals(27, listItems);
}

@Test
Expand Down

0 comments on commit a323ee5

Please sign in to comment.