Hi,
Is it ok to DOC file contains field which start with FieldSeparator. I have one such document.
I used following code which shows field which starts with FieldSeparator, also this is can be checked with DocumentExplorer.
public class FieldsTest
{
public static void main(String args[]) throws Exception
{
Document doc = new Document("k:/bugs/ACTIV+CORP+test.doc");
List fields = getFields(doc);
for (Object field: fields)
{
System.out.println(field);
}
}
private static List getFields(Document doc) throws Exception
{
final List fields = new ArrayList();
doc.accept(new DocumentVisitor()
{
@Override
public int visitFieldEnd(FieldEnd fieldEnd) throws Exception
{
fields.add(fieldEnd);
return super.visitFieldEnd(fieldEnd);
}
@Override
public int visitFieldSeparator(FieldSeparator fieldSeparator)
throws Exception
{
fields.add(fieldSeparator);
return super.visitFieldSeparator(fieldSeparator);
}
@Override
public int visitFieldStart(FieldStart fieldStart) throws Exception
{
fields.add(fieldStart);
return super.visitFieldStart(fieldStart);
}
});
return fields;
}
}
ACTIV+CORP+test.doc is in attachment.
Thanks,
Zeljko