コード例 #1
0
        protected virtual XPathProcessor XPathProcessor(string xml)
        {
            var processor = new XPathProcessor();

            processor.Initialize(xml);
            return(processor);
        }
コード例 #2
0
        /// <summary>
        /// Convert XML into an entity using the <see cref="Schema"/> engine.
        /// </summary>
        /// <param name="xml">XML to use</param>
        /// <returns>A converted entity.</returns>
        protected virtual T GetEntity(string xml)
        {
            var sourceEngine = Container.Resolve <IXmlMappingEngine>(Version.ToAsmVersion(Schema));

            // NOTE: Should be LinqXPathProcessor but getting weird serialization errors
            var processor = new XPathProcessor();

            processor.Initialize(xml);
            return(sourceEngine.Map <XPathProcessor, T>(processor));
        }
コード例 #3
0
        public virtual void Initialize()
        {
            ExpectedXml = CreateExpectedXml();
            ExpectedDto = CreateExpectedDto();

            var locator = new Mock <IServiceLocator>();
            var factory = new LocatorXmlMapperFactory(locator.Object);
            var cache   = new CachingXmlMapperFactory(factory);

            MappingEngine = new XmlMappingEngine(cache);
            RegisterChildMappers(MappingEngine);

            XPathProcessor = new XPathProcessor();
            XPathProcessor.Initialize(ExpectedXml);

            Mapper = CreateMapper(MappingEngine);
            MappingEngine.RegisterMapper(Mapper);
        }
コード例 #4
0
 protected virtual XPathProcessor XPathProcessor(string xml)
 {
     var processor = new XPathProcessor();
     processor.Initialize(xml);
     return processor;
 }