public virtual IXPathNavigable CreateNodeEditable(TextReader input, XmlParsingOptions options) { options = options ?? new XmlParsingOptions(); XmlReaderSettings settings = (XmlReaderSettings)options; XmlReader reader = (options.BaseUri != null) ? XmlReader.Create(input, settings, options.BaseUri.AbsoluteUri) : XmlReader.Create(input, settings); using (reader) { return(CreateNodeEditable(reader)); } }
public override IXPathNavigable CreateNodeReadOnly(TextReader input, XmlParsingOptions options) { options = options ?? new XmlParsingOptions(); XmlReaderSettings settings = (XmlReaderSettings)options; XmlReader reader = (options.BaseUri != null) ? XmlReader.Create(input, settings, options.BaseUri.AbsoluteUri) : XmlReader.Create(input, settings); return CreateNodeReadOnly(reader); }
public override IXdmEnumerator Call(IXdmEnumerator[] arguments, DynamicContext context) { string xml = arguments[0].AsAtomicValues().Single().ToString(); var parseOptions = new XmlParsingOptions { ConformanceLevel = ConformanceLevel.Document, BaseUri = new Uri("", UriKind.Relative) // Saxon requires a base URI }; using (var reader = new StringReader(xml)) { return this.itemFactory.CreateNodeReadOnly(reader, parseOptions) .ToXdmNode(this.itemFactory) .GetXdmEnumerator(); } }
static object parse_xml_impl(object arg, bool fragment) { string str = ExtensionObjectConvert.ToString(arg); if (str == null) { return ExtensionObjectConvert.EmptyIterator; } var parseOptions = new XmlParsingOptions { ConformanceLevel = (fragment) ? ConformanceLevel.Fragment : ConformanceLevel.Document }; var itemFactory = new SystemItemFactory(); using (var reader = new StringReader(str)) { return ExtensionObjectConvert.ToInput(itemFactory.CreateNodeReadOnly(reader, parseOptions)); } }
public abstract IXPathNavigable CreateNodeReadOnly(TextReader input, XmlParsingOptions options);
public virtual IXPathNavigable CreateNodeEditable(TextReader input, XmlParsingOptions options) { options = options ?? new XmlParsingOptions(); XmlReaderSettings settings = (XmlReaderSettings)options; XmlReader reader = (options.BaseUri != null) ? XmlReader.Create(input, settings, options.BaseUri.AbsoluteUri) : XmlReader.Create(input, settings); using (reader) { return CreateNodeEditable(reader); } }