예제 #1
0
 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;
 }
예제 #2
0
        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);
        }
예제 #3
0
        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));
        }
예제 #4
0
 public XsltTransformReader(XmlDocumentReader reader, XmlReader xsltReader)
     : this(reader, xsltReader, null, (XmlSerializationSettings)null)
 {
     // nada a fazer aqui. use o outro construtor.
 }