• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# XmlResolver类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中XmlResolver的典型用法代码示例。如果您正苦于以下问题:C# XmlResolver类的具体用法?C# XmlResolver怎么用?C# XmlResolver使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



XmlResolver类属于命名空间,在下文中一共展示了XmlResolver类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: Load

 public void Load(IXPathNavigable stylesheet, XmlResolver resolver)
 {
     if (stylesheet == null)
     {
         throw new ArgumentNullException(nameof(stylesheet));
     }
     Load(stylesheet.CreateNavigator(), resolver);
 }
开发者ID:alessandromontividiu03,项目名称:corefx,代码行数:8,代码来源:XslTransform.cs


示例2: XmlDTDParserInput

	// Initialize this dtd reader.
	public void Init
				(XmlParserInput input,
				 XmlResolver resolver)
			{
				base.ErrorHandler = input.ErrorHandler;
				this.input = new XmlDTDParserInput(input, context.NameTable);
				this.resolver = resolver;
			}
开发者ID:jjenki11,项目名称:blaze-chem-rendering,代码行数:9,代码来源:XmlDTDReader.cs


示例3: Load

        public void Load(Compiler compiler, object stylesheet, XmlResolver xmlResolver)
        {
            Debug.Assert(compiler != null);
            _compiler = compiler;
            _xmlResolver = xmlResolver ?? XmlNullResolver.Singleton;

            XmlReader reader = stylesheet as XmlReader;
            if (reader != null)
            {
                _readerSettings = new QueryReaderSettings(reader);
                Load(reader);
            }
            else
            {
                // We should take DefaultReaderSettings from Compiler.Settings.DefaultReaderSettings.

                string uri = stylesheet as string;
                if (uri != null)
                {
                    // If xmlResolver == null, then the original uri will be resolved using XmlUrlResolver
                    XmlResolver origResolver = xmlResolver;
                    if (xmlResolver == null || xmlResolver == XmlNullResolver.Singleton)
                        origResolver = new XmlUrlResolver();
                    Uri resolvedUri = origResolver.ResolveUri(null, uri);
                    if (resolvedUri == null)
                    {
                        throw new XslLoadException(SR.Xslt_CantResolve, uri);
                    }

                    _readerSettings = new QueryReaderSettings(new NameTable());
                    using (reader = CreateReader(resolvedUri, origResolver))
                    {
                        Load(reader);
                    }
                }
                else
                {
                    IXPathNavigable navigable = stylesheet as IXPathNavigable;
                    if (navigable != null)
                    {
                        reader = XPathNavigatorReader.Create(navigable.CreateNavigator());
                        _readerSettings = new QueryReaderSettings(reader.NameTable);
                        Load(reader);
                    }
                    else
                    {
                        Debug.Fail("Should never get here");
                    }
                }
            }
            Debug.Assert(compiler.Root != null);
            compiler.StartApplyTemplates = f.ApplyTemplates(nullMode);
            ProcessOutputSettings();
            foreach (AttributeSet attSet in compiler.AttributeSets.Values)
            {
                CheckAttributeSetsDfs(attSet); // Check attribute sets for circular references using dfs marking method
            }
        }
开发者ID:dotnet,项目名称:corefx,代码行数:58,代码来源:XsltLoader.cs


示例4: Execute

        /// <summary>
        /// Default document as XPathNavigator.
        /// </summary>
        public override void Execute(IXPathNavigable contextDocument, XmlResolver dataSources, XsltArgumentList argumentList, XmlWriter results) {
            if (results == null)
                throw new ArgumentNullException(nameof(results));

            if (contextDocument != null)
                Execute(contextDocument.CreateNavigator(), dataSources, argumentList, results, false);
            else
                Execute(null, dataSources, argumentList, results, false);
        }
开发者ID:geoffkizer,项目名称:corefx,代码行数:12,代码来源:XmlILCommand.cs


示例5: Load

 public void Load(XPathNavigator stylesheet, XmlResolver resolver) {
     if (stylesheet == null) {
         throw new ArgumentNullException("stylesheet");
     }
     if (resolver == null) {
         resolver = new XmlNullResolver();
     }
     Compile(stylesheet, resolver, /*evidence:*/null);
 }
