以下工作正常:
XMLDocumentManager docMgr = client.newXMLDocumentManager();
JAXBContext context = JAXBContext.newInstance(Document.class);
JAXBHandle jaxbHandle = new JAXBHandle(context);
docMgr.read(
"/masters/1337-12/t/1439-1074_2013_2_toc.xml",
jaxbHandle);
Assert.assertNotNull(jaxbHandle);
Document document = (Document) jaxbHandle.get();
但是,如果我不知道文档 URI,我可以做什么,我必须进行如下搜索:
StructuredQueryBuilder qb = new StructuredQueryBuilder(
"OPTIONS_NAME");
StructuredQueryDefinition querydef = qb.valueConstraint("tocId",
tocId);
// contains RAW data -
StringHandle resultsHandle = queryMgr.search(querydef, new StringHandle());
如何使用 JAXB 转换此结果?