Exemplo n.º 1
0
 public override void TreeToTreeTransform()
 {
     if (sourceDocument != null)
     {
         XdmNavigator           contextItem = sourceDocument.CreateNavigator();
         var                    documentSet = new DocumentSet(nameTable, stylesheet.InputSettings, schemaAware ? documentResolverSchemaAware : documentResolver, null, resourceResolver);
         DynamicContextSettings settings    = new DynamicContextSettings();
         settings.ContextItem = contextItem;
         settings.DocumentSet = documentSet;
         //DynamicContextSettings settings = new DynamicContextSettings { ContextItem = contextItem };
         using (XdmDocumentWriter writer = XdmDocumentWriter.Create())
         {
             stylesheet.ApplyTemplates(settings, writer);
             resultDocument = writer.Document;
         }
     }
     else
     {
         var documentSet = new DocumentSet(nameTable, stylesheet.InputSettings, documentResolver, null, resourceResolver);
         DynamicContextSettings settings = new DynamicContextSettings {
             DocumentSet = documentSet
         };
         XmlQualifiedName qname = new XmlQualifiedName("main");
         using (XdmDocumentWriter writer = XdmDocumentWriter.Create())
         {
             stylesheet.CallTemplate(qname, settings, writer);
             resultDocument = writer.Document;
         }
     }
 }
Exemplo n.º 2
0
        /**
         * Run a transformation, transforming the supplied source document using the
         * supplied stylesheet
         */

        public override void TreeToTreeTransform()
        {
            using (var writer = XdmDocumentWriter.Create())
            {
                xslCompiledTransform.Transform(_sourceDocument, writer);
                writer.Close();
                _resultDocument = writer.Document;
            }
        }