public XsltTransformReader(XmlDocumentReader reader, XmlReader xsltReader, XsltArgumentList arguments, SerializationSettings settings)
     : base(new XmlSerializationSettings(settings))
 {
     this.arguments      = arguments;
     this.transformation = () => Transform(reader, xsltReader);
     this.closeAction    = reader.Close;
 }
        private void TransformAndWrite(Writer documentWriter, XmlReader xsltReader)
        {
            var memory = new MemoryStream();
            var writer = new StreamWriter(memory)
            {
                AutoFlush = true
            };
            var reader = new StreamReader(memory);

            var xmlWriter = XmlWriter.Create(writer);

            TransformAndWrite(xmlWriter, xsltReader);
            memory.Position = 0;

            var xmlReader = new XmlDocumentReader(reader, null);

            xmlReader.CopyTo(documentWriter);
        }
        private Reader Transform(XmlDocumentReader documentReader, XmlReader xsltReader)
        {
            var memory = new MemoryStream();
            var writer = new StreamWriter(memory)
            {
                AutoFlush = true
            };
            var reader = new StreamReader(memory);

            var xmlWriter = new XmlDocumentWriter(writer, null);

            documentReader.CopyTo(xmlWriter);
            memory.Position = 0;

            var xmlReader = XmlReader.Create(reader);

            return(Transform(xmlReader, xsltReader));
        }
 public XsltTransformReader(XmlDocumentReader reader, XmlReader xsltReader)
     : this(reader, xsltReader, null, (XmlSerializationSettings)null)
 {
     // nada a fazer aqui. use o outro construtor.
 }