本文整理汇总了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;
}
示例2: NavigatorOutput
internal NavigatorOutput(string baseUri) {
doc = new XPathDocument();
this.wr = doc.LoadFromWriter(XPathDocument.LoadFlags.AtomizeNames, baseUri);
}
示例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();
}
示例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;
}