XInterface oObj = null;
final String impName = "XMLMetaImporter" ;
final String impValue = "XMLMetaImporter_Value" ;
final String impTitle = "XMLMetaImporter Title" ;
final XDocumentInfoSupplier xDocInfoSup ;
try {
oObj = (XInterface)xMSF.createInstance(
"com.sun.star.comp.Math.XMLMetaImporter");
xDocInfoSup = (XDocumentInfoSupplier) UnoRuntime.queryInterface
(XDocumentInfoSupplier.class, xMathDoc) ;
} catch (com.sun.star.uno.Exception e) {
e.printStackTrace(log);
throw new StatusException("Unexpected exception", e);
}
TestEnvironment tEnv = new TestEnvironment(oObj);
tEnv.addObjRelation("TargetDocument",xMathDoc);
String[][] xml = new String[][] {
{"start", "office:document-meta",
"xmlns:office", "CDATA", "http://openoffice.org/2000/office",
"xmlns:meta", "CDATA", "http://openoffice.org/2000/meta",
"xmlns:xlink", "CDATA", "http://www.w3.org/1999/xlink",
"xmlns:dc", "CDATA", "http://purl.org/dc/elements/1.1/"
},
{"start", "office:meta"},
{"start", "dc:title"},
{"chars", impTitle},
{"end", "dc:title"},
{"start", "meta:user-defined",
"meta:name", "CDATA", impName},
{"chars", impValue},
{"end", "meta:user-defined"},
{"end", "office:meta"},
{"end", "office:document-meta"}} ;
tEnv.addObjRelation("XDocumentHandler.XMLData", xml) ;
final PrintWriter logF = log ;
tEnv.addObjRelation("XDocumentHandler.ImportChecker",
new ifc.xml.sax._XDocumentHandler.ImportChecker() {
public boolean checkImport() {
try {
XDocumentInfo xDocInfo = xDocInfoSup.getDocumentInfo() ;
XPropertySet xDocInfoProp = (XPropertySet)
UnoRuntime.queryInterface
(XPropertySet.class, xDocInfo) ;
boolean result = false ;
for (short i = 0; i < xDocInfo.getUserFieldCount(); i++) {