开发者ID:gbarnett,项目名称:shared-source-cli-2.0,代码行数:9,代码来源:xsltransform.cs


示例6: Load

        public void Load(Compiler compiler, object stylesheet, XmlResolver xmlResolver) {
            Debug.Assert(compiler != null);
            this.compiler = compiler;
            this.xmlResolver = xmlResolver ?? XmlNullResolver.Singleton;

            XmlReader reader = stylesheet as XmlReader;
            if (reader != null) {
                readerSettings = new QueryReaderSettings(reader);
                LoadStylesheet(reader, /*include:*/false);
            } else {
                // We should take DefaultReaderSettings from Compiler.Settings.DefaultReaderSettings.

                string uri = stylesheet as string;
                if (uri != null) {
                    // If xmlResolver == null, then the original uri will be resolved using XmlUrlResolver
                    XmlResolver origResolver = xmlResolver ?? new XmlUrlResolver();
                    Uri resolvedUri = origResolver.ResolveUri(null, uri);
                    if (resolvedUri == null) {
                        throw new XslLoadException(Res.Xslt_CantResolve, uri);
                    }

                    readerSettings = new QueryReaderSettings(new NameTable());
                    using (reader = CreateReader(resolvedUri, origResolver)) {
                        LoadStylesheet(reader, /*include:*/false);
                    }
                } else {
                    IXPathNavigable navigable = stylesheet as IXPathNavigable;
                    if (navigable != null) {
                        reader = XPathNavigatorReader.Create(navigable.CreateNavigator());
                        readerSettings = new QueryReaderSettings(reader.NameTable);
                        LoadStylesheet(reader, /*include:*/false);
                    } else {
                        Debug.Fail("Should never get here");
                    }
                }
            }
            Process();
        }
开发者ID:gbarnett,项目名称:shared-source-cli-2.0,代码行数:38,代码来源:xsltloader.cs


示例7: Validate

 internal XmlReader Validate(XmlReader reader, XmlResolver resolver, XmlSchemaSet schemaSet, ValidationEventHandler valEventHandler) {
     if (schemaSet != null) {
         XmlReaderSettings readerSettings = new XmlReaderSettings();
         readerSettings.ValidationType = ValidationType.Schema;
         readerSettings.Schemas = schemaSet;
         readerSettings.ValidationEventHandler += valEventHandler;                
         return new XsdValidatingReader(reader, resolver, readerSettings, this);
     }
     return null;
 }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:10,代码来源:XmlSchemaAttribute.cs


示例8: Evaluate

 /// <devdoc>
 ///     <para>
 ///         Executes the query by accessing datasources via the XmlResolver and using
 ///         run-time parameters as provided by the XsltArgumentList. The default document
 ///         is mapped into the XmlResolver with the provided name. The results are returned
 ///         as an IList.
 ///     </para>
 /// </devdoc>
 public abstract IList Evaluate(XmlReader contextDocument, XmlResolver dataSources, XsltArgumentList argumentList);
开发者ID:Corillian,项目名称:corefx,代码行数:9,代码来源:XmlCommand.cs


示例9: Execute

 /// <devdoc>
 ///     <para>
 ///         Executes the query over the provided XPathNavigator with the given XsltArgumentList
 ///         as run-time parameters. The results are output to the provided Stream.
 ///     </para>
 /// </devdoc>
 public abstract void Execute(IXPathNavigable contextDocument, XmlResolver dataSources, XsltArgumentList argumentList, Stream results);
开发者ID:Corillian,项目名称:corefx,代码行数:7,代码来源:XmlCommand.cs


示例10: Evaluate

 /// <summary>
 /// Executes the query by accessing datasources via the XmlResolver and using
 /// run-time parameters as provided by the XsltArgumentList. The default document
 /// is mapped into the XmlResolver with the provided name. The results are returned
 /// as an IList.
 /// </summary>
 public override IList Evaluate(XmlReader contextDocument, XmlResolver dataSources, XsltArgumentList argumentList) {
     XmlCachedSequenceWriter seqwrt = new XmlCachedSequenceWriter();
     Execute(contextDocument, dataSources, argumentList, seqwrt);
     return seqwrt.ResultSequence;
 }
