@Override protected DSSDocument transformReference(final DSSReference reference){
  DSSDocument dssDocument=reference.getContents();
  final List<DSSTransform> transforms=reference.getTransforms();
  if (CollectionUtils.isEmpty(transforms)) {
    return dssDocument;
  }
  Node nodeToTransform=null;
  final String uri=reference.getUri();
  if (StringUtils.isNotBlank(uri) && uri.startsWith("#") && !isXPointer(uri)) {
    final Document document=DSSXMLUtils.buildDOM(dssDocument);
    DSSXMLUtils.recursiveIdBrowse(document.getDocumentElement());
    final String uri_id=uri.substring(1);
    nodeToTransform=document.getElementById(uri_id);
  }
  byte[] transformedReferenceBytes=applyTransformations(dssDocument,transforms,nodeToTransform);
  return new InMemoryDocument(transformedReferenceBytes);
}

@ Override protected DSSDocument transformReference ( final DSSReference reference ) { DSSDocument dssDocument = reference . getContents ( ) ; final List < DSSTransform > transforms = reference . getTransforms ( ) ; if ( CollectionUtils . isEmpty ( transforms ) ) { return dssDocument ; } Node nodeToTransform = null ; final String uri = reference . getUri ( ) ; if ( StringUtils . isNotBlank ( uri ) && uri . startsWith ( "#" ) && ! isXPointer ( uri ) ) { final Document document = DSSXMLUtils . buildDOM ( dssDocument ) ; DSSXMLUtils . recursiveIdBrowse ( document . getDocumentElement ( ) ) ; final String uri_id = uri . substring ( 1 ) ; nodeToTransform = document . getElementById ( uri_id ) ; } byte [ ] transformedReferenceBytes = applyTransformations ( dssDocument , transforms , nodeToTransform ) ; return new InMemoryDocument ( transformedReferenceBytes ) ; }
preconditions : - the reference data is xml - the last transformation is canonicalization .
