protected virtual XPathProcessor XPathProcessor(string xml) { var processor = new XPathProcessor(); processor.Initialize(xml); return(processor); }
/// <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)); }
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); }
protected virtual XPathProcessor XPathProcessor(string xml) { var processor = new XPathProcessor(); processor.Initialize(xml); return processor; }