开发者ID:geoffkizer,项目名称:corefx,代码行数:11,代码来源:XmlILCommand.cs


示例11: Add

        private XmlSchema Add(string ns, SchemaInfo schemaInfo, XmlSchema schema, bool compile, XmlResolver resolver) {
            int errorCount = 0;
            if (schema != null) {
                if (schema.ErrorCount == 0 && compile) {
					if (!schema.CompileSchema(this, resolver, schemaInfo, ns, validationEventHandler, nameTable, true)) {
						errorCount = 1;
					}
					ns = schema.TargetNamespace == null ? string.Empty : schema.TargetNamespace;
                }
				errorCount += schema.ErrorCount;
            } 
            else {
                errorCount += schemaInfo.ErrorCount;
                //ns = ns == null? string.Empty : NameTable.Add(ns);
                ns = NameTable.Add(ns); //Added without checking for ns == null, since XDR cannot have null namespace
            }
            if (errorCount == 0) {
                XmlSchemaCollectionNode node = new XmlSchemaCollectionNode();
                node.NamespaceURI = ns;
                node.SchemaInfo = schemaInfo; 
				node.Schema = schema; 
                Add(ns, node);
                return schema;
            }
            return null;
        }
开发者ID:gbarnett,项目名称:shared-source-cli-2.0,代码行数:26,代码来源:xmlschemacollection.cs


示例12: XmlDTDReader

	// Constructor.
	public XmlDTDReader(XmlParserContext context)
			: base(null)
			{
				this.context = context;
				this.input = null;
				this.resolver = null;
			}
开发者ID:jjenki11,项目名称:blaze-chem-rendering,代码行数:8,代码来源:XmlDTDReader.cs


示例13: Parser

 public Parser(SchemaType schemaType, XmlNameTable nameTable, SchemaNames schemaNames, ValidationEventHandler eventHandler) {
     this.schemaType = schemaType;
     this.nameTable = nameTable;
     this.schemaNames = schemaNames;
     this.eventHandler = eventHandler;
     this.xmlResolver = System.Xml.XmlConfiguration.XmlReaderSection.CreateDefaultResolver();
     processMarkup = true;
     dummyDocument = new XmlDocument();
 }
开发者ID:uQr,项目名称:referencesource,代码行数:9,代码来源:Parser.cs


示例14: Parser

 public Parser(SchemaType schemaType, XmlNameTable nameTable, SchemaNames schemaNames, ValidationEventHandler eventHandler) {
     this.schemaType = schemaType;
     this.nameTable = nameTable;
     this.schemaNames = schemaNames;
     this.eventHandler = eventHandler;
     this.xmlResolver = new XmlUrlResolver();
     processMarkup = true;
     dummyDocument = new XmlDocument();
 }
开发者ID:gbarnett,项目名称:shared-source-cli-2.0,代码行数:9,代码来源:parser.cs


示例15: Parser

 public Parser(SchemaType schemaType, XmlNameTable nameTable, SchemaNames schemaNames, ValidationEventHandler eventHandler)
 {
     _schemaType = schemaType;
     _nameTable = nameTable;
     _schemaNames = schemaNames;
     _eventHandler = eventHandler;
     _xmlResolver = null;
     _processMarkup = true;
     _dummyDocument = new XmlDocument();
 }
开发者ID:dotnet,项目名称:corefx,代码行数:10,代码来源:Parser.cs


示例16: BaseValidator

 public BaseValidator(BaseValidator other) {
     reader = other.reader;
     schemaCollection = other.schemaCollection;
     eventHandler = other.eventHandler;
     nameTable = other.nameTable;
     schemaNames = other.schemaNames;
     positionInfo = other.positionInfo;
     xmlResolver = other.xmlResolver;
     baseUri = other.baseUri;
     elementName = other.elementName;
 }
