当前位置: 首页>>代码示例>>C#>>正文


C# XPathDocument.LoadFromWriter方法代码示例

本文整理汇总了C#中System.Xml.XPath.XPathDocument.LoadFromWriter方法的典型用法代码示例。如果您正苦于以下问题:C# XPathDocument.LoadFromWriter方法的具体用法?C# XPathDocument.LoadFromWriter怎么用?C# XPathDocument.LoadFromWriter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Xml.XPath.XPathDocument的用法示例。


在下文中一共展示了XPathDocument.LoadFromWriter方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: StartTree

 /// <summary>
 /// Start construction of a new Xml tree (document or fragment).
 /// </summary>
 public override XmlRawWriter StartTree(XPathNodeType rootType, IXmlNamespaceResolver nsResolver, XmlNameTable nameTable) {
     // Build XPathDocument
     // If rootType != XPathNodeType.Root, then build an XQuery fragment
     this.doc = new XPathDocument(nameTable);
     this.writer = doc.LoadFromWriter(XPathDocument.LoadFlags.AtomizeNames | (rootType == XPathNodeType.Root ? XPathDocument.LoadFlags.None : XPathDocument.LoadFlags.Fragment), string.Empty);
     this.writer.NamespaceResolver = nsResolver;
     return this.writer;
 }
开发者ID:uQr,项目名称:referencesource,代码行数:11,代码来源:XmlSequenceWriter.cs

示例2: NavigatorOutput

 internal NavigatorOutput(string baseUri) {
     doc = new XPathDocument();
     this.wr = doc.LoadFromWriter(XPathDocument.LoadFlags.AtomizeNames, baseUri);
 }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:4,代码来源:NavigatorOutput.cs

示例3: GetNavigator

        /// <summary>
        /// Create a document containing a root node and a single text node child with "text" as its text value.
        /// This method is thread-safe, and is always guaranteed to return the exact same document, no matter how many
        /// threads have called it concurrently.
        /// </summary>
        public XPathNavigator GetNavigator(string text, string baseUri, XmlNameTable nameTable) {
            if (this.cache == null) {
                // Create XPathDocument
                XPathDocument doc = new XPathDocument(nameTable);
                XmlRawWriter writer = doc.LoadFromWriter(XPathDocument.LoadFlags.AtomizeNames, baseUri);
                writer.WriteString(text);
                writer.Close();

                this.cache = doc;
            }

            return ((XPathDocument) this.cache).CreateNavigator();
        }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:18,代码来源:RtfNavigator.cs

示例4: ToNode

        //------------------------------------------------------------------------
        // ToNode (internal type to internal type)
        //------------------------------------------------------------------------

        public static XPathNavigator ToNode(XPathItem item) {
            XsltLibrary.CheckXsltValue(item);

            if (!item.IsNode) {
                // Create Navigator over text node containing string value of item
                XPathDocument doc = new XPathDocument();
                XmlRawWriter writer = doc.LoadFromWriter(XPathDocument.LoadFlags.AtomizeNames, string.Empty);
                writer.WriteString(ToString(item));
                writer.Close();
                return doc.CreateNavigator();
            }

            RtfNavigator rtf = item as RtfNavigator;
            if (rtf != null)
                return rtf.ToNavigator();

            return (XPathNavigator) item;
        }
开发者ID:krytht,项目名称:DotNetReferenceSource,代码行数:22,代码来源:XsltConvert.cs


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