protected virtual void Dispose(bool disposing) { if (transformationServiceContainer != null) { transformationServiceContainer.Dispose(); transformationServiceContainer = null; } if (documentServiceContainer != null) { documentServiceContainer.Dispose(); documentServiceContainer = null; } if (xmlTransformable != null) { xmlTransformable.Dispose(); xmlTransformable = null; } if (xmlTransformation as XmlFileInfoDocument != null) { (xmlTransformation as XmlFileInfoDocument).Dispose(); xmlTransformation = null; } }
public bool Apply(XmlDocument xmlTarget) { Debug.Assert(this.xmlTarget == null, "This method should not be called recursively"); if (this.xmlTarget == null) { // Reset the error state logger.HasLoggedErrors = false; this.xmlTarget = xmlTarget; this.xmlTransformable = xmlTarget as XmlTransformableDocument; try { if (hasTransformNamespace) { InitializeDocumentServices(xmlTarget); TransformLoop(xmlTransformation); } else { logger.LogMessage(MessageType.Normal, "The expected namespace {0} was not found in the transform file", TransformNamespace); } } catch (Exception ex) { HandleException(ex); } finally { ReleaseDocumentServices(); this.xmlTarget = null; this.xmlTransformable = null; } return(!logger.HasLoggedErrors); } else { return(false); } }