开发者ID:gbarnett,项目名称:shared-source-cli-2.0,代码行数:11,代码来源:basevalidator.cs


示例17: XmlSchemaCollection

 /// <include file='doc\XmlSchemaCollection.uex' path='docs/doc[@for="XmlSchemaCollection.XmlSchemaCollection1"]/*' />
 /// <devdoc>
 ///    <para>Construct a new empty schema collection with associated XmlNameTable.
 ///       The XmlNameTable is used when loading schemas</para>
 /// </devdoc>
 public XmlSchemaCollection(XmlNameTable nametable) {
     if (nametable == null) {
         throw new ArgumentNullException("nametable");
     }
     nameTable = nametable;
     collection = Hashtable.Synchronized(new Hashtable());
     xmlResolver = System.Xml.XmlConfiguration.XmlReaderSection.CreateDefaultResolver();
     isThreadSafe = true;
     if (isThreadSafe) {
         wLock = new ReaderWriterLock();
     }
 }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:17,代码来源:XmlSchemaCollection.cs


示例18: XmlSchemaCollection

 /// <include file='doc\XmlSchemaCollection.uex' path='docs/doc[@for="XmlSchemaCollection.XmlSchemaCollection1"]/*' />
 /// <devdoc>
 ///    <para>Construct a new empty schema collection with associated XmlNameTable.
 ///       The XmlNameTable is used when loading schemas</para>
 /// </devdoc>
 public XmlSchemaCollection(XmlNameTable nametable) {
     if (nametable == null) {
         throw new ArgumentNullException("nametable");
     }
     nameTable = nametable;
     collection = Hashtable.Synchronized(new Hashtable());
     xmlResolver = new XmlUrlResolver();
     isThreadSafe = true;
     if (isThreadSafe) {
         wLock = new ReaderWriterLock();
     }
 }
开发者ID:gbarnett,项目名称:shared-source-cli-2.0,代码行数:17,代码来源:xmlschemacollection.cs


示例19: XmlSchemaCollection

 /// <include file='doc\XmlSchemaCollection.uex' path='docs/doc[@for="XmlSchemaCollection.XmlSchemaCollection1"]/*' />
 /// <devdoc>
 ///    <para>Construct a new empty schema collection with associated XmlNameTable.
 ///       The XmlNameTable is used when loading schemas</para>
 /// </devdoc>
 public XmlSchemaCollection(XmlNameTable nametable)
 {
     if (nametable == null)
     {
         throw new ArgumentNullException(nameof(nametable));
     }
     _nameTable = nametable;
     _collection = Hashtable.Synchronized(new Hashtable());
     _xmlResolver = null;
     _isThreadSafe = true;
     if (_isThreadSafe)
     {
         _wLock = new object();
     }
 }
开发者ID:dotnet,项目名称:corefx,代码行数:20,代码来源:XmlSchemaCollection.cs


示例20: XmlSchemaCollection

 /// <include file='doc\XmlSchemaCollection.uex' path='docs/doc[@for="XmlSchemaCollection.XmlSchemaCollection1"]/*' />
 /// <devdoc>
 ///    <para>Construct a new empty schema collection with associated XmlNameTable.
 ///       The XmlNameTable is used when loading schemas</para>
 /// </devdoc>
 public XmlSchemaCollection(XmlNameTable nametable)
 {
     if (nametable == null)
     {
         throw new ArgumentNullException(nameof(nametable));
     }
     _nameTable = nametable;
     _collection = Hashtable.Synchronized(new Hashtable());
     _xmlResolver = System.Xml.XmlConfiguration.XmlReaderSection.CreateDefaultResolver();
     _isThreadSafe = true;
     if (_isThreadSafe)
     {
         _wLock = new object();
     }
 }
开发者ID:geoffkizer,项目名称:corefx,代码行数:20,代码来源:XmlSchemaCollection.cs



注:本文中的XmlResolver类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# XmlSchemaDatatype类代码示例发布时间:2022-05-24
下一篇:
C# XmlReaderSettings类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap