xmlRec.setSession(session);
return xmlRec;
}
public AbstractRecord createRecordFor(Object attributeValue, Field xmlField, XMLRecord parentRecord, Mapping mapping) {
DocumentPreservationPolicy policy = parentRecord.getDocPresPolicy();
Element newNode = null;
if(policy != null) {
newNode = (Element)policy.getNodeForObject(attributeValue);
}
if(newNode == null) {
newNode = XPathEngine.getInstance().createUnownedElement(parentRecord.getDOM(), xmlField);
if(xmlField.isSelfField()) {
policy.addObjectToCache(attributeValue, newNode, mapping);
} else {
policy.addObjectToCache(attributeValue, newNode);
}
}
DOMRecord nestedRecord = new DOMRecord(newNode);
nestedRecord.setMarshaller(parentRecord.getMarshaller());