本文整理汇总了C#中System.Xml.XPath.XPathNavigator.DeleteSelf方法的典型用法代码示例。如果您正苦于以下问题:C# XPathNavigator.DeleteSelf方法的具体用法?C# XPathNavigator.DeleteSelf怎么用?C# XPathNavigator.DeleteSelf使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Xml.XPath.XPathNavigator
的用法示例。
在下文中一共展示了XPathNavigator.DeleteSelf方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: UpdateNode
/// <summary>
/// Updates the node replacing inheritdoc node with comments found.
/// </summary>
/// <param name="inheritDocNodeNavigator">Navigator for inheritdoc node</param>
/// <param name="contentNodeNavigator">Navigator for content</param>
private void UpdateNode(XPathNavigator inheritDocNodeNavigator, XPathNavigator contentNodeNavigator)
{
// retrieve the selection filter if specified.
string selectValue = inheritDocNodeNavigator.GetAttribute("select", string.Empty);
if(!string.IsNullOrEmpty(selectValue))
sourceExpression = XPathExpression.Compile(selectValue);
inheritDocNodeNavigator.MoveToParent();
if(inheritDocNodeNavigator.LocalName != "comments" && inheritDocNodeNavigator.LocalName != "element")
sourceExpression = XPathExpression.Compile(inheritDocNodeNavigator.LocalName);
else
inheritDocNodeNavigator.MoveTo(this.sourceDocument.CreateNavigator().SelectSingleNode(inheritDocExpression));
XPathNodeIterator sources = (XPathNodeIterator)contentNodeNavigator.CreateNavigator().Evaluate(sourceExpression);
inheritDocNodeNavigator.DeleteSelf();
// append the source nodes to the target node
foreach(XPathNavigator source in sources)
inheritDocNodeNavigator.AppendChild(source);
}
示例2: DeleteNode
/// <summary>
/// Deletes the specified node and logs the message.
/// </summary>
/// <param name="inheritDocNodeNavigator">navigator for inheritdoc node</param>
/// <param name="key">Id of the topic specified</param>
private void DeleteNode(XPathNavigator inheritDocNodeNavigator, string key)
{
base.ParentBuildComponent.WriteMessage(MessageLevel.Info, "Comments not found for topic: {0}", key);
inheritDocNodeNavigator.DeleteSelf();
}
示例3: DeleteNil
public void DeleteNil(XPathNavigator node)
{
if (node.MoveToAttribute(
"nil", NamespaceManager.LookupNamespace("xsi")))
node.DeleteSelf();
}
示例4: DeleteNode
/// <summary>
/// Deletes the specified node and logs the message.
/// </summary>
/// <param name="inheritDocNodeNavigator">navigator for inheritdoc node</param>
/// <param name="key">Id of the topic specified</param>
public static void DeleteNode(XPathNavigator inheritDocNodeNavigator, string key)
{
ConsoleApplication.WriteMessage(LogLevel.Info, string.Format(CultureInfo.InvariantCulture, "Comments are not found for topic:{0}", key));
inheritDocNodeNavigator.DeleteSelf();
}
示例5: DeleteNil
public void DeleteNil(XPathNavigator node)
{
if (node.MoveToAttribute("nil", "http://www.w3.org/2001/XMLSchema-instance"))
node.DeleteSelf();
}