use of org.mycore.common.xml.MCRNodeBuilder in project mycore by MyCoRe-Org.
the class MCRTestNameMerger method buildNameEntry.
private MCRNameMerger buildNameEntry(String predicates) throws JaxenException {
Element modsName = new MCRNodeBuilder().buildElement("mods:name[@type='personal']" + predicates, null, null);
MCRNameMerger ne = new MCRNameMerger();
ne.setElement(modsName);
return ne;
}
use of org.mycore.common.xml.MCRNodeBuilder in project mycore by MyCoRe-Org.
the class MCRURNObjectXPathMetadataManager method insertIdentifier.
@Override
public void insertIdentifier(MCRDNBURN identifier, MCRBase obj, String additional) throws MCRPersistentIdentifierException {
String xpath = getProperties().get("Xpath");
Document xml = obj.createXML();
MCRNodeBuilder nb = new MCRNodeBuilder();
try {
nb.buildElement(xpath, identifier.asString(), xml);
MCRBase object = new MCRObject(xml);
MCRMetadataManager.update(object);
} catch (Exception e) {
throw new MCRException("Error while inscribing URN to " + obj.getId(), e);
}
}
Aggregations