XmlDocument xmlDoc = new XmlDocument(); xmlDoc.LoadXml(""); XPathNavigator nav = xmlDoc.CreateNavigator(); nav.Select("/books/book[1]/title").DeleteSelf(); // The first Book 1 Book 2 element and its parent <book> element will be deleted from the XML document. </pre><br><b>Example 2:</b> Deleting multiple nodes using XPathNavigator.DeleteSelf()<br><pre style="border:1px solid #888; border-radius: 5px;" class=" language-csharp">XmlDocument xmlDoc = new XmlDocument(); xmlDoc.LoadXml("<books><book><title>Book 1 "); XPathNavigator nav = xmlDoc.CreateNavigator(); XPathNodeIterator iterator = nav.Select("/books/book[title='Book 2']"); while (iterator.MoveNext()) { iterator.Current.DeleteSelf(); } // All Book 2 elements with value "Book 2" will be deleted from the XML document. </pre> Package library for XPathNavigator class is System.Xml.XPath.</div> <strong>C# (CSharp) XPathNavigator.DeleteSelf - 30 examples found</strong>. These are the top rated real world C# (CSharp) examples of <strong>XPathNavigator.DeleteSelf</strong> extracted from open source projects. You can rate examples to help us improve the quality of examples. </div> <div class="hidden-xs"> <div id="ezoic-pub-ad-placeholder-130"> </div> </div> </div> <div id="ezoic-pub-ad-placeholder-105"> <div style="text-align: center; margin-top: 10px"> <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script> <!-- after-description --> <ins class="adsbygoogle" style="display:block" data-ad-client="ca-pub-3697522372581514" data-ad-slot="5330879504" data-ad-format="auto" data-full-width-responsive="true"></ins> <script> (adsbygoogle = window.adsbygoogle || []).push({}); </script> </div> </div> <div class="visible-xs visible-sm visible-md"> <div class="bs-example thin" style="margin-top: 15px"> <div class="bs-example-title">Frequently Used Methods</div> <div class="fields-controls visible-sm visible-xs visible-md"> <a class="btn btn-default fields-show-btn" data-toggle="collapse" href="#fields-panel-mobile" aria-expanded="false" aria-controls="fields-panel">Show</a> <a class="btn btn-default fields-hide-btn" data-toggle="collapse" href="#fields-panel-mobile" aria-expanded="false" aria-controls="fields-panel">Hide</a> </div> </div> <figure class="highlight panel fields-panel collapse" id="fields-panel-mobile"> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://csharp.hotexamples.com/examples/-/XPathNavigator/AppendChild/php-xpathnavigator-appendchild-method-examples.html">AppendChild(30)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://csharp.hotexamples.com/examples/-/XPathNavigator/Compile/php-xpathnavigator-compile-method-examples.html">Compile(30)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://csharp.hotexamples.com/examples/-/XPathNavigator/GetAttribute/php-xpathnavigator-getattribute-method-examples.html">GetAttribute(30)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://csharp.hotexamples.com/examples/-/XPathNavigator/Evaluate/php-xpathnavigator-evaluate-method-examples.html">Evaluate(30)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://csharp.hotexamples.com/examples/-/XPathNavigator/DeleteSelf/php-xpathnavigator-deleteself-method-examples.html">DeleteSelf(30)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://csharp.hotexamples.com/examples/-/XPathNavigator/CreateNavigator/php-xpathnavigator-createnavigator-method-examples.html">CreateNavigator(30)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://csharp.hotexamples.com/examples/-/XPathNavigator/CreateAttribute/php-xpathnavigator-createattribute-method-examples.html">CreateAttribute(30)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://csharp.hotexamples.com/examples/-/XPathNavigator/Clone/php-xpathnavigator-clone-method-examples.html">Clone(30)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://csharp.hotexamples.com/examples/-/XPathNavigator/ComparePosition/php-xpathnavigator-compareposition-method-examples.html">ComparePosition(20)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://csharp.hotexamples.com/examples/-/XPathNavigator/AppendChildElement/php-xpathnavigator-appendchildelement-method-examples.html">AppendChildElement(15)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://csharp.hotexamples.com/examples/-/XPathNavigator/ExtractContent/php-xpathnavigator-extractcontent-method-examples.html">ExtractContent(11)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://csharp.hotexamples.com/examples/-/XPathNavigator/GetContentKindMask/php-xpathnavigator-getcontentkindmask-method-examples.html">GetContentKindMask(10)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://csharp.hotexamples.com/examples/-/XPathNavigator/GetBlockType/php-xpathnavigator-getblocktype-method-examples.html">GetBlockType(6)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://csharp.hotexamples.com/examples/-/XPathNavigator/CheckValidity/php-xpathnavigator-checkvalidity-method-examples.html">CheckValidity(5)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://csharp.hotexamples.com/examples/-/XPathNavigator/DeleteRange/php-xpathnavigator-deleterange-method-examples.html">DeleteRange(5)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://csharp.hotexamples.com/examples/-/XPathNavigator/CreateAttributes/php-xpathnavigator-createattributes-method-examples.html">CreateAttributes(4)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://csharp.hotexamples.com/examples/-/XPathNavigator/AsNamespaceScopedNavigator/php-xpathnavigator-asnamespacescopednavigator-method-examples.html">AsNamespaceScopedNavigator(4)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://csharp.hotexamples.com/examples/-/XPathNavigator/CheckAvailRestriction/php-xpathnavigator-checkavailrestriction-method-examples.html">CheckAvailRestriction(4)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://csharp.hotexamples.com/examples/-/XPathNavigator/CheckNuyenRestriction/php-xpathnavigator-checknuyenrestriction-method-examples.html">CheckNuyenRestriction(4)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://csharp.hotexamples.com/examples/-/XPathNavigator/GetAttributeAsBool/php-xpathnavigator-getattributeasbool-method-examples.html">GetAttributeAsBool(2)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://csharp.hotexamples.com/examples/-/XPathNavigator/GetHashCode/php-xpathnavigator-gethashcode-method-examples.html">GetHashCode(2)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://csharp.hotexamples.com/examples/-/XPathNavigator/AssertNotNull/php-xpathnavigator-assertnotnull-method-examples.html">AssertNotNull(2)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://csharp.hotexamples.com/examples/-/XPathNavigator/EvaluateString/php-xpathnavigator-evaluatestring-method-examples.html">EvaluateString(2)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://csharp.hotexamples.com/examples/-/XPathNavigator/GenerateExpression/php-xpathnavigator-generateexpression-method-examples.html">GenerateExpression(2)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://csharp.hotexamples.com/examples/-/XPathNavigator/BuildNamespaceManager/php-xpathnavigator-buildnamespacemanager-method-examples.html">BuildNamespaceManager(1)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://csharp.hotexamples.com/examples/-/XPathNavigator/GetAllNamespaces/php-xpathnavigator-getallnamespaces-method-examples.html">GetAllNamespaces(1)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://csharp.hotexamples.com/examples/-/XPathNavigator/GetAttributeAsInt/php-xpathnavigator-getattributeasint-method-examples.html">GetAttributeAsInt(1)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://csharp.hotexamples.com/examples/-/XPathNavigator/GetAllChildAttributes/php-xpathnavigator-getallchildattributes-method-examples.html">GetAllChildAttributes(1)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://csharp.hotexamples.com/examples/-/XPathNavigator/GetBoolAttribute/php-xpathnavigator-getboolattribute-method-examples.html">GetBoolAttribute(1)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://csharp.hotexamples.com/examples/-/XPathNavigator/GetBooleanAttribute/php-xpathnavigator-getbooleanattribute-method-examples.html">GetBooleanAttribute(1)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://csharp.hotexamples.com/examples/-/XPathNavigator/GetComment/php-xpathnavigator-getcomment-method-examples.html">GetComment(1)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://csharp.hotexamples.com/examples/-/XPathNavigator/GetAllAttributes/php-xpathnavigator-getallattributes-method-examples.html">GetAllAttributes(1)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://csharp.hotexamples.com/examples/-/XPathNavigator/GetDiscriminants/php-xpathnavigator-getdiscriminants-method-examples.html">GetDiscriminants(1)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://csharp.hotexamples.com/examples/-/XPathNavigator/GetEnumAttributeValue/php-xpathnavigator-getenumattributevalue-method-examples.html">GetEnumAttributeValue(1)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://csharp.hotexamples.com/examples/-/XPathNavigator/GetFullXPath/php-xpathnavigator-getfullxpath-method-examples.html">GetFullXPath(1)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://csharp.hotexamples.com/examples/-/XPathNavigator/GetKindMask/php-xpathnavigator-getkindmask-method-examples.html">GetKindMask(1)</a> </div> </figure> </div> </div> <div class="page-content-container"> <div class="sidebar hidden-xs hidden-sm hidden-md" style="width:300px"> <div id="ezoic-pub-ad-placeholder-101"> <div style="text-align: center; margin-top: 10px"> <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script> <!-- left-sidebar-1 --> <ins class="adsbygoogle" style="display:block" data-ad-client="ca-pub-3697522372581514" data-ad-slot="7161345231" data-ad-format="auto" data-full-width-responsive="true"></ins> <script> (adsbygoogle = window.adsbygoogle || []).push({}); </script> </div> </div> <div class="bs-example thin"> <div class="bs-example-title"> Frequently Used Methods </div> </div> <figure class="highlight panel fields-panel " id="fields-panel"> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://csharp.hotexamples.com/examples/-/XPathNavigator/AppendChild/php-xpathnavigator-appendchild-method-examples.html">AppendChild (30)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://csharp.hotexamples.com/examples/-/XPathNavigator/Compile/php-xpathnavigator-compile-method-examples.html">Compile (30)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://csharp.hotexamples.com/examples/-/XPathNavigator/GetAttribute/php-xpathnavigator-getattribute-method-examples.html">GetAttribute (30)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://csharp.hotexamples.com/examples/-/XPathNavigator/Evaluate/php-xpathnavigator-evaluate-method-examples.html">Evaluate (30)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://csharp.hotexamples.com/examples/-/XPathNavigator/DeleteSelf/php-xpathnavigator-deleteself-method-examples.html">DeleteSelf (30)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://csharp.hotexamples.com/examples/-/XPathNavigator/CreateNavigator/php-xpathnavigator-createnavigator-method-examples.html">CreateNavigator (30)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://csharp.hotexamples.com/examples/-/XPathNavigator/CreateAttribute/php-xpathnavigator-createattribute-method-examples.html">CreateAttribute (30)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://csharp.hotexamples.com/examples/-/XPathNavigator/Clone/php-xpathnavigator-clone-method-examples.html">Clone (30)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://csharp.hotexamples.com/examples/-/XPathNavigator/ComparePosition/php-xpathnavigator-compareposition-method-examples.html">ComparePosition (20)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://csharp.hotexamples.com/examples/-/XPathNavigator/AppendChildElement/php-xpathnavigator-appendchildelement-method-examples.html">AppendChildElement (15)</a> </div> </figure> <div id="ezoic-pub-ad-placeholder-102"> <div style="text-align: center; margin-bottom: 10px"> <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script> <!-- left-sidebar-2 --> <ins class="adsbygoogle" style="display:block" data-ad-client="ca-pub-3697522372581514" data-ad-slot="7075206013" data-ad-format="auto" data-full-width-responsive="true"></ins> <script> (adsbygoogle = window.adsbygoogle || []).push({}); </script> </div> </div> <div class="bs-example thin"> <div class="bs-example-title"> Frequently Used Methods </div> </div> <figure class="highlight panel fields-panel " id="fields-panel"> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://csharp.hotexamples.com/examples/-/XPathNavigator/ExtractContent/php-xpathnavigator-extractcontent-method-examples.html">ExtractContent (11)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://csharp.hotexamples.com/examples/-/XPathNavigator/GetContentKindMask/php-xpathnavigator-getcontentkindmask-method-examples.html">GetContentKindMask (10)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://csharp.hotexamples.com/examples/-/XPathNavigator/GetBlockType/php-xpathnavigator-getblocktype-method-examples.html">GetBlockType (6)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://csharp.hotexamples.com/examples/-/XPathNavigator/CheckValidity/php-xpathnavigator-checkvalidity-method-examples.html">CheckValidity (5)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://csharp.hotexamples.com/examples/-/XPathNavigator/DeleteRange/php-xpathnavigator-deleterange-method-examples.html">DeleteRange (5)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://csharp.hotexamples.com/examples/-/XPathNavigator/CreateAttributes/php-xpathnavigator-createattributes-method-examples.html">CreateAttributes (4)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://csharp.hotexamples.com/examples/-/XPathNavigator/AsNamespaceScopedNavigator/php-xpathnavigator-asnamespacescopednavigator-method-examples.html">AsNamespaceScopedNavigator (4)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://csharp.hotexamples.com/examples/-/XPathNavigator/CheckAvailRestriction/php-xpathnavigator-checkavailrestriction-method-examples.html">CheckAvailRestriction (4)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://csharp.hotexamples.com/examples/-/XPathNavigator/CheckNuyenRestriction/php-xpathnavigator-checknuyenrestriction-method-examples.html">CheckNuyenRestriction (4)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://csharp.hotexamples.com/examples/-/XPathNavigator/GetAttributeAsBool/php-xpathnavigator-getattributeasbool-method-examples.html">GetAttributeAsBool (2)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://csharp.hotexamples.com/examples/-/XPathNavigator/GetHashCode/php-xpathnavigator-gethashcode-method-examples.html">GetHashCode (2)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://csharp.hotexamples.com/examples/-/XPathNavigator/AssertNotNull/php-xpathnavigator-assertnotnull-method-examples.html">AssertNotNull (2)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://csharp.hotexamples.com/examples/-/XPathNavigator/EvaluateString/php-xpathnavigator-evaluatestring-method-examples.html">EvaluateString (2)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://csharp.hotexamples.com/examples/-/XPathNavigator/GenerateExpression/php-xpathnavigator-generateexpression-method-examples.html">GenerateExpression (2)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://csharp.hotexamples.com/examples/-/XPathNavigator/BuildNamespaceManager/php-xpathnavigator-buildnamespacemanager-method-examples.html">BuildNamespaceManager (1)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://csharp.hotexamples.com/examples/-/XPathNavigator/GetAllNamespaces/php-xpathnavigator-getallnamespaces-method-examples.html">GetAllNamespaces (1)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://csharp.hotexamples.com/examples/-/XPathNavigator/GetAttributeAsInt/php-xpathnavigator-getattributeasint-method-examples.html">GetAttributeAsInt (1)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://csharp.hotexamples.com/examples/-/XPathNavigator/GetAllChildAttributes/php-xpathnavigator-getallchildattributes-method-examples.html">GetAllChildAttributes (1)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://csharp.hotexamples.com/examples/-/XPathNavigator/GetBoolAttribute/php-xpathnavigator-getboolattribute-method-examples.html">GetBoolAttribute (1)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://csharp.hotexamples.com/examples/-/XPathNavigator/GetBooleanAttribute/php-xpathnavigator-getbooleanattribute-method-examples.html">GetBooleanAttribute (1)</a> </div> </figure> <div id="ezoic-pub-ad-placeholder-117"> </div> <div class="bs-example thin"> <div class="bs-example-title"> Frequently Used Methods </div> </div> <figure class="highlight panel fields-panel " id="fields-panel"> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://csharp.hotexamples.com/examples/-/XPathNavigator/GetHashCode/php-xpathnavigator-gethashcode-method-examples.html">GetHashCode (2)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://csharp.hotexamples.com/examples/-/XPathNavigator/AssertNotNull/php-xpathnavigator-assertnotnull-method-examples.html">AssertNotNull (2)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://csharp.hotexamples.com/examples/-/XPathNavigator/EvaluateString/php-xpathnavigator-evaluatestring-method-examples.html">EvaluateString (2)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://csharp.hotexamples.com/examples/-/XPathNavigator/GenerateExpression/php-xpathnavigator-generateexpression-method-examples.html">GenerateExpression (2)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://csharp.hotexamples.com/examples/-/XPathNavigator/BuildNamespaceManager/php-xpathnavigator-buildnamespacemanager-method-examples.html">BuildNamespaceManager (1)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://csharp.hotexamples.com/examples/-/XPathNavigator/GetAllNamespaces/php-xpathnavigator-getallnamespaces-method-examples.html">GetAllNamespaces (1)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://csharp.hotexamples.com/examples/-/XPathNavigator/GetAttributeAsInt/php-xpathnavigator-getattributeasint-method-examples.html">GetAttributeAsInt (1)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://csharp.hotexamples.com/examples/-/XPathNavigator/GetAllChildAttributes/php-xpathnavigator-getallchildattributes-method-examples.html">GetAllChildAttributes (1)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://csharp.hotexamples.com/examples/-/XPathNavigator/GetBoolAttribute/php-xpathnavigator-getboolattribute-method-examples.html">GetBoolAttribute (1)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://csharp.hotexamples.com/examples/-/XPathNavigator/GetBooleanAttribute/php-xpathnavigator-getbooleanattribute-method-examples.html">GetBooleanAttribute (1)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://csharp.hotexamples.com/examples/-/XPathNavigator/GetComment/php-xpathnavigator-getcomment-method-examples.html">GetComment (1)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://csharp.hotexamples.com/examples/-/XPathNavigator/GetAllAttributes/php-xpathnavigator-getallattributes-method-examples.html">GetAllAttributes (1)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://csharp.hotexamples.com/examples/-/XPathNavigator/GetDiscriminants/php-xpathnavigator-getdiscriminants-method-examples.html">GetDiscriminants (1)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://csharp.hotexamples.com/examples/-/XPathNavigator/GetEnumAttributeValue/php-xpathnavigator-getenumattributevalue-method-examples.html">GetEnumAttributeValue (1)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://csharp.hotexamples.com/examples/-/XPathNavigator/GetFullXPath/php-xpathnavigator-getfullxpath-method-examples.html">GetFullXPath (1)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://csharp.hotexamples.com/examples/-/XPathNavigator/GetKindMask/php-xpathnavigator-getkindmask-method-examples.html">GetKindMask (1)</a> </div> </figure> <div id="ezoic-pub-ad-placeholder-116"> </div> <div class="hidden-xs hidden-sm"> <div class="bs-example thin"> <div class="bs-example-title">Related in langs</div> </div> <figure class="highlight panel"> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/-/audit_resource2str/php-audit_resource2str-function-examples.html">audit_resource2str (PHP)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/examples/-/-/bp_core_get_iso8601_date/php-bp_core_get_iso8601_date-function-examples.html">bp_core_get_iso8601_date (PHP)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://cpp.hotexamples.com/examples/-/-/AllocTemp/cpp-alloctemp-function-examples.html">AllocTemp (C++)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://cpp.hotexamples.com/examples/-/-/info_prepare/cpp-info_prepare-function-examples.html">info_prepare (C++)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://golang.hotexamples.com/examples/github.com.openshift.origin.pkg.security.admission/-/ConstraintAppliesTo/golang-constraintappliesto-function-examples.html">ConstraintAppliesTo (Go)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://golang.hotexamples.com/examples/echo.server/-/EncryptData/golang-encryptdata-function-examples.html">EncryptData (Go)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/examples/com.taobao.csp.objectweb.asm/Label/-/java-label-class-examples.html">Label (Java)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/examples/java.util/JTree/-/java-jtree-class-examples.html">JTree (Java)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://python.hotexamples.com/examples/modules.tree/Tree/-/python-tree-class-examples.html">Tree (Python)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://python.hotexamples.com/examples/sympy.polys.rootisolation/-/dup_sturm/python-dup_sturm-function-examples.html">dup_sturm (Python)</a> </div> </figure> </div> <div class="bs-example thin"> <div class="bs-example-title"> Frequently Used Methods </div> </div> <figure class="highlight panel fields-panel fields-panel-last" id="fields-panel"> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://csharp.hotexamples.com/examples/-/XPathNavigator/GetComment/php-xpathnavigator-getcomment-method-examples.html">GetComment (1)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://csharp.hotexamples.com/examples/-/XPathNavigator/GetAllAttributes/php-xpathnavigator-getallattributes-method-examples.html">GetAllAttributes (1)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://csharp.hotexamples.com/examples/-/XPathNavigator/GetDiscriminants/php-xpathnavigator-getdiscriminants-method-examples.html">GetDiscriminants (1)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://csharp.hotexamples.com/examples/-/XPathNavigator/GetEnumAttributeValue/php-xpathnavigator-getenumattributevalue-method-examples.html">GetEnumAttributeValue (1)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://csharp.hotexamples.com/examples/-/XPathNavigator/GetFullXPath/php-xpathnavigator-getfullxpath-method-examples.html">GetFullXPath (1)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://csharp.hotexamples.com/examples/-/XPathNavigator/GetKindMask/php-xpathnavigator-getkindmask-method-examples.html">GetKindMask (1)</a> </div> </figure> <div class="hidden-xs hidden-sm"> <div class="bs-example thin"> <div class="bs-example-title">Related</div> </div> <figure class="highlight panel"> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://csharp.hotexamples.com/examples/-/IMainServiceGroupService/-/php-imainservicegroupservice-class-examples.html">IMainServiceGroupService</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://csharp.hotexamples.com/examples/ObjectDB/InstnaceInfo/-/php-instnaceinfo-class-examples.html">InstnaceInfo</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://csharp.hotexamples.com/examples/Microsoft.TemplateEngine.Cli/ChoiceTemplateParameter/-/php-choicetemplateparameter-class-examples.html">ChoiceTemplateParameter</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://csharp.hotexamples.com/examples/-/SpellPrefabManager/-/php-spellprefabmanager-class-examples.html">SpellPrefabManager</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://csharp.hotexamples.com/examples/Morpho25.IO/Simx/-/php-simx-class-examples.html">Simx</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://csharp.hotexamples.com/examples/-/wle_fnGuiSwatchButtonCtrl_setColor/-/php-wle_fnguiswatchbuttonctrl_setcolor-class-examples.html">wle_fnGuiSwatchButtonCtrl_setColor</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://csharp.hotexamples.com/examples/-/st.net.NetBase.id_list/-/php-st.net.netbase.id_list-class-examples.html">st.net.NetBase.id_list</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://csharp.hotexamples.com/examples/binance.dex.sdk.message/NewOrderMessage/-/php-newordermessage-class-examples.html">NewOrderMessage</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://csharp.hotexamples.com/examples/-/IGameRecordData/-/php-igamerecorddata-class-examples.html">IGameRecordData</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://csharp.hotexamples.com/examples/DW2DBViewer/AllDigimonsVM/-/php-alldigimonsvm-class-examples.html">AllDigimonsVM</a> </div> </figure> </div> </div> <div class="main-content"> <div class="addthis_inline_share_toolbox_o6yp"></div> <div id="ezoic-pub-ad-placeholder-106"> </div> <div class="example-item" id="0xb0ac0725a3f6cf38de28c77d513fa8bdcf8824e1d8f5d1de2e040cb6f5d2dcd4-93,,151,"> <div class="bs-example"> <div> <div class="bs-example-title">Example #1</div> <div style="position: absolute;right: 15px;top: 10px;" id="rating_1" data-hash="0xb0ac0725a3f6cf38de28c77d513fa8bdcf8824e1d8f5d1de2e040cb6f5d2dcd4" data-area="93,,151,"> <div class="rating-amount">0</div> <a title="Mark this example as good" href="javascript:app.addRating(1, '1')" class="rating-up btn btn-success" data-id="rating_1"><i class="icon-button icon-thumbs-up"></i></a> <a title="Mark this example as bad" href="javascript:app.addRating(-1,'1')" class="rating-down btn btn-danger" data-id="rating_1"><i class="icon-button icon-thumbs-down"></i></a> </div> </div> <div style="display:flex;align-items: center;flex-wrap: wrap"> <div style="display: inline-block;margin-right: 10px"> <a class="btn btn-default" title="Direct link to this example" href="https://csharp.hotexamples.com/examples/-/XPathNavigator/DeleteSelf/php-xpathnavigator-deleteself-method-examples.html#0xb0ac0725a3f6cf38de28c77d513fa8bdcf8824e1d8f5d1de2e040cb6f5d2dcd4-93,,151,"><i class="icon-button icon-link"></i></a> <a rel="nofollow" class="btn btn-default" href="javascript:app.open('https://csharp.hotexamples.com/site/file?hash=0xb0ac0725a3f6cf38de28c77d513fa8bdcf8824e1d8f5d1de2e040cb6f5d2dcd4')">Show file</a> </div> <div class="example-project-info"> <nobr> <a target="_blank" rel="nofollow" href="https://csharp.hotexamples.com/site/redirect"></a> </nobr> </div> </div> </div> <figure class="highlight"> <div class="example" data-id="1"> <pre class="line-numbers language-csharp" data-end="151" data-start="94" data-highlight="136,146"> public static string TruncateHtml(string text, int maxWordCount, bool decodeHtmlBeforeParsing) { if (decodeHtmlBeforeParsing) { text = HttpUtility.HtmlDecode(text); } text = "<body>" + text + "</body>"; int wordsAvailable = maxWordCount; XmlDocument xml = new XmlDocument(); xml.LoadXml("" + text + ""); XPathNavigator navigator = xml.CreateNavigator(); XPathNavigator breakPoint = null; string lastText = string.Empty; // find the text node we need: while (navigator.MoveToFollowing(XPathNodeType.Text)) { if (navigator.Value.Trim() != string.Empty) { lastText = WordUtil.GetWordCount(navigator.Value.Trim()) > wordsAvailable ? WordUtil.GetSubStringWords(wordsAvailable, navigator.Value.Trim()) : navigator.Value; } wordsAvailable = wordsAvailable - WordUtil.GetWordCount(navigator.Value); if (wordsAvailable <= 0) { navigator.SetValue(lastText); breakPoint = navigator.Clone(); break; } } //first remove text nodes while (navigator.MoveToFollowing(XPathNodeType.Text)) { if (navigator.ComparePosition(breakPoint) == XmlNodeOrder.After) { navigator.DeleteSelf(); } } //// moves to parent, then move the rest navigator.MoveTo(breakPoint); while (navigator.MoveToFollowing(XPathNodeType.Element)) { if (navigator.ComparePosition(breakPoint) == XmlNodeOrder.After) { navigator.DeleteSelf(); } } navigator.MoveToRoot(); return(navigator.InnerXml); }</pre> </div> </figure> </div> <div id="ezoic-pub-ad-placeholder-107"> <div style="text-align: center;margin-bottom: 10px"> <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script> <!-- after-example-1 --> <ins class="adsbygoogle" style="display:block" data-ad-client="ca-pub-3697522372581514" data-ad-slot="4981531786" data-ad-format="auto" data-full-width-responsive="true"></ins> <script> (adsbygoogle = window.adsbygoogle || []).push({}); </script> </div> </div> <div class="example-item" id="0xbce45ad186eeb6245470d8e079eaa67862d35d127e187376fe2b3c7c1400ac33-84,,94,"> <div class="bs-example"> <div> <div class="bs-example-title">Example #2</div> <div style="position: absolute;right: 15px;top: 10px;" id="rating_2" data-hash="0xbce45ad186eeb6245470d8e079eaa67862d35d127e187376fe2b3c7c1400ac33" data-area="84,,94,"> <div class="rating-amount">0</div> <a title="Mark this example as good" href="javascript:app.addRating(1, '2')" class="rating-up btn btn-success" data-id="rating_2"><i class="icon-button icon-thumbs-up"></i></a> <a title="Mark this example as bad" href="javascript:app.addRating(-1,'2')" class="rating-down btn btn-danger" data-id="rating_2"><i class="icon-button icon-thumbs-down"></i></a> </div> </div> <div style="display:flex;align-items: center;flex-wrap: wrap"> <div style="display: inline-block;margin-right: 10px"> <a class="btn btn-default" title="Direct link to this example" href="https://csharp.hotexamples.com/examples/-/XPathNavigator/DeleteSelf/php-xpathnavigator-deleteself-method-examples.html#0xbce45ad186eeb6245470d8e079eaa67862d35d127e187376fe2b3c7c1400ac33-84,,94,"><i class="icon-button icon-link"></i></a> <a rel="nofollow" class="btn btn-default" href="javascript:app.open('https://csharp.hotexamples.com/site/file?hash=0xbce45ad186eeb6245470d8e079eaa67862d35d127e187376fe2b3c7c1400ac33')">Show file</a> </div> <div class="example-project-info"> <nobr> <a target="_blank" rel="nofollow" href="https://csharp.hotexamples.com/site/redirect"></a> </nobr> </div> </div> </div> <figure class="highlight"> <div class="example" data-id="2"> <pre class="line-numbers language-csharp" data-end="94" data-start="85" data-highlight="89,93"> public static void DeleteChildren(this XPathNavigator node) { while (node.MoveToFirstChild()) { node.DeleteSelf(); } while (node.MoveToFirstAttribute()) { node.DeleteSelf(); } }</pre> </div> </figure> </div> <div id="ezoic-pub-ad-placeholder-108"> <div style="text-align: center;"> <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script> <!-- after-example-2 --> <ins class="adsbygoogle" style="display:block" data-ad-client="ca-pub-3697522372581514" data-ad-slot="7155150962" data-ad-format="auto" data-full-width-responsive="true"></ins> <script> (adsbygoogle = window.adsbygoogle || []).push({}); </script> </div> </div> <div class="example-item" id="0xd810bdd346092ba76842e72c72e8964e801c47ca203d233d77f2dfdc6adda624-703,,761,"> <div class="bs-example"> <div> <div class="bs-example-title">Example #3</div> <div style="position: absolute;right: 15px;top: 10px;" id="rating_3" data-hash="0xd810bdd346092ba76842e72c72e8964e801c47ca203d233d77f2dfdc6adda624" data-area="703,,761,"> <div class="rating-amount">0</div> <a title="Mark this example as good" href="javascript:app.addRating(1, '3')" class="rating-up btn btn-success" data-id="rating_3"><i class="icon-button icon-thumbs-up"></i></a> <a title="Mark this example as bad" href="javascript:app.addRating(-1,'3')" class="rating-down btn btn-danger" data-id="rating_3"><i class="icon-button icon-thumbs-down"></i></a> </div> </div> <div style="display:flex;align-items: center;flex-wrap: wrap"> <div style="display: inline-block;margin-right: 10px"> <a class="btn btn-default" title="Direct link to this example" href="https://csharp.hotexamples.com/examples/-/XPathNavigator/DeleteSelf/php-xpathnavigator-deleteself-method-examples.html#0xd810bdd346092ba76842e72c72e8964e801c47ca203d233d77f2dfdc6adda624-703,,761,"><i class="icon-button icon-link"></i></a> <a rel="nofollow" class="btn btn-default" href="javascript:app.open('https://csharp.hotexamples.com/site/file?hash=0xd810bdd346092ba76842e72c72e8964e801c47ca203d233d77f2dfdc6adda624&fullName=devtreks-master%2Fsrc%2FDevTreks.Data%2FXPathIO.cs&project=kpboyle1%2Fdevtreks')">Show file</a> </div> <div class="example-project-info"> <nobr> <span>File:</span> <a target="_blank" rel="nofollow" href="https://csharp.hotexamples.com/site/redirect?url=https%3A%2F%2Fgithub.com%2Fkpboyle1%2Fdevtreks%2Fblob%2Fmaster%2Fdevtreks-master%2Fsrc%2FDevTreks.Data%2FXPathIO.cs">XPathIO.cs</a> </nobr> <nobr> <span>Project:</span> <a target="_blank" rel="nofollow" href="https://csharp.hotexamples.com/site/redirect?url=https%3A%2F%2Fgithub.com%2Fkpboyle1%2Fdevtreks">kpboyle1/devtreks</a> </nobr> </div> </div> </div> <figure class="highlight"> <div class="example" data-id="3"> <pre class="line-numbers language-csharp" data-end="761" data-start="704" data-highlight="716,721,726,731,740,746,752,758"> public static void RemoveStandardAttributes(XPathNavigator elementNav, string prefix, string urn) { if (elementNav != null) { bool bHasMoved = false; if (urn != string.Empty) { //delete standard atts bHasMoved = elementNav.MoveToAttribute(AppHelpers.Calculator.cId, urn); if (bHasMoved) { elementNav.DeleteSelf(); } bHasMoved = elementNav.MoveToAttribute("Name", urn); if (bHasMoved) { elementNav.DeleteSelf(); } bHasMoved = elementNav.MoveToAttribute("Label", urn); if (bHasMoved) { elementNav.DeleteSelf(); } bHasMoved = elementNav.MoveToAttribute("Description", urn); if (bHasMoved) { elementNav.DeleteSelf(); } } else { //delete id att bHasMoved = elementNav.MoveToAttribute(AppHelpers.Calculator.cId, string.Empty); if (bHasMoved) { elementNav.DeleteSelf(); } //delete name att bHasMoved = elementNav.MoveToAttribute("Name", string.Empty); if (bHasMoved) { elementNav.DeleteSelf(); } //delete label att bHasMoved = elementNav.MoveToAttribute("Label", string.Empty); if (bHasMoved) { elementNav.DeleteSelf(); } //delete description bHasMoved = elementNav.MoveToAttribute("Description", string.Empty); if (bHasMoved) { elementNav.DeleteSelf(); } } } }</pre> </div> </figure> </div> <div id="ezoic-pub-ad-placeholder-109"> <div style="text-align: center;"> <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script> <!-- after-example-3 --> <ins class="adsbygoogle" style="display:block" data-ad-client="ca-pub-3697522372581514" data-ad-slot="8699811701" data-ad-format="auto" data-full-width-responsive="true"></ins> <script> (adsbygoogle = window.adsbygoogle || []).push({}); </script> </div> </div> <div class="example-item" id="0x7d824c8c82519f2d1ced208d0e486262fda510a6976fb77faadbd26766213ebb-213,,219,"> <div class="bs-example"> <div> <div class="bs-example-title">Example #4</div> <div style="position: absolute;right: 15px;top: 10px;" id="rating_4" data-hash="0x7d824c8c82519f2d1ced208d0e486262fda510a6976fb77faadbd26766213ebb" data-area="213,,219,"> <div class="rating-amount">0</div> <a title="Mark this example as good" href="javascript:app.addRating(1, '4')" class="rating-up btn btn-success" data-id="rating_4"><i class="icon-button icon-thumbs-up"></i></a> <a title="Mark this example as bad" href="javascript:app.addRating(-1,'4')" class="rating-down btn btn-danger" data-id="rating_4"><i class="icon-button icon-thumbs-down"></i></a> </div> </div> <div style="display:flex;align-items: center;flex-wrap: wrap"> <div style="display: inline-block;margin-right: 10px"> <a class="btn btn-default" title="Direct link to this example" href="https://csharp.hotexamples.com/examples/-/XPathNavigator/DeleteSelf/php-xpathnavigator-deleteself-method-examples.html#0x7d824c8c82519f2d1ced208d0e486262fda510a6976fb77faadbd26766213ebb-213,,219,"><i class="icon-button icon-link"></i></a> <a rel="nofollow" class="btn btn-default" href="javascript:app.open('https://csharp.hotexamples.com/site/file?hash=0x7d824c8c82519f2d1ced208d0e486262fda510a6976fb77faadbd26766213ebb&fullName=LTwithPay.cs&project=TorOskar%2FInfoPathCodeSnippets')">Show file</a> </div> <div class="example-project-info"> <nobr> <span>File:</span> <a target="_blank" rel="nofollow" href="https://csharp.hotexamples.com/site/redirect?url=https%3A%2F%2Fgithub.com%2FTorOskar%2FInfoPathCodeSnippets%2Fblob%2Fmaster%2FLTwithPay.cs">LTwithPay.cs</a> </nobr> <nobr> <span>Project:</span> <a target="_blank" rel="nofollow" href="https://csharp.hotexamples.com/site/redirect?url=https%3A%2F%2Fgithub.com%2FTorOskar%2FInfoPathCodeSnippets">TorOskar/InfoPathCodeSnippets</a> </nobr> </div> </div> </div> <figure class="highlight"> <div class="example" data-id="4"> <pre class="line-numbers language-csharp" data-end="219" data-start="214" data-highlight="218"> public void DeleteNil(XPathNavigator node) { if (node.MoveToAttribute("nil", "http://www.w3.org/2001/XMLSchema-instance")) { node.DeleteSelf(); } }</pre> </div> </figure> </div> <div id="ezoic-pub-ad-placeholder-110"> </div> <div class="example-item" id="0xdc3309b61f824104cfceaa486e8a101865d0dd4cba8a8e37340ed29cb91ce90a-320,,355,"> <div class="bs-example"> <div> <div class="bs-example-title">Example #5</div> <div style="position: absolute;right: 15px;top: 10px;" id="rating_5" data-hash="0xdc3309b61f824104cfceaa486e8a101865d0dd4cba8a8e37340ed29cb91ce90a" data-area="320,,355,"> <div class="rating-amount">0</div> <a title="Mark this example as good" href="javascript:app.addRating(1, '5')" class="rating-up btn btn-success" data-id="rating_5"><i class="icon-button icon-thumbs-up"></i></a> <a title="Mark this example as bad" href="javascript:app.addRating(-1,'5')" class="rating-down btn btn-danger" data-id="rating_5"><i class="icon-button icon-thumbs-down"></i></a> </div> </div> <div style="display:flex;align-items: center;flex-wrap: wrap"> <div style="display: inline-block;margin-right: 10px"> <a class="btn btn-default" title="Direct link to this example" href="https://csharp.hotexamples.com/examples/-/XPathNavigator/DeleteSelf/php-xpathnavigator-deleteself-method-examples.html#0xdc3309b61f824104cfceaa486e8a101865d0dd4cba8a8e37340ed29cb91ce90a-320,,355,"><i class="icon-button icon-link"></i></a> <a rel="nofollow" class="btn btn-default" href="javascript:app.open('https://csharp.hotexamples.com/site/file?hash=0xdc3309b61f824104cfceaa486e8a101865d0dd4cba8a8e37340ed29cb91ce90a')">Show file</a> </div> <div class="example-project-info"> <nobr> <a target="_blank" rel="nofollow" href="https://csharp.hotexamples.com/site/redirect"></a> </nobr> </div> </div> </div> <figure class="highlight"> <div class="example" data-id="5"> <pre class="line-numbers language-csharp" data-end="355" data-start="321" data-highlight="349"> /// <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); } }</pre> </div> </figure> </div> <div id="ezoic-pub-ad-placeholder-111"> </div> <div class="example-item" id="0xdfb05440466e7fdc0627e5c7840975c8b78e3b5bde485200f3540ca7f230659e-477,,536,"> <div class="bs-example"> <div> <div class="bs-example-title">Example #6</div> <div style="position: absolute;right: 15px;top: 10px;" id="rating_6" data-hash="0xdfb05440466e7fdc0627e5c7840975c8b78e3b5bde485200f3540ca7f230659e" data-area="477,,536,"> <div class="rating-amount">0</div> <a title="Mark this example as good" href="javascript:app.addRating(1, '6')" class="rating-up btn btn-success" data-id="rating_6"><i class="icon-button icon-thumbs-up"></i></a> <a title="Mark this example as bad" href="javascript:app.addRating(-1,'6')" class="rating-down btn btn-danger" data-id="rating_6"><i class="icon-button icon-thumbs-down"></i></a> </div> </div> <div style="display:flex;align-items: center;flex-wrap: wrap"> <div style="display: inline-block;margin-right: 10px"> <a class="btn btn-default" title="Direct link to this example" href="https://csharp.hotexamples.com/examples/-/XPathNavigator/DeleteSelf/php-xpathnavigator-deleteself-method-examples.html#0xdfb05440466e7fdc0627e5c7840975c8b78e3b5bde485200f3540ca7f230659e-477,,536,"><i class="icon-button icon-link"></i></a> <a rel="nofollow" class="btn btn-default" href="javascript:app.open('https://csharp.hotexamples.com/site/file?hash=0xdfb05440466e7fdc0627e5c7840975c8b78e3b5bde485200f3540ca7f230659e')">Show file</a> </div> <div class="example-project-info"> <nobr> <a target="_blank" rel="nofollow" href="https://csharp.hotexamples.com/site/redirect"></a> </nobr> </div> </div> </div> <figure class="highlight"> <div class="example" data-id="6"> <pre class="line-numbers language-csharp" data-end="536" data-start="478" data-highlight="536"> private void InsertFlash(XmlDocument document, string key, XPathNavigator artLink, MediaTarget target) { if (_flashTargets == null) { _flashTargets = new List <MediaTarget>(); } // evaluate the path string path = document.CreateNavigator().Evaluate( target.OutputXPath).ToString(); if (target.baseOutputPath != null) { path = Path.Combine(target.baseOutputPath, path); } string outputPath = Path.Combine(path, target.Name); string targetDirectory = Path.GetDirectoryName(outputPath); if (!Directory.Exists(targetDirectory)) { Directory.CreateDirectory(targetDirectory); } if (File.Exists(target.InputPath)) { if (File.Exists(outputPath)) { File.SetAttributes(outputPath, FileAttributes.Normal); } File.Copy(target.InputPath, outputPath, true); } else { this.WriteMessage(MessageLevel.Warn, String.Format( "The file '{0}' for the art target '{1}' was not found.", target.InputPath, target.Id)); } XmlWriter writer = artLink.InsertAfter(); _flashTargets.Add(target); writer.WriteStartElement("div"); // start - div writer.WriteAttributeString("id", target.Id); if (!String.IsNullOrEmpty(target.Text)) { writer.WriteStartElement("p"); // start - p writer.WriteString(target.Text); writer.WriteEndElement(); // end - p } writer.WriteEndElement(); // end - div writer.Close(); artLink.DeleteSelf(); }</pre> </div> </figure> </div> <div class="example-item" id="0x1de328ec685e75c6f2ad9a2cce448896c99dc96d39a3ecbe12d846ec77f2e617-103,,143,"> <div class="bs-example"> <div> <div class="bs-example-title">Example #7</div> <div style="position: absolute;right: 15px;top: 10px;" id="rating_7" data-hash="0x1de328ec685e75c6f2ad9a2cce448896c99dc96d39a3ecbe12d846ec77f2e617" data-area="103,,143,"> <div class="rating-amount">0</div> <a title="Mark this example as good" href="javascript:app.addRating(1, '7')" class="rating-up btn btn-success" data-id="rating_7"><i class="icon-button icon-thumbs-up"></i></a> <a title="Mark this example as bad" href="javascript:app.addRating(-1,'7')" class="rating-down btn btn-danger" data-id="rating_7"><i class="icon-button icon-thumbs-down"></i></a> </div> </div> <div style="display:flex;align-items: center;flex-wrap: wrap"> <div style="display: inline-block;margin-right: 10px"> <a class="btn btn-default" title="Direct link to this example" href="https://csharp.hotexamples.com/examples/-/XPathNavigator/DeleteSelf/php-xpathnavigator-deleteself-method-examples.html#0x1de328ec685e75c6f2ad9a2cce448896c99dc96d39a3ecbe12d846ec77f2e617-103,,143,"><i class="icon-button icon-link"></i></a> <a rel="nofollow" class="btn btn-default" href="javascript:app.open('https://csharp.hotexamples.com/site/file?hash=0x1de328ec685e75c6f2ad9a2cce448896c99dc96d39a3ecbe12d846ec77f2e617&fullName=Ozrk-RDR-GTA-DISSAMBLY-master%2FPresentationFramework%2FSystem%2FWindows%2FAnnotations%2FXmlStreamStore.cs&project=DesignerdriP%2FOzrk-RDR-GTA-DISSAMBLY')">Show file</a> </div> <div class="example-project-info"> <nobr> <span>File:</span> <a target="_blank" rel="nofollow" href="https://csharp.hotexamples.com/site/redirect?url=https%3A%2F%2Fgithub.com%2FDesignerdriP%2FOzrk-RDR-GTA-DISSAMBLY%2Fblob%2Fmaster%2FOzrk-RDR-GTA-DISSAMBLY-master%2FPresentationFramework%2FSystem%2FWindows%2FAnnotations%2FXmlStreamStore.cs">XmlStreamStore.cs</a> </nobr> <nobr> <span>Project:</span> <a target="_blank" rel="nofollow" href="https://csharp.hotexamples.com/site/redirect?url=https%3A%2F%2Fgithub.com%2FDesignerdriP%2FOzrk-RDR-GTA-DISSAMBLY">DesignerdriP/Ozrk-RDR-GTA-DISSAMBLY</a> </nobr> </div> </div> </div> <figure class="highlight"> <div class="example" data-id="7"> <pre class="line-numbers language-csharp" data-end="143" data-start="104" data-highlight="130"> /// <summary>Deletes the annotation with the specified <see cref="P:System.Windows.Annotations.Annotation.Id" /> from the store. </summary> /// <param name="annotationId">The globally unique identifier (GUID)Â <see cref="P:System.Windows.Annotations.Annotation.Id" /> property of the annotation to be deleted.</param> /// <returns>The annotation that was deleted; otherwise, <see langword="null" /> if an annotation with the specified <paramref name="annotationId" /> was not found in the store.</returns> /// <exception cref="T:System.ObjectDisposedException"> /// <see cref="Overload:System.Windows.Annotations.Storage.AnnotationStore.Dispose" /> has been called on the store.</exception> /// <exception cref="T:System.InvalidOperationException">An I/O <see cref="T:System.IO.Stream" /> has not been set for the store.</exception> // Token: 0x0600636E RID: 25454 RVA: 0x001BF4E8 File Offset: 0x001BD6E8 public override Annotation DeleteAnnotation(Guid annotationId) { Annotation annotation = null; object syncRoot = base.SyncRoot; lock (syncRoot) { EventTrace.EasyTraceEvent(EventTrace.Keyword.KeywordAnnotation, EventTrace.Event.DeleteAnnotationBegin); try { this.CheckStatus(); annotation = this._storeAnnotationsMap.FindAnnotation(annotationId); XPathNavigator annotationNodeForId = this.GetAnnotationNodeForId(annotationId); if (annotationNodeForId != null) { if (annotation == null) { annotation = (Annotation)XmlStreamStore._serializer.Deserialize(annotationNodeForId.ReadSubtree()); } annotationNodeForId.DeleteSelf(); } this._storeAnnotationsMap.RemoveAnnotation(annotationId); } finally { EventTrace.EasyTraceEvent(EventTrace.Keyword.KeywordAnnotation, EventTrace.Event.DeleteAnnotationEnd); } } if (annotation != null) { this.OnStoreContentChanged(new StoreContentChangedEventArgs(StoreContentAction.Deleted, annotation)); } return(annotation); }</pre> </div> </figure> </div> <div class="example-item" id="0xf8f25b8c7d930acb9430ebc4e68bdd5a5a8f0e3b66dfe52147a616eaea6a1403-737,,764,"> <div class="bs-example"> <div> <div class="bs-example-title">Example #8</div> <div style="position: absolute;right: 15px;top: 10px;" id="rating_8" data-hash="0xf8f25b8c7d930acb9430ebc4e68bdd5a5a8f0e3b66dfe52147a616eaea6a1403" data-area="737,,764,"> <div class="rating-amount">0</div> <a title="Mark this example as good" href="javascript:app.addRating(1, '8')" class="rating-up btn btn-success" data-id="rating_8"><i class="icon-button icon-thumbs-up"></i></a> <a title="Mark this example as bad" href="javascript:app.addRating(-1,'8')" class="rating-down btn btn-danger" data-id="rating_8"><i class="icon-button icon-thumbs-down"></i></a> </div> </div> <div style="display:flex;align-items: center;flex-wrap: wrap"> <div style="display: inline-block;margin-right: 10px"> <a class="btn btn-default" title="Direct link to this example" href="https://csharp.hotexamples.com/examples/-/XPathNavigator/DeleteSelf/php-xpathnavigator-deleteself-method-examples.html#0xf8f25b8c7d930acb9430ebc4e68bdd5a5a8f0e3b66dfe52147a616eaea6a1403-737,,764,"><i class="icon-button icon-link"></i></a> <a rel="nofollow" class="btn btn-default" href="javascript:app.open('https://csharp.hotexamples.com/site/file?hash=0xf8f25b8c7d930acb9430ebc4e68bdd5a5a8f0e3b66dfe52147a616eaea6a1403&fullName=SandAssists-master%2FMain%2FSource%2FHelpers%2FReferenceFilterConfigurator.cs&project=paulushub%2FSandAssists')">Show file</a> </div> <div class="example-project-info"> <nobr> <span>File:</span> <a target="_blank" rel="nofollow" href="https://csharp.hotexamples.com/site/redirect?url=https%3A%2F%2Fgithub.com%2Fpaulushub%2FSandAssists%2Fblob%2Fmaster%2FSandAssists-master%2FMain%2FSource%2FHelpers%2FReferenceFilterConfigurator.cs">ReferenceFilterConfigurator.cs</a> </nobr> <nobr> <span>Project:</span> <a target="_blank" rel="nofollow" href="https://csharp.hotexamples.com/site/redirect?url=https%3A%2F%2Fgithub.com%2Fpaulushub%2FSandAssists">paulushub/SandAssists</a> </nobr> </div> </div> </div> <figure class="highlight"> <div class="example" data-id="8"> <pre class="line-numbers language-csharp" data-end="764" data-start="738" data-highlight="764"> private void OnOptionsItem(string keyword, XPathNavigator navigator) { //<!-- Whether to include protected sealed members --> //<protectedSealed expose="false" /> //<!-- Whether to include "no-PIA" COM types, aka types marked // with TypeIdentifierAttribute and CompilerGeneratedAttribute --> //<noPIA expose="false" /> string sandcastleDir = _context.SandcastleDirectory; XmlWriter writer = navigator.InsertAfter(); // For the extension method addin... writer.WriteComment(" Whether to include protected sealed members "); writer.WriteStartElement("protectedSealed"); // start: protectedSealed writer.WriteAttributeString("expose", "true"); writer.WriteEndElement(); // end: protectedSealed // For the XAML attached members addin... writer.WriteComment( " Whether to include \"no-PIA\" COM types, aka types marked with TypeIdentifierAttribute and CompilerGeneratedAttribute "); writer.WriteStartElement("noPIA"); // start: noPIA writer.WriteAttributeString("expose", "false"); writer.WriteEndElement(); // end: noPIA writer.Close(); navigator.DeleteSelf(); }</pre> </div> </figure> </div> <div class="example-item" id="0x0d1c6f3083685921bf50b4fd22fac9130e4b6035a37123e47c78ed5e8226c2d4-277,,304,"> <div class="bs-example"> <div> <div class="bs-example-title">Example #9</div> <div style="position: absolute;right: 15px;top: 10px;" id="rating_9" data-hash="0x0d1c6f3083685921bf50b4fd22fac9130e4b6035a37123e47c78ed5e8226c2d4" data-area="277,,304,"> <div class="rating-amount">0</div> <a title="Mark this example as good" href="javascript:app.addRating(1, '9')" class="rating-up btn btn-success" data-id="rating_9"><i class="icon-button icon-thumbs-up"></i></a> <a title="Mark this example as bad" href="javascript:app.addRating(-1,'9')" class="rating-down btn btn-danger" data-id="rating_9"><i class="icon-button icon-thumbs-down"></i></a> </div> </div> <div style="display:flex;align-items: center;flex-wrap: wrap"> <div style="display: inline-block;margin-right: 10px"> <a class="btn btn-default" title="Direct link to this example" href="https://csharp.hotexamples.com/examples/-/XPathNavigator/DeleteSelf/php-xpathnavigator-deleteself-method-examples.html#0x0d1c6f3083685921bf50b4fd22fac9130e4b6035a37123e47c78ed5e8226c2d4-277,,304,"><i class="icon-button icon-link"></i></a> <a rel="nofollow" class="btn btn-default" href="javascript:app.open('https://csharp.hotexamples.com/site/file?hash=0x0d1c6f3083685921bf50b4fd22fac9130e4b6035a37123e47c78ed5e8226c2d4&fullName=PnPVisualator-master%2FNotificationTab.cs&project=tools81%2FPnPVisualator')">Show file</a> </div> <div class="example-project-info"> <nobr> <span>File:</span> <a target="_blank" rel="nofollow" href="https://csharp.hotexamples.com/site/redirect?url=https%3A%2F%2Fgithub.com%2Ftools81%2FPnPVisualator%2Fblob%2Fmaster%2FPnPVisualator-master%2FNotificationTab.cs">NotificationTab.cs</a> </nobr> <nobr> <span>Project:</span> <a target="_blank" rel="nofollow" href="https://csharp.hotexamples.com/site/redirect?url=https%3A%2F%2Fgithub.com%2Ftools81%2FPnPVisualator">tools81/PnPVisualator</a> </nobr> </div> </div> </div> <figure class="highlight"> <div class="example" data-id="9"> <pre class="line-numbers language-csharp" data-end="304" data-start="278" data-highlight="295"> private void Sell_Clicked(object sender, EventArgs e) { Button btn = ((Button)sender); string id = btn.Name.Replace(_acceptButtonPrefix, String.Empty); Control ctrl = pnlNotifications.Controls.Find(_numericPrefix + id, true)[0]; NumericUpDown num = ((NumericUpDown)ctrl); XmlDocument xDoc = new XmlDocument(); xDoc.Load(Global.NotificationXml); XPathNavigator xNotifNav = xDoc.CreateNavigator().SelectSingleNode(String.Format("Notifications/RequestSell[@ID='{0}']", id)); CharacterUpdate.RemoveItemFromCharacter(xNotifNav.SelectSingleNode("@Item").Value, id, xNotifNav.SelectSingleNode("@Character").Value); CharacterUpdate.AddItemToCharacter(null, "Cash", null, xNotifNav.SelectSingleNode("@Character").Value, Convert.ToInt32(num.Value)); xNotifNav.DeleteSelf(); while (Global.IsFileLocked(Global.NotificationXml)) { Thread.Sleep(1000); } FileStream lvFS = new FileStream(Global.NotificationXml, FileMode.Truncate, FileAccess.Write, FileShare.ReadWrite); xDoc.Save(lvFS); lvFS.Close(); }</pre> </div> </figure> </div> <div class="example-item" id="0xcc80b5cce4c16da56bffcc17e083b226111880e20d1780f31a7ba05b51d912b4-59,,86,"> <div class="bs-example"> <div> <div class="bs-example-title">Example #10</div> <div style="position: absolute;right: 15px;top: 10px;" id="rating_10" data-hash="0xcc80b5cce4c16da56bffcc17e083b226111880e20d1780f31a7ba05b51d912b4" data-area="59,,86,"> <div class="rating-amount">0</div> <a title="Mark this example as good" href="javascript:app.addRating(1, '10')" class="rating-up btn btn-success" data-id="rating_10"><i class="icon-button icon-thumbs-up"></i></a> <a title="Mark this example as bad" href="javascript:app.addRating(-1,'10')" class="rating-down btn btn-danger" data-id="rating_10"><i class="icon-button icon-thumbs-down"></i></a> </div> </div> <div style="display:flex;align-items: center;flex-wrap: wrap"> <div style="display: inline-block;margin-right: 10px"> <a class="btn btn-default" title="Direct link to this example" href="https://csharp.hotexamples.com/examples/-/XPathNavigator/DeleteSelf/php-xpathnavigator-deleteself-method-examples.html#0xcc80b5cce4c16da56bffcc17e083b226111880e20d1780f31a7ba05b51d912b4-59,,86,"><i class="icon-button icon-link"></i></a> <a rel="nofollow" class="btn btn-default" href="javascript:app.open('https://csharp.hotexamples.com/site/file?hash=0xcc80b5cce4c16da56bffcc17e083b226111880e20d1780f31a7ba05b51d912b4&fullName=cybersource-sdk-dotnet-future%2FCyberSource%2FCustomTextMessageEncoder.cs&project=scriv%2Fcybersource-sdk-dotnet')">Show file</a> </div> <div class="example-project-info"> <nobr> <span>File:</span> <a target="_blank" rel="nofollow" href="https://csharp.hotexamples.com/site/redirect?url=https%3A%2F%2Fgithub.com%2Fscriv%2Fcybersource-sdk-dotnet%2Fblob%2Fmaster%2Fcybersource-sdk-dotnet-future%2FCyberSource%2FCustomTextMessageEncoder.cs">CustomTextMessageEncoder.cs</a> </nobr> <nobr> <span>Project:</span> <a target="_blank" rel="nofollow" href="https://csharp.hotexamples.com/site/redirect?url=https%3A%2F%2Fgithub.com%2Fscriv%2Fcybersource-sdk-dotnet">scriv/cybersource-sdk-dotnet</a> </nobr> </div> </div> </div> <figure class="highlight"> <div class="example" data-id="10"> <pre class="line-numbers language-csharp" data-end="86" data-start="60" data-highlight="83"> public override Message ReadMessage(Stream stream, int maxSizeOfHeaders, string contentType) { var sr = new StreamReader(stream); var wireResponse = sr.ReadToEnd(); // Fix for Xml external entity injection violation in fortify report XmlReaderSettings settings = new XmlReaderSettings(); settings.DtdProcessing = DtdProcessing.Prohibit; settings.XmlResolver = null; XmlDocument doc = new XmlDocument(); XmlReader reader = XmlReader.Create(new StringReader(wireResponse), settings); doc.Load(reader); //We need to get rid of the security header because it is not signed by the web service. //The whole reason for the custom Encoder is to do this. the client rejected the unsigned header. //Our WCF client is set up to allow the absence of a security header but if the header exists then it must be signed. //Hopefully the namespace will not change. Maybe it should be put in a config. XPathNavigator n = doc.CreateNavigator(); if (n.MoveToFollowing("Security", "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd")) { n.DeleteSelf(); } reader = XmlReader.Create(new StringReader(doc.InnerXml), settings); return(Message.CreateMessage(reader, maxSizeOfHeaders, MessageVersion.Soap11)); }</pre> </div> </figure> </div> <div class="example-item" id="0xa0a8a9e129fc9550f341c859eb36431c7f7b7069f318b039f8c4bc7c132bca9a-575,,607,"> <div class="bs-example"> <div> <div class="bs-example-title">Example #11</div> <div style="position: absolute;right: 15px;top: 10px;" id="rating_11" data-hash="0xa0a8a9e129fc9550f341c859eb36431c7f7b7069f318b039f8c4bc7c132bca9a" data-area="575,,607,"> <div class="rating-amount">0</div> <a title="Mark this example as good" href="javascript:app.addRating(1, '11')" class="rating-up btn btn-success" data-id="rating_11"><i class="icon-button icon-thumbs-up"></i></a> <a title="Mark this example as bad" href="javascript:app.addRating(-1,'11')" class="rating-down btn btn-danger" data-id="rating_11"><i class="icon-button icon-thumbs-down"></i></a> </div> </div> <div style="display:flex;align-items: center;flex-wrap: wrap"> <div style="display: inline-block;margin-right: 10px"> <a class="btn btn-default" title="Direct link to this example" href="https://csharp.hotexamples.com/examples/-/XPathNavigator/DeleteSelf/php-xpathnavigator-deleteself-method-examples.html#0xa0a8a9e129fc9550f341c859eb36431c7f7b7069f318b039f8c4bc7c132bca9a-575,,607,"><i class="icon-button icon-link"></i></a> <a rel="nofollow" class="btn btn-default" href="javascript:app.open('https://csharp.hotexamples.com/site/file?hash=0xa0a8a9e129fc9550f341c859eb36431c7f7b7069f318b039f8c4bc7c132bca9a&fullName=SandAssists-master%2FMain%2FSource%2FHelpers%2FConceptualConfigurator.cs&project=paulushub%2FSandAssists')">Show file</a> </div> <div class="example-project-info"> <nobr> <span>File:</span> <a target="_blank" rel="nofollow" href="https://csharp.hotexamples.com/site/redirect?url=https%3A%2F%2Fgithub.com%2Fpaulushub%2FSandAssists%2Fblob%2Fmaster%2FSandAssists-master%2FMain%2FSource%2FHelpers%2FConceptualConfigurator.cs">ConceptualConfigurator.cs</a> </nobr> <nobr> <span>Project:</span> <a target="_blank" rel="nofollow" href="https://csharp.hotexamples.com/site/redirect?url=https%3A%2F%2Fgithub.com%2Fpaulushub%2FSandAssists">paulushub/SandAssists</a> </nobr> </div> </div> </div> <figure class="highlight"> <div class="example" data-id="11"> <pre class="line-numbers language-csharp" data-end="607" data-start="576" data-highlight="607"> /// <summary> /// This specifies the conceptual topic keywords metadata. /// </summary> /// <param name="sender"></param> /// <param name="args"></param> protected void OnMetadataKeywordsItem(string keyword, XPathNavigator navigator) { BuildContext context = this.Context; BuildGroupContext groupContext = context.GroupContexts[_group.Id]; if (groupContext == null) { throw new BuildException( "The group context is not provided, and it is required by the build system."); } //<copy base=".\XmlComp" file="concat($key,'.cmp.xml')" // source="/metadata/topic[@id=$key]/*" target="/document/metadata" /> XmlWriter xmlWriter = navigator.InsertAfter(); // For now, lets simply write the default... xmlWriter.WriteStartElement("copy"); xmlWriter.WriteAttributeString("base", String.Format( @".\{0}", groupContext["$DdueXmlCompDir"])); xmlWriter.WriteAttributeString("file", @"concat($key,'.cmp.xml')"); xmlWriter.WriteAttributeString("source", @"/metadata/topic[@id=$key]/*"); xmlWriter.WriteAttributeString("target", @"/document/metadata"); xmlWriter.WriteEndElement(); xmlWriter.Close(); navigator.DeleteSelf(); }</pre> </div> </figure> </div> <div class="example-item" id="0xa0a8a9e129fc9550f341c859eb36431c7f7b7069f318b039f8c4bc7c132bca9a-533,,569,"> <div class="bs-example"> <div> <div class="bs-example-title">Example #12</div> <div style="position: absolute;right: 15px;top: 10px;" id="rating_12" data-hash="0xa0a8a9e129fc9550f341c859eb36431c7f7b7069f318b039f8c4bc7c132bca9a" data-area="533,,569,"> <div class="rating-amount">0</div> <a title="Mark this example as good" href="javascript:app.addRating(1, '12')" class="rating-up btn btn-success" data-id="rating_12"><i class="icon-button icon-thumbs-up"></i></a> <a title="Mark this example as bad" href="javascript:app.addRating(-1,'12')" class="rating-down btn btn-danger" data-id="rating_12"><i class="icon-button icon-thumbs-down"></i></a> </div> </div> <div style="display:flex;align-items: center;flex-wrap: wrap"> <div style="display: inline-block;margin-right: 10px"> <a class="btn btn-default" title="Direct link to this example" href="https://csharp.hotexamples.com/examples/-/XPathNavigator/DeleteSelf/php-xpathnavigator-deleteself-method-examples.html#0xa0a8a9e129fc9550f341c859eb36431c7f7b7069f318b039f8c4bc7c132bca9a-533,,569,"><i class="icon-button icon-link"></i></a> <a rel="nofollow" class="btn btn-default" href="javascript:app.open('https://csharp.hotexamples.com/site/file?hash=0xa0a8a9e129fc9550f341c859eb36431c7f7b7069f318b039f8c4bc7c132bca9a&fullName=SandAssists-master%2FMain%2FSource%2FHelpers%2FConceptualConfigurator.cs&project=paulushub%2FSandAssists')">Show file</a> </div> <div class="example-project-info"> <nobr> <span>File:</span> <a target="_blank" rel="nofollow" href="https://csharp.hotexamples.com/site/redirect?url=https%3A%2F%2Fgithub.com%2Fpaulushub%2FSandAssists%2Fblob%2Fmaster%2FSandAssists-master%2FMain%2FSource%2FHelpers%2FConceptualConfigurator.cs">ConceptualConfigurator.cs</a> </nobr> <nobr> <span>Project:</span> <a target="_blank" rel="nofollow" href="https://csharp.hotexamples.com/site/redirect?url=https%3A%2F%2Fgithub.com%2Fpaulushub%2FSandAssists">paulushub/SandAssists</a> </nobr> </div> </div> </div> <figure class="highlight"> <div class="example" data-id="12"> <pre class="line-numbers language-csharp" data-end="569" data-start="534" data-highlight="569"> /// <summary> /// This specifies the token items used by the conceptual topics. /// </summary> /// <param name="sender"></param> /// <param name="args"></param> protected void OnTokensReplacedItem(string keyword, XPathNavigator navigator) { if (_group == null) { throw new BuildException( "There is not build group to provide the media/arts contents."); } bool replaceTokens = true; ConceptualPreTransConfiguration preTrans = _engineSettings.PreTrans; if (preTrans != null && preTrans.ResolveTokens) { replaceTokens = false; } if (replaceTokens) { XmlWriter xmlWriter = navigator.InsertAfter(); // <replace elements="/*//ddue:token[text()!='autoOutline']" item="string(.)" /> xmlWriter.WriteStartElement("replace"); xmlWriter.WriteAttributeString("elements", @"/*//ddue:token[text()!='autoOutline']"); xmlWriter.WriteAttributeString("item", "string(.)"); xmlWriter.WriteEndElement(); xmlWriter.Close(); } navigator.DeleteSelf(); }</pre> </div> </figure> </div> <div class="example-item" id="0xa93728c40dfd59adb234888a6ae8e2ba845016864e349691b05d2789b08a6853-344,,407,"> <div class="bs-example"> <div> <div class="bs-example-title">Example #13</div> <div style="position: absolute;right: 15px;top: 10px;" id="rating_13" data-hash="0xa93728c40dfd59adb234888a6ae8e2ba845016864e349691b05d2789b08a6853" data-area="344,,407,"> <div class="rating-amount">0</div> <a title="Mark this example as good" href="javascript:app.addRating(1, '13')" class="rating-up btn btn-success" data-id="rating_13"><i class="icon-button icon-thumbs-up"></i></a> <a title="Mark this example as bad" href="javascript:app.addRating(-1,'13')" class="rating-down btn btn-danger" data-id="rating_13"><i class="icon-button icon-thumbs-down"></i></a> </div> </div> <div style="display:flex;align-items: center;flex-wrap: wrap"> <div style="display: inline-block;margin-right: 10px"> <a class="btn btn-default" title="Direct link to this example" href="https://csharp.hotexamples.com/examples/-/XPathNavigator/DeleteSelf/php-xpathnavigator-deleteself-method-examples.html#0xa93728c40dfd59adb234888a6ae8e2ba845016864e349691b05d2789b08a6853-344,,407,"><i class="icon-button icon-link"></i></a> <a rel="nofollow" class="btn btn-default" href="javascript:app.open('https://csharp.hotexamples.com/site/file?hash=0xa93728c40dfd59adb234888a6ae8e2ba845016864e349691b05d2789b08a6853&fullName=SandAssists-master%2FMain%2FSource%2FComponents%2FInheritDocCopyComponent.cs&project=paulushub%2FSandAssists')">Show file</a> </div> <div class="example-project-info"> <nobr> <span>File:</span> <a target="_blank" rel="nofollow" href="https://csharp.hotexamples.com/site/redirect?url=https%3A%2F%2Fgithub.com%2Fpaulushub%2FSandAssists%2Fblob%2Fmaster%2FSandAssists-master%2FMain%2FSource%2FComponents%2FInheritDocCopyComponent.cs">InheritDocCopyComponent.cs</a> </nobr> <nobr> <span>Project:</span> <a target="_blank" rel="nofollow" href="https://csharp.hotexamples.com/site/redirect?url=https%3A%2F%2Fgithub.com%2Fpaulushub%2FSandAssists">paulushub/SandAssists</a> </nobr> </div> </div> </div> <figure class="highlight"> <div class="example" data-id="13"> <pre class="line-numbers language-csharp" data-end="407" data-start="345" data-highlight="395"> /// <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)) { this.WriteMessage(MessageLevel.Info, "Filter: " + selectValue); sourceExpression = XPathExpression.Compile(selectValue); } inheritDocNodeNavigator.MoveToParent(); bool isInnerText = false; if (inheritDocNodeNavigator.LocalName != "comments" && inheritDocNodeNavigator.LocalName != "element") { sourceExpression = XPathExpression.Compile(inheritDocNodeNavigator.LocalName); isInnerText = true; } else { inheritDocNodeNavigator.MoveTo( this.sourceDocument.CreateNavigator().SelectSingleNode(inheritDocExpression)); } XPathNodeIterator sources = (XPathNodeIterator)contentNodeNavigator.CreateNavigator().Evaluate(sourceExpression); if (isInnerText && sources.Count == 1) { //inheritDocNodeNavigator.DeleteSelf(); inheritDocNodeNavigator.MoveTo( this.sourceDocument.CreateNavigator().SelectSingleNode(inheritDocExpression)); // append the source nodes to the target node foreach (XPathNavigator source in sources) { inheritDocNodeNavigator.ReplaceSelf(source.InnerXml); } } else { inheritDocNodeNavigator.DeleteSelf(); // append the source nodes to the target node foreach (XPathNavigator source in sources) { XPathNodeIterator childIterator = inheritDocNodeNavigator.SelectChildren( source.Name, String.Empty); if (childIterator.Count == 0) { inheritDocNodeNavigator.AppendChild(source); } } } }</pre> </div> </figure> </div> <div class="example-item" id="0x10debf52005e1993d1587bcebdf836a589e9a6f8820440490b5f4726354c4015-28,,85,"> <div class="bs-example"> <div> <div class="bs-example-title">Example #14</div> <div style="position: absolute;right: 15px;top: 10px;" id="rating_14" data-hash="0x10debf52005e1993d1587bcebdf836a589e9a6f8820440490b5f4726354c4015" data-area="28,,85,"> <div class="rating-amount">0</div> <a title="Mark this example as good" href="javascript:app.addRating(1, '14')" class="rating-up btn btn-success" data-id="rating_14"><i class="icon-button icon-thumbs-up"></i></a> <a title="Mark this example as bad" href="javascript:app.addRating(-1,'14')" class="rating-down btn btn-danger" data-id="rating_14"><i class="icon-button icon-thumbs-down"></i></a> </div> </div> <div style="display:flex;align-items: center;flex-wrap: wrap"> <div style="display: inline-block;margin-right: 10px"> <a class="btn btn-default" title="Direct link to this example" href="https://csharp.hotexamples.com/examples/-/XPathNavigator/DeleteSelf/php-xpathnavigator-deleteself-method-examples.html#0x10debf52005e1993d1587bcebdf836a589e9a6f8820440490b5f4726354c4015-28,,85,"><i class="icon-button icon-link"></i></a> <a rel="nofollow" class="btn btn-default" href="javascript:app.open('https://csharp.hotexamples.com/site/file?hash=0x10debf52005e1993d1587bcebdf836a589e9a6f8820440490b5f4726354c4015')">Show file</a> </div> <div class="example-project-info"> <nobr> <a target="_blank" rel="nofollow" href="https://csharp.hotexamples.com/site/redirect"></a> </nobr> </div> </div> </div> <figure class="highlight"> <div class="example" data-id="14"> <pre class="line-numbers language-csharp" data-end="85" data-start="29" data-highlight="47"> public IXPathNavigable AddRunSettings(IXPathNavigable runSettingDocument, IRunSettingsConfigurationInfo configurationInfo, ILogger logger) { XPathNavigator runSettingsNavigator = runSettingDocument.CreateNavigator(); Debug.Assert(runSettingsNavigator != null, "userRunSettingsNavigator == null!"); if (!runSettingsNavigator.MoveToChild(Constants.RunSettingsName, "")) { logger.Log(MessageLevel.Warning, "RunSettingsDocument does not contain a RunSettings node! Canceling settings merging..."); return(runSettingsNavigator); } var settingsContainer = new RunSettingsContainer(); settingsContainer.SolutionSettings = new RunSettings(); if (CopyToUnsetValues(runSettingsNavigator, settingsContainer)) { runSettingsNavigator.DeleteSelf(); // this node is to be replaced by the final run settings } string solutionRunSettingsFile = GetSolutionSettingsXmlFile(); try { if (File.Exists(solutionRunSettingsFile)) { var solutionRunSettingsDocument = new XPathDocument(solutionRunSettingsFile); XPathNavigator solutionRunSettingsNavigator = solutionRunSettingsDocument.CreateNavigator(); if (solutionRunSettingsNavigator.MoveToChild(Constants.RunSettingsName, "")) { CopyToUnsetValues(solutionRunSettingsNavigator, settingsContainer); } else { logger.Log(MessageLevel.Warning, $"Solution test settings file found at '{solutionRunSettingsFile}', but does not contain {Constants.RunSettingsName} node"); } } } catch (Exception e) { logger.Log(MessageLevel.Warning, $"Solution test settings file could not be parsed, check file: {solutionRunSettingsFile}{Environment.NewLine}Exception: {e}"); } foreach (var projectSettings in settingsContainer.ProjectSettings) { projectSettings.GetUnsetValuesFrom(settingsContainer.SolutionSettings); } GetValuesFromGlobalSettings(settingsContainer); runSettingsNavigator.MoveToChild(Constants.RunSettingsName, ""); runSettingsNavigator.AppendChild(settingsContainer.ToXml().CreateNavigator()); runSettingsNavigator.MoveToRoot(); return(runSettingsNavigator); }</pre> </div> </figure> </div> <div class="example-item" id="0x80912586e3fa5e96afeb18c500f42dd28cf6e2572a7d19b13b249bdd272f631a-229,,285,"> <div class="bs-example"> <div> <div class="bs-example-title">Example #15</div> <div style="position: absolute;right: 15px;top: 10px;" id="rating_15" data-hash="0x80912586e3fa5e96afeb18c500f42dd28cf6e2572a7d19b13b249bdd272f631a" data-area="229,,285,"> <div class="rating-amount">0</div> <a title="Mark this example as good" href="javascript:app.addRating(1, '15')" class="rating-up btn btn-success" data-id="rating_15"><i class="icon-button icon-thumbs-up"></i></a> <a title="Mark this example as bad" href="javascript:app.addRating(-1,'15')" class="rating-down btn btn-danger" data-id="rating_15"><i class="icon-button icon-thumbs-down"></i></a> </div> </div> <div style="display:flex;align-items: center;flex-wrap: wrap"> <div style="display: inline-block;margin-right: 10px"> <a class="btn btn-default" title="Direct link to this example" href="https://csharp.hotexamples.com/examples/-/XPathNavigator/DeleteSelf/php-xpathnavigator-deleteself-method-examples.html#0x80912586e3fa5e96afeb18c500f42dd28cf6e2572a7d19b13b249bdd272f631a-229,,285,"><i class="icon-button icon-link"></i></a> <a rel="nofollow" class="btn btn-default" href="javascript:app.open('https://csharp.hotexamples.com/site/file?hash=0x80912586e3fa5e96afeb18c500f42dd28cf6e2572a7d19b13b249bdd272f631a&fullName=SandAssists-master%2FMain%2FSource%2FConceptualPreTransComponent.cs&project=paulushub%2FSandAssists')">Show file</a> </div> <div class="example-project-info"> <nobr> <span>File:</span> <a target="_blank" rel="nofollow" href="https://csharp.hotexamples.com/site/redirect?url=https%3A%2F%2Fgithub.com%2Fpaulushub%2FSandAssists%2Fblob%2Fmaster%2FSandAssists-master%2FMain%2FSource%2FConceptualPreTransComponent.cs">ConceptualPreTransComponent.cs</a> </nobr> <nobr> <span>Project:</span> <a target="_blank" rel="nofollow" href="https://csharp.hotexamples.com/site/redirect?url=https%3A%2F%2Fgithub.com%2Fpaulushub%2FSandAssists">paulushub/SandAssists</a> </nobr> </div> </div> </div> <figure class="highlight"> <div class="example" data-id="15"> <pre class="line-numbers language-csharp" data-end="285" data-start="230" data-highlight="284"> private void ApplyXsd(XPathNavigator documentNavigator, string key) { if (!_isIndexEnabled) { return; } XPathNodeIterator iterator = documentNavigator.Select(_xsdLinksSelector); if (iterator == null || iterator.Count == 0) { return; } XPathNavigator[] navigators = BuildComponentUtilities.ConvertNodeIteratorToArray(iterator); string topicType = _indexContent.TopicType; int itemCount = navigators.Length; for (int i = 0; i < itemCount; i++) { XPathNavigator navigator = navigators[i]; string linkUri = navigator.Value; if (!String.IsNullOrEmpty(linkUri)) { IndexItem item = _indexContent[linkUri]; if (item == null) { this.WriteMessage(MessageLevel.Warn, String.Format( "Link value for '{0}' in '{1}' not found", linkUri, key)); } else { XmlWriter writer = navigator.InsertAfter(); writer.WriteStartElement("link", IndexResolver.MamlNamespace); writer.WriteAttributeString("href", IndexResolver.XLinkNamespace, item.Id); if (!String.IsNullOrEmpty(topicType)) { writer.WriteAttributeString("topicType_id", topicType); } writer.WriteString(item.LinkTitle); writer.WriteEndElement(); writer.Close(); } } else { this.WriteMessage(MessageLevel.Warn, String.Format( "A link value in '{0}' is not specified.", key)); } navigator.DeleteSelf(); } }</pre> </div> </figure> </div> <div class="example-item" id="0x98057124d8594cf0630c843c116903353c1aefeb322ea71088c35d2e892ac574-679,,687,"> <div class="bs-example"> <div> <div class="bs-example-title">Example #16</div> <div style="position: absolute;right: 15px;top: 10px;" id="rating_16" data-hash="0x98057124d8594cf0630c843c116903353c1aefeb322ea71088c35d2e892ac574" data-area="679,,687,"> <div class="rating-amount">0</div> <a title="Mark this example as good" href="javascript:app.addRating(1, '16')" class="rating-up btn btn-success" data-id="rating_16"><i class="icon-button icon-thumbs-up"></i></a> <a title="Mark this example as bad" href="javascript:app.addRating(-1,'16')" class="rating-down btn btn-danger" data-id="rating_16"><i class="icon-button icon-thumbs-down"></i></a> </div> </div> <div style="display:flex;align-items: center;flex-wrap: wrap"> <div style="display: inline-block;margin-right: 10px"> <a class="btn btn-default" title="Direct link to this example" href="https://csharp.hotexamples.com/examples/-/XPathNavigator/DeleteSelf/php-xpathnavigator-deleteself-method-examples.html#0x98057124d8594cf0630c843c116903353c1aefeb322ea71088c35d2e892ac574-679,,687,"><i class="icon-button icon-link"></i></a> <a rel="nofollow" class="btn btn-default" href="javascript:app.open('https://csharp.hotexamples.com/site/file?hash=0x98057124d8594cf0630c843c116903353c1aefeb322ea71088c35d2e892ac574')">Show file</a> </div> <div class="example-project-info"> <nobr> <a target="_blank" rel="nofollow" href="https://csharp.hotexamples.com/site/redirect"></a> </nobr> </div> </div> </div> <figure class="highlight"> <div class="example" data-id="16"> <pre class="line-numbers language-csharp" data-end="687" data-start="680" data-highlight="687"> protected void OnSyntaxGeneratorsItem(string keyword, XPathNavigator navigator) { XmlWriter xmlWriter = navigator.InsertAfter(); this.WriteSyntaxGenerators(xmlWriter, _group.SyntaxUsage); xmlWriter.Close(); navigator.DeleteSelf(); }</pre> </div> </figure> </div> <div class="example-item" id="0x3915ca6b3f51b73c15af962106a24fb9622a05e298c04b75e68c5a1513aa3915-437,,445,"> <div class="bs-example"> <div> <div class="bs-example-title">Example #17</div> <div style="position: absolute;right: 15px;top: 10px;" id="rating_17" data-hash="0x3915ca6b3f51b73c15af962106a24fb9622a05e298c04b75e68c5a1513aa3915" data-area="437,,445,"> <div class="rating-amount">0</div> <a title="Mark this example as good" href="javascript:app.addRating(1, '17')" class="rating-up btn btn-success" data-id="rating_17"><i class="icon-button icon-thumbs-up"></i></a> <a title="Mark this example as bad" href="javascript:app.addRating(-1,'17')" class="rating-down btn btn-danger" data-id="rating_17"><i class="icon-button icon-thumbs-down"></i></a> </div> </div> <div style="display:flex;align-items: center;flex-wrap: wrap"> <div style="display: inline-block;margin-right: 10px"> <a class="btn btn-default" title="Direct link to this example" href="https://csharp.hotexamples.com/examples/-/XPathNavigator/DeleteSelf/php-xpathnavigator-deleteself-method-examples.html#0x3915ca6b3f51b73c15af962106a24fb9622a05e298c04b75e68c5a1513aa3915-437,,445,"><i class="icon-button icon-link"></i></a> <a rel="nofollow" class="btn btn-default" href="javascript:app.open('https://csharp.hotexamples.com/site/file?hash=0x3915ca6b3f51b73c15af962106a24fb9622a05e298c04b75e68c5a1513aa3915')">Show file</a> </div> <div class="example-project-info"> <nobr> <a target="_blank" rel="nofollow" href="https://csharp.hotexamples.com/site/redirect"></a> </nobr> </div> </div> </div> <figure class="highlight"> <div class="example" data-id="17"> <pre class="line-numbers language-csharp" data-end="445" data-start="438" data-highlight="445"> static void RemoveAttr(XPathNavigator node, string attr) { node = node.Clone(); if (!node.MoveToAttribute(attr, string.Empty)) { return; } node.DeleteSelf(); }</pre> </div> </figure> </div> <div class="example-item" id="0xf8f25b8c7d930acb9430ebc4e68bdd5a5a8f0e3b66dfe52147a616eaea6a1403-817,,873,"> <div class="bs-example"> <div> <div class="bs-example-title">Example #18</div> <div style="position: absolute;right: 15px;top: 10px;" id="rating_18" data-hash="0xf8f25b8c7d930acb9430ebc4e68bdd5a5a8f0e3b66dfe52147a616eaea6a1403" data-area="817,,873,"> <div class="rating-amount">0</div> <a title="Mark this example as good" href="javascript:app.addRating(1, '18')" class="rating-up btn btn-success" data-id="rating_18"><i class="icon-button icon-thumbs-up"></i></a> <a title="Mark this example as bad" href="javascript:app.addRating(-1,'18')" class="rating-down btn btn-danger" data-id="rating_18"><i class="icon-button icon-thumbs-down"></i></a> </div> </div> <div style="display:flex;align-items: center;flex-wrap: wrap"> <div style="display: inline-block;margin-right: 10px"> <a class="btn btn-default" title="Direct link to this example" href="https://csharp.hotexamples.com/examples/-/XPathNavigator/DeleteSelf/php-xpathnavigator-deleteself-method-examples.html#0xf8f25b8c7d930acb9430ebc4e68bdd5a5a8f0e3b66dfe52147a616eaea6a1403-817,,873,"><i class="icon-button icon-link"></i></a> <a rel="nofollow" class="btn btn-default" href="javascript:app.open('https://csharp.hotexamples.com/site/file?hash=0xf8f25b8c7d930acb9430ebc4e68bdd5a5a8f0e3b66dfe52147a616eaea6a1403&fullName=SandAssists-master%2FMain%2FSource%2FHelpers%2FReferenceFilterConfigurator.cs&project=paulushub%2FSandAssists')">Show file</a> </div> <div class="example-project-info"> <nobr> <span>File:</span> <a target="_blank" rel="nofollow" href="https://csharp.hotexamples.com/site/redirect?url=https%3A%2F%2Fgithub.com%2Fpaulushub%2FSandAssists%2Fblob%2Fmaster%2FSandAssists-master%2FMain%2FSource%2FHelpers%2FReferenceFilterConfigurator.cs">ReferenceFilterConfigurator.cs</a> </nobr> <nobr> <span>Project:</span> <a target="_blank" rel="nofollow" href="https://csharp.hotexamples.com/site/redirect?url=https%3A%2F%2Fgithub.com%2Fpaulushub%2FSandAssists">paulushub/SandAssists</a> </nobr> </div> </div> </div> <figure class="highlight"> <div class="example" data-id="18"> <pre class="line-numbers language-csharp" data-end="873" data-start="818" data-highlight="873"> private void OnAttributeFilterItem(string keyword, XPathNavigator navigator) { ReferenceRootFilter attributeFilters = _group.Content.AttributeFilters; // If there is customization of the attribute filters, we use it... if (attributeFilters != null && attributeFilters.Count != 0) { XmlWriter writer = navigator.InsertAfter(); //<attributeFilter expose="true"> // <namespace name="System.Diagnostics" expose="false"> // <type name="ConditionalAttribute" expose="true" /> // </namespace> // <namespace name="System.Xml.Serialization" expose="false" /> //</attributeFilter> writer.WriteStartElement("attributeFilter"); writer.WriteAttributeString("expose", "true"); int itemNamespaces = attributeFilters.Count; for (int i = 0; i < itemNamespaces; i++) { ReferenceNamespaceFilter namespaceFilter = attributeFilters[i]; if (namespaceFilter == null) { continue; } namespaceFilter.WriteXml(writer); } writer.WriteEndElement(); writer.Close(); } else //...otherwise, we put in the default atttribute filters... { // Write the defaults... if (String.IsNullOrEmpty(_defaultAttrFile) == false && File.Exists(_defaultAttrFile)) { XmlReaderSettings settings = new XmlReaderSettings(); settings.IgnoreWhitespace = true; settings.IgnoreComments = false; settings.CloseInput = true; using (XmlReader xmlReader = XmlReader.Create( _defaultAttrFile, settings)) { if (xmlReader.IsStartElement("attributeFilter")) { navigator.InsertAfter(xmlReader); } } } } navigator.DeleteSelf(); }</pre> </div> </figure> </div> <div class="example-item" id="0xcf872dd4cf0c54216b8d65192075ecc24f1b6d9c39f5c87b49893cb0400b0cc1-102,,111,"> <div class="bs-example"> <div> <div class="bs-example-title">Example #19</div> <div style="position: absolute;right: 15px;top: 10px;" id="rating_19" data-hash="0xcf872dd4cf0c54216b8d65192075ecc24f1b6d9c39f5c87b49893cb0400b0cc1" data-area="102,,111,"> <div class="rating-amount">0</div> <a title="Mark this example as good" href="javascript:app.addRating(1, '19')" class="rating-up btn btn-success" data-id="rating_19"><i class="icon-button icon-thumbs-up"></i></a> <a title="Mark this example as bad" href="javascript:app.addRating(-1,'19')" class="rating-down btn btn-danger" data-id="rating_19"><i class="icon-button icon-thumbs-down"></i></a> </div> </div> <div style="display:flex;align-items: center;flex-wrap: wrap"> <div style="display: inline-block;margin-right: 10px"> <a class="btn btn-default" title="Direct link to this example" href="https://csharp.hotexamples.com/examples/-/XPathNavigator/DeleteSelf/php-xpathnavigator-deleteself-method-examples.html#0xcf872dd4cf0c54216b8d65192075ecc24f1b6d9c39f5c87b49893cb0400b0cc1-102,,111,"><i class="icon-button icon-link"></i></a> <a rel="nofollow" class="btn btn-default" href="javascript:app.open('https://csharp.hotexamples.com/site/file?hash=0xcf872dd4cf0c54216b8d65192075ecc24f1b6d9c39f5c87b49893cb0400b0cc1')">Show file</a> </div> <div class="example-project-info"> <nobr> <a target="_blank" rel="nofollow" href="https://csharp.hotexamples.com/site/redirect"></a> </nobr> </div> </div> </div> <figure class="highlight"> <div class="example" data-id="19"> <pre class="line-numbers language-csharp" data-end="111" data-start="103" data-highlight="110"> internal static void RemoveChildNode(XPathNavigator parentNavigator, string nodeXPath, string childName) { var childNodeNavigator = parentNavigator.SelectSingleNode(nodeXPath); if (childNodeNavigator != null) { parentNavigator.MoveToChild(childName, string.Empty); parentNavigator.DeleteSelf(); } }</pre> </div> </figure> </div> <div class="example-item" id="0x428a4297f001b4475e9ce6e06e9370c797c97ad485c2d0fc1567c0c7d19e4747-163,,177,"> <div class="bs-example"> <div> <div class="bs-example-title">Example #20</div> <div style="position: absolute;right: 15px;top: 10px;" id="rating_20" data-hash="0x428a4297f001b4475e9ce6e06e9370c797c97ad485c2d0fc1567c0c7d19e4747" data-area="163,,177,"> <div class="rating-amount">0</div> <a title="Mark this example as good" href="javascript:app.addRating(1, '20')" class="rating-up btn btn-success" data-id="rating_20"><i class="icon-button icon-thumbs-up"></i></a> <a title="Mark this example as bad" href="javascript:app.addRating(-1,'20')" class="rating-down btn btn-danger" data-id="rating_20"><i class="icon-button icon-thumbs-down"></i></a> </div> </div> <div style="display:flex;align-items: center;flex-wrap: wrap"> <div style="display: inline-block;margin-right: 10px"> <a class="btn btn-default" title="Direct link to this example" href="https://csharp.hotexamples.com/examples/-/XPathNavigator/DeleteSelf/php-xpathnavigator-deleteself-method-examples.html#0x428a4297f001b4475e9ce6e06e9370c797c97ad485c2d0fc1567c0c7d19e4747-163,,177,"><i class="icon-button icon-link"></i></a> <a rel="nofollow" class="btn btn-default" href="javascript:app.open('https://csharp.hotexamples.com/site/file?hash=0x428a4297f001b4475e9ce6e06e9370c797c97ad485c2d0fc1567c0c7d19e4747&fullName=SandAssists-master%2FMain%2FSource%2FBuildAssembler%2FInheritDocumentationComponent.cs&project=paulushub%2FSandAssists')">Show file</a> </div> <div class="example-project-info"> <nobr> <span>File:</span> <a target="_blank" rel="nofollow" href="https://csharp.hotexamples.com/site/redirect?url=https%3A%2F%2Fgithub.com%2Fpaulushub%2FSandAssists%2Fblob%2Fmaster%2FSandAssists-master%2FMain%2FSource%2FBuildAssembler%2FInheritDocumentationComponent.cs">InheritDocumentationComponent.cs</a> </nobr> <nobr> <span>Project:</span> <a target="_blank" rel="nofollow" href="https://csharp.hotexamples.com/site/redirect?url=https%3A%2F%2Fgithub.com%2Fpaulushub%2FSandAssists">paulushub/SandAssists</a> </nobr> </div> </div> </div> <figure class="highlight"> <div class="example" data-id="20"> <pre class="line-numbers language-csharp" data-end="177" data-start="164" data-highlight="177"> /// <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 void DeleteNode(XPathNavigator inheritDocNodeNavigator, string key) { if (_messageWriter != null) { _messageWriter.Write(this.GetType(), MessageLevel.Info, String.Format( CultureInfo.InvariantCulture, "Comments are not found for topic:{0}", key)); } inheritDocNodeNavigator.DeleteSelf(); }</pre> </div> </figure> </div> <div class="example-item" id="0x11f1b444fb4e29dd1196cbdc63d85a424bc8891d7dc002be7bb70477a069997f-207,,261,"> <div class="bs-example"> <div> <div class="bs-example-title">Example #21</div> <div style="position: absolute;right: 15px;top: 10px;" id="rating_21" data-hash="0x11f1b444fb4e29dd1196cbdc63d85a424bc8891d7dc002be7bb70477a069997f" data-area="207,,261,"> <div class="rating-amount">0</div> <a title="Mark this example as good" href="javascript:app.addRating(1, '21')" class="rating-up btn btn-success" data-id="rating_21"><i class="icon-button icon-thumbs-up"></i></a> <a title="Mark this example as bad" href="javascript:app.addRating(-1,'21')" class="rating-down btn btn-danger" data-id="rating_21"><i class="icon-button icon-thumbs-down"></i></a> </div> </div> <div style="display:flex;align-items: center;flex-wrap: wrap"> <div style="display: inline-block;margin-right: 10px"> <a class="btn btn-default" title="Direct link to this example" href="https://csharp.hotexamples.com/examples/-/XPathNavigator/DeleteSelf/php-xpathnavigator-deleteself-method-examples.html#0x11f1b444fb4e29dd1196cbdc63d85a424bc8891d7dc002be7bb70477a069997f-207,,261,"><i class="icon-button icon-link"></i></a> <a rel="nofollow" class="btn btn-default" href="javascript:app.open('https://csharp.hotexamples.com/site/file?hash=0x11f1b444fb4e29dd1196cbdc63d85a424bc8891d7dc002be7bb70477a069997f&fullName=Ingres-master%2Fsrc%2Fcommon%2Fdotnet2_win%2Fvsinstaller.cs&project=GunterMueller%2FIngres')">Show file</a> </div> <div class="example-project-info"> <nobr> <span>File:</span> <a target="_blank" rel="nofollow" href="https://csharp.hotexamples.com/site/redirect?url=https%3A%2F%2Fgithub.com%2FGunterMueller%2FIngres%2Fblob%2Fmaster%2FIngres-master%2Fsrc%2Fcommon%2Fdotnet2_win%2Fvsinstaller.cs">vsinstaller.cs</a> </nobr> <nobr> <span>Project:</span> <a target="_blank" rel="nofollow" href="https://csharp.hotexamples.com/site/redirect?url=https%3A%2F%2Fgithub.com%2FGunterMueller%2FIngres">GunterMueller/Ingres</a> </nobr> </div> </div> </div> <figure class="highlight"> <div class="example" data-id="21"> <pre class="line-numbers language-csharp" data-end="261" data-start="208" data-highlight="243"> private void ChangeMachineConfig(string machineConfig) { MachineConfigXmlDocument doc = new MachineConfigXmlDocument(machineConfig); if (doc.Exists == false) { return; } //System.Windows.Forms.MessageBox.Show( // "Changing " + doc.machineConfigFilename, "ChangeMachineConfig"); doc.Load(); // load machine.config as XML document // locate the "DbProviderFactories" element XPathNavigator navigator = doc.CreateNavigator(dbProviderFactoriesPath); if (navigator == null) { //System.Windows.Forms.MessageBox.Show( // "Could not locate \"DbProviderFactories\" element!!", // "ChangeMachineConfig"); return; // something is very wrong if we can't find the DB Providers } // locate the old <add name="Ingres Data Provider" ... /> XPathNavigator providerNavigator = FindChildElement(navigator, ingresProviderSearchKeys); if (providerNavigator != null) { //System.Windows.Forms.MessageBox.Show( // "DeletingSelf the old <add name=\"Ingres Data Provider\"...", // "ChangeMachineConfig"); ingresProviderElementOld = providerNavigator.OuterXml; providerNavigator.DeleteSelf(); // if found, delete the old entry } else { //System.Windows.Forms.MessageBox.Show( // "Could not locate the old <add name=\"Ingres Data Provider\"...", // "ChangeMachineConfig"); } // create the <add name="Ingres Data Provider" invariant="Ingres.Client" ... if (ingresProviderElementNew != null) { //System.Windows.Forms.MessageBox.Show( // "Creating the new <add name=\"Ingres Data Provider\"...", // "ChangeMachineConfig"); navigator.AppendChild(ingresProviderElementNew); } doc.Save(); // save the machine.config }</pre> </div> </figure> </div> <div class="example-item" id="0xd810bdd346092ba76842e72c72e8964e801c47ca203d233d77f2dfdc6adda624-654,,664,"> <div class="bs-example"> <div> <div class="bs-example-title">Example #22</div> <div style="position: absolute;right: 15px;top: 10px;" id="rating_22" data-hash="0xd810bdd346092ba76842e72c72e8964e801c47ca203d233d77f2dfdc6adda624" data-area="654,,664,"> <div class="rating-amount">0</div> <a title="Mark this example as good" href="javascript:app.addRating(1, '22')" class="rating-up btn btn-success" data-id="rating_22"><i class="icon-button icon-thumbs-up"></i></a> <a title="Mark this example as bad" href="javascript:app.addRating(-1,'22')" class="rating-down btn btn-danger" data-id="rating_22"><i class="icon-button icon-thumbs-down"></i></a> </div> </div> <div style="display:flex;align-items: center;flex-wrap: wrap"> <div style="display: inline-block;margin-right: 10px"> <a class="btn btn-default" title="Direct link to this example" href="https://csharp.hotexamples.com/examples/-/XPathNavigator/DeleteSelf/php-xpathnavigator-deleteself-method-examples.html#0xd810bdd346092ba76842e72c72e8964e801c47ca203d233d77f2dfdc6adda624-654,,664,"><i class="icon-button icon-link"></i></a> <a rel="nofollow" class="btn btn-default" href="javascript:app.open('https://csharp.hotexamples.com/site/file?hash=0xd810bdd346092ba76842e72c72e8964e801c47ca203d233d77f2dfdc6adda624&fullName=devtreks-master%2Fsrc%2FDevTreks.Data%2FXPathIO.cs&project=kpboyle1%2Fdevtreks')">Show file</a> </div> <div class="example-project-info"> <nobr> <span>File:</span> <a target="_blank" rel="nofollow" href="https://csharp.hotexamples.com/site/redirect?url=https%3A%2F%2Fgithub.com%2Fkpboyle1%2Fdevtreks%2Fblob%2Fmaster%2Fdevtreks-master%2Fsrc%2FDevTreks.Data%2FXPathIO.cs">XPathIO.cs</a> </nobr> <nobr> <span>Project:</span> <a target="_blank" rel="nofollow" href="https://csharp.hotexamples.com/site/redirect?url=https%3A%2F%2Fgithub.com%2Fkpboyle1%2Fdevtreks">kpboyle1/devtreks</a> </nobr> </div> </div> </div> <figure class="highlight"> <div class="example" data-id="22"> <pre class="line-numbers language-csharp" data-end="664" data-start="655" data-highlight="661"> public static void RemoveAllAttributes(XPathNavigator toNav) { if (toNav.HasAttributes) { while (toNav.MoveToFirstAttribute()) { toNav.DeleteSelf(); } //will move to parent when last att is deleted } }</pre> </div> </figure> </div> <div class="example-item" id="0xd810bdd346092ba76842e72c72e8964e801c47ca203d233d77f2dfdc6adda624-964,,975,"> <div class="bs-example"> <div> <div class="bs-example-title">Example #23</div> <div style="position: absolute;right: 15px;top: 10px;" id="rating_23" data-hash="0xd810bdd346092ba76842e72c72e8964e801c47ca203d233d77f2dfdc6adda624" data-area="964,,975,"> <div class="rating-amount">0</div> <a title="Mark this example as good" href="javascript:app.addRating(1, '23')" class="rating-up btn btn-success" data-id="rating_23"><i class="icon-button icon-thumbs-up"></i></a> <a title="Mark this example as bad" href="javascript:app.addRating(-1,'23')" class="rating-down btn btn-danger" data-id="rating_23"><i class="icon-button icon-thumbs-down"></i></a> </div> </div> <div style="display:flex;align-items: center;flex-wrap: wrap"> <div style="display: inline-block;margin-right: 10px"> <a class="btn btn-default" title="Direct link to this example" href="https://csharp.hotexamples.com/examples/-/XPathNavigator/DeleteSelf/php-xpathnavigator-deleteself-method-examples.html#0xd810bdd346092ba76842e72c72e8964e801c47ca203d233d77f2dfdc6adda624-964,,975,"><i class="icon-button icon-link"></i></a> <a rel="nofollow" class="btn btn-default" href="javascript:app.open('https://csharp.hotexamples.com/site/file?hash=0xd810bdd346092ba76842e72c72e8964e801c47ca203d233d77f2dfdc6adda624&fullName=devtreks-master%2Fsrc%2FDevTreks.Data%2FXPathIO.cs&project=kpboyle1%2Fdevtreks')">Show file</a> </div> <div class="example-project-info"> <nobr> <span>File:</span> <a target="_blank" rel="nofollow" href="https://csharp.hotexamples.com/site/redirect?url=https%3A%2F%2Fgithub.com%2Fkpboyle1%2Fdevtreks%2Fblob%2Fmaster%2Fdevtreks-master%2Fsrc%2FDevTreks.Data%2FXPathIO.cs">XPathIO.cs</a> </nobr> <nobr> <span>Project:</span> <a target="_blank" rel="nofollow" href="https://csharp.hotexamples.com/site/redirect?url=https%3A%2F%2Fgithub.com%2Fkpboyle1%2Fdevtreks">kpboyle1/devtreks</a> </nobr> </div> </div> </div> <figure class="highlight"> <div class="example" data-id="23"> <pre class="line-numbers language-csharp" data-end="975" data-start="965" data-highlight="973"> public static void DeleteAttribute(string attName, ref XPathNavigator selectedElementNav) { if (selectedElementNav.HasAttributes) { bool bHasMoved = selectedElementNav.MoveToAttribute(attName, string.Empty); if (bHasMoved == true) { //if successful, repositions on parent selectedElementNav.DeleteSelf(); } } }</pre> </div> </figure> </div> <div class="example-item" id="0xd810bdd346092ba76842e72c72e8964e801c47ca203d233d77f2dfdc6adda624-774,,785,"> <div class="bs-example"> <div> <div class="bs-example-title">Example #24</div> <div style="position: absolute;right: 15px;top: 10px;" id="rating_24" data-hash="0xd810bdd346092ba76842e72c72e8964e801c47ca203d233d77f2dfdc6adda624" data-area="774,,785,"> <div class="rating-amount">0</div> <a title="Mark this example as good" href="javascript:app.addRating(1, '24')" class="rating-up btn btn-success" data-id="rating_24"><i class="icon-button icon-thumbs-up"></i></a> <a title="Mark this example as bad" href="javascript:app.addRating(-1,'24')" class="rating-down btn btn-danger" data-id="rating_24"><i class="icon-button icon-thumbs-down"></i></a> </div> </div> <div style="display:flex;align-items: center;flex-wrap: wrap"> <div style="display: inline-block;margin-right: 10px"> <a class="btn btn-default" title="Direct link to this example" href="https://csharp.hotexamples.com/examples/-/XPathNavigator/DeleteSelf/php-xpathnavigator-deleteself-method-examples.html#0xd810bdd346092ba76842e72c72e8964e801c47ca203d233d77f2dfdc6adda624-774,,785,"><i class="icon-button icon-link"></i></a> <a rel="nofollow" class="btn btn-default" href="javascript:app.open('https://csharp.hotexamples.com/site/file?hash=0xd810bdd346092ba76842e72c72e8964e801c47ca203d233d77f2dfdc6adda624&fullName=devtreks-master%2Fsrc%2FDevTreks.Data%2FXPathIO.cs&project=kpboyle1%2Fdevtreks')">Show file</a> </div> <div class="example-project-info"> <nobr> <span>File:</span> <a target="_blank" rel="nofollow" href="https://csharp.hotexamples.com/site/redirect?url=https%3A%2F%2Fgithub.com%2Fkpboyle1%2Fdevtreks%2Fblob%2Fmaster%2Fdevtreks-master%2Fsrc%2FDevTreks.Data%2FXPathIO.cs">XPathIO.cs</a> </nobr> <nobr> <span>Project:</span> <a target="_blank" rel="nofollow" href="https://csharp.hotexamples.com/site/redirect?url=https%3A%2F%2Fgithub.com%2Fkpboyle1%2Fdevtreks">kpboyle1/devtreks</a> </nobr> </div> </div> </div> <figure class="highlight"> <div class="example" data-id="24"> <pre class="line-numbers language-csharp" data-end="785" data-start="775" data-highlight="781"> private static void DeleteChildrenNodes(XPathNavigator oElementNav, ref bool hasDeletions) { if (oElementNav.HasChildren) { oElementNav.MoveToFirstChild(); oElementNav.DeleteSelf(); hasDeletions = true; //recurse to delete remaining children DeleteChildrenNodes(oElementNav, ref hasDeletions); } }</pre> </div> </figure> </div> <div class="example-item" id="0xa60df3a0987c708cf31f551785b8cde0ed33d1112a6b91ec856f77eadca53f03-102,,113,"> <div class="bs-example"> <div> <div class="bs-example-title">Example #25</div> <div style="position: absolute;right: 15px;top: 10px;" id="rating_25" data-hash="0xa60df3a0987c708cf31f551785b8cde0ed33d1112a6b91ec856f77eadca53f03" data-area="102,,113,"> <div class="rating-amount">0</div> <a title="Mark this example as good" href="javascript:app.addRating(1, '25')" class="rating-up btn btn-success" data-id="rating_25"><i class="icon-button icon-thumbs-up"></i></a> <a title="Mark this example as bad" href="javascript:app.addRating(-1,'25')" class="rating-down btn btn-danger" data-id="rating_25"><i class="icon-button icon-thumbs-down"></i></a> </div> </div> <div style="display:flex;align-items: center;flex-wrap: wrap"> <div style="display: inline-block;margin-right: 10px"> <a class="btn btn-default" title="Direct link to this example" href="https://csharp.hotexamples.com/examples/-/XPathNavigator/DeleteSelf/php-xpathnavigator-deleteself-method-examples.html#0xa60df3a0987c708cf31f551785b8cde0ed33d1112a6b91ec856f77eadca53f03-102,,113,"><i class="icon-button icon-link"></i></a> <a rel="nofollow" class="btn btn-default" href="javascript:app.open('https://csharp.hotexamples.com/site/file?hash=0xa60df3a0987c708cf31f551785b8cde0ed33d1112a6b91ec856f77eadca53f03')">Show file</a> </div> <div class="example-project-info"> <nobr> <a target="_blank" rel="nofollow" href="https://csharp.hotexamples.com/site/redirect"></a> </nobr> </div> </div> </div> <figure class="highlight"> <div class="example" data-id="25"> <pre class="line-numbers language-csharp" data-end="113" data-start="103" data-highlight="111"> private void xoadata() { XmlDocument doc = new XmlDocument(); doc.Load(@"D:\source\Phuc\Phuc\bin\Debug\Sinhvien.xml"); XPathNavigator nav = doc.CreateNavigator(); XPathNavigator sinhvien = nav.SelectSingleNode("Sinhvien/sinhvien[@xID='" + Idtxt.Text + "']"); sinhvien.DeleteSelf(); doc.Save(@"D:\source\Phuc\Phuc\bin\Debug\Sinhvien.xml"); loaddata(); }</pre> </div> </figure> </div> <div class="example-item" id="0xb3c3797c88fedc6620fbb69b2073e3b02453df67e444debfef98317a06569c25-101,,112,"> <div class="bs-example"> <div> <div class="bs-example-title">Example #26</div> <div style="position: absolute;right: 15px;top: 10px;" id="rating_26" data-hash="0xb3c3797c88fedc6620fbb69b2073e3b02453df67e444debfef98317a06569c25" data-area="101,,112,"> <div class="rating-amount">0</div> <a title="Mark this example as good" href="javascript:app.addRating(1, '26')" class="rating-up btn btn-success" data-id="rating_26"><i class="icon-button icon-thumbs-up"></i></a> <a title="Mark this example as bad" href="javascript:app.addRating(-1,'26')" class="rating-down btn btn-danger" data-id="rating_26"><i class="icon-button icon-thumbs-down"></i></a> </div> </div> <div style="display:flex;align-items: center;flex-wrap: wrap"> <div style="display: inline-block;margin-right: 10px"> <a class="btn btn-default" title="Direct link to this example" href="https://csharp.hotexamples.com/examples/-/XPathNavigator/DeleteSelf/php-xpathnavigator-deleteself-method-examples.html#0xb3c3797c88fedc6620fbb69b2073e3b02453df67e444debfef98317a06569c25-101,,112,"><i class="icon-button icon-link"></i></a> <a rel="nofollow" class="btn btn-default" href="javascript:app.open('https://csharp.hotexamples.com/site/file?hash=0xb3c3797c88fedc6620fbb69b2073e3b02453df67e444debfef98317a06569c25&fullName=TestWinForm-master%2FForm1.cs&project=minhtam259%2FTestWinForm')">Show file</a> </div> <div class="example-project-info"> <nobr> <span>File:</span> <a target="_blank" rel="nofollow" href="https://csharp.hotexamples.com/site/redirect?url=https%3A%2F%2Fgithub.com%2Fminhtam259%2FTestWinForm%2Fblob%2Fmaster%2FTestWinForm-master%2FForm1.cs">Form1.cs</a> </nobr> <nobr> <span>Project:</span> <a target="_blank" rel="nofollow" href="https://csharp.hotexamples.com/site/redirect?url=https%3A%2F%2Fgithub.com%2Fminhtam259%2FTestWinForm">minhtam259/TestWinForm</a> </nobr> </div> </div> </div> <figure class="highlight"> <div class="example" data-id="26"> <pre class="line-numbers language-csharp" data-end="112" data-start="102" data-highlight="110"> private void xoadata() { XmlDocument doc = new XmlDocument(); doc.Load(@"E:\WFC#\Tam\Tam\bin\Debug\Sinhvien.xml"); XPathNavigator nav = doc.CreateNavigator(); XPathNavigator sinhvien = nav.SelectSingleNode("Sinhvien/sinhvien[@xID='" + textBox5.Text + "']"); sinhvien.DeleteSelf(); doc.Save(@"E:\WFC#\Tam\Tam\bin\Debug\Sinhvien.xml"); loaddata(); }</pre> </div> </figure> </div> <div class="example-item" id="0xae3909ba6bd352ff211d4a14a7ebe6569790fbe96f9a5769141c55c1e65ac869-806,,818,"> <div class="bs-example"> <div> <div class="bs-example-title">Example #27</div> <div style="position: absolute;right: 15px;top: 10px;" id="rating_27" data-hash="0xae3909ba6bd352ff211d4a14a7ebe6569790fbe96f9a5769141c55c1e65ac869" data-area="806,,818,"> <div class="rating-amount">0</div> <a title="Mark this example as good" href="javascript:app.addRating(1, '27')" class="rating-up btn btn-success" data-id="rating_27"><i class="icon-button icon-thumbs-up"></i></a> <a title="Mark this example as bad" href="javascript:app.addRating(-1,'27')" class="rating-down btn btn-danger" data-id="rating_27"><i class="icon-button icon-thumbs-down"></i></a> </div> </div> <div style="display:flex;align-items: center;flex-wrap: wrap"> <div style="display: inline-block;margin-right: 10px"> <a class="btn btn-default" title="Direct link to this example" href="https://csharp.hotexamples.com/examples/-/XPathNavigator/DeleteSelf/php-xpathnavigator-deleteself-method-examples.html#0xae3909ba6bd352ff211d4a14a7ebe6569790fbe96f9a5769141c55c1e65ac869-806,,818,"><i class="icon-button icon-link"></i></a> <a rel="nofollow" class="btn btn-default" href="javascript:app.open('https://csharp.hotexamples.com/site/file?hash=0xae3909ba6bd352ff211d4a14a7ebe6569790fbe96f9a5769141c55c1e65ac869')">Show file</a> </div> <div class="example-project-info"> <nobr> <a target="_blank" rel="nofollow" href="https://csharp.hotexamples.com/site/redirect"></a> </nobr> </div> </div> </div> <figure class="highlight"> <div class="example" data-id="27"> <pre class="line-numbers language-csharp" data-end="818" data-start="807" data-highlight="817"> public void DeleteSelfAttribute() { // bug #376210. XmlDocument document = new XmlDocument(); document.LoadXml("<test><node date='2000-12-23'>z</node></test>"); XPathNavigator navigator = document.CreateNavigator(); XPathNavigator nodeElement = navigator.SelectSingleNode("//node"); nodeElement.MoveToAttribute("date", String.Empty); nodeElement.DeleteSelf(); Assert.AreEqual("<test><node>z</node></test>", document.OuterXml); }</pre> </div> </figure> </div> <div class="example-item" id="0x5e3b0b968f4af33ff139c59b698f62dd94119336f242875aaf109a8c27bcdf3f-57,,73,"> <div class="bs-example"> <div> <div class="bs-example-title">Example #28</div> <div style="position: absolute;right: 15px;top: 10px;" id="rating_28" data-hash="0x5e3b0b968f4af33ff139c59b698f62dd94119336f242875aaf109a8c27bcdf3f" data-area="57,,73,"> <div class="rating-amount">0</div> <a title="Mark this example as good" href="javascript:app.addRating(1, '28')" class="rating-up btn btn-success" data-id="rating_28"><i class="icon-button icon-thumbs-up"></i></a> <a title="Mark this example as bad" href="javascript:app.addRating(-1,'28')" class="rating-down btn btn-danger" data-id="rating_28"><i class="icon-button icon-thumbs-down"></i></a> </div> </div> <div style="display:flex;align-items: center;flex-wrap: wrap"> <div style="display: inline-block;margin-right: 10px"> <a class="btn btn-default" title="Direct link to this example" href="https://csharp.hotexamples.com/examples/-/XPathNavigator/DeleteSelf/php-xpathnavigator-deleteself-method-examples.html#0x5e3b0b968f4af33ff139c59b698f62dd94119336f242875aaf109a8c27bcdf3f-57,,73,"><i class="icon-button icon-link"></i></a> <a rel="nofollow" class="btn btn-default" href="javascript:app.open('https://csharp.hotexamples.com/site/file?hash=0x5e3b0b968f4af33ff139c59b698f62dd94119336f242875aaf109a8c27bcdf3f')">Show file</a> </div> <div class="example-project-info"> <nobr> <a target="_blank" rel="nofollow" href="https://csharp.hotexamples.com/site/redirect"></a> </nobr> </div> </div> </div> <figure class="highlight"> <div class="example" data-id="28"> <pre class="line-numbers language-csharp" data-end="73" data-start="58" data-highlight="72"> /// <summary> /// Delete student for Xml document /// </summary> /// <param name="id">id of student</param> public static void XDelete(string id) { string path = @"C:\Users\Anh Sky\source\repos\WindowsFormsApp1\WindowsFormsApp1\Data.xml"; XmlDocument editDoc = new XmlDocument(); editDoc.Load(path); XPathNavigator editNav = editDoc.CreateNavigator(); XPathNavigator student = editNav.SelectSingleNode($"students/student[id='{id}']"); student.DeleteSelf(); editDoc.Save(path); }</pre> </div> </figure> </div> <div class="example-item" id="0xf8f25b8c7d930acb9430ebc4e68bdd5a5a8f0e3b66dfe52147a616eaea6a1403-346,,396,"> <div class="bs-example"> <div> <div class="bs-example-title">Example #29</div> <div style="position: absolute;right: 15px;top: 10px;" id="rating_29" data-hash="0xf8f25b8c7d930acb9430ebc4e68bdd5a5a8f0e3b66dfe52147a616eaea6a1403" data-area="346,,396,"> <div class="rating-amount">0</div> <a title="Mark this example as good" href="javascript:app.addRating(1, '29')" class="rating-up btn btn-success" data-id="rating_29"><i class="icon-button icon-thumbs-up"></i></a> <a title="Mark this example as bad" href="javascript:app.addRating(-1,'29')" class="rating-down btn btn-danger" data-id="rating_29"><i class="icon-button icon-thumbs-down"></i></a> </div> </div> <div style="display:flex;align-items: center;flex-wrap: wrap"> <div style="display: inline-block;margin-right: 10px"> <a class="btn btn-default" title="Direct link to this example" href="https://csharp.hotexamples.com/examples/-/XPathNavigator/DeleteSelf/php-xpathnavigator-deleteself-method-examples.html#0xf8f25b8c7d930acb9430ebc4e68bdd5a5a8f0e3b66dfe52147a616eaea6a1403-346,,396,"><i class="icon-button icon-link"></i></a> <a rel="nofollow" class="btn btn-default" href="javascript:app.open('https://csharp.hotexamples.com/site/file?hash=0xf8f25b8c7d930acb9430ebc4e68bdd5a5a8f0e3b66dfe52147a616eaea6a1403&fullName=SandAssists-master%2FMain%2FSource%2FHelpers%2FReferenceFilterConfigurator.cs&project=paulushub%2FSandAssists')">Show file</a> </div> <div class="example-project-info"> <nobr> <span>File:</span> <a target="_blank" rel="nofollow" href="https://csharp.hotexamples.com/site/redirect?url=https%3A%2F%2Fgithub.com%2Fpaulushub%2FSandAssists%2Fblob%2Fmaster%2FSandAssists-master%2FMain%2FSource%2FHelpers%2FReferenceFilterConfigurator.cs">ReferenceFilterConfigurator.cs</a> </nobr> <nobr> <span>Project:</span> <a target="_blank" rel="nofollow" href="https://csharp.hotexamples.com/site/redirect?url=https%3A%2F%2Fgithub.com%2Fpaulushub%2FSandAssists">paulushub/SandAssists</a> </nobr> </div> </div> </div> <figure class="highlight"> <div class="example" data-id="29"> <pre class="line-numbers language-csharp" data-end="396" data-start="347" data-highlight="396"> private void OnAddinsItem(string keyword, XPathNavigator navigator) { //... //<addins> // <addin type="Microsoft.Ddue.Tools.XamlAttachedMembersAddIn" // assembly="MRefBuilder.exe" /> //</addins> XmlWriter writer = navigator.InsertAfter(); writer.WriteStartElement("addins"); // start: addins if (!String.IsNullOrEmpty(_assistComponents) && File.Exists(_assistComponents)) { // For the extension method addin... writer.WriteStartElement("addin"); // start: addin writer.WriteAttributeString("type", "Microsoft.Ddue.Tools.ExtensionMethodAddIn"); writer.WriteAttributeString("assembly", _assistComponents); writer.WriteEndElement(); // end: addin // For the XAML attached members addin... writer.WriteStartElement("addin"); // start: addin writer.WriteAttributeString("type", "Microsoft.Ddue.Tools.XamlAttachedMembersAddIn"); writer.WriteAttributeString("assembly", _assistComponents); writer.WriteEndElement(); // end: addin } else { string sandcastleDir = _context.SandcastleDirectory; // For the extension method addin... writer.WriteStartElement("addin"); // start: addin writer.WriteAttributeString("type", "Microsoft.Ddue.Tools.ExtensionMethodAddIn"); writer.WriteAttributeString("assembly", Path.Combine(sandcastleDir, @"ProductionTools\MRefBuilder.exe")); writer.WriteEndElement(); // end: addin // For the XAML attached members addin... writer.WriteStartElement("addin"); // start: addin writer.WriteAttributeString("type", "Microsoft.Ddue.Tools.XamlAttachedMembersAddIn"); writer.WriteAttributeString("assembly", Path.Combine(sandcastleDir, @"ProductionTools\MRefBuilder.exe")); writer.WriteEndElement(); // end: addin } writer.WriteEndElement(); // end: addins writer.Close(); navigator.DeleteSelf(); }</pre> </div> </figure> </div> <div class="example-item" id="0x98057124d8594cf0630c843c116903353c1aefeb322ea71088c35d2e892ac574-401,,456,"> <div class="bs-example"> <div> <div class="bs-example-title">Example #30</div> <div style="position: absolute;right: 15px;top: 10px;" id="rating_30" data-hash="0x98057124d8594cf0630c843c116903353c1aefeb322ea71088c35d2e892ac574" data-area="401,,456,"> <div class="rating-amount">0</div> <a title="Mark this example as good" href="javascript:app.addRating(1, '30')" class="rating-up btn btn-success" data-id="rating_30"><i class="icon-button icon-thumbs-up"></i></a> <a title="Mark this example as bad" href="javascript:app.addRating(-1,'30')" class="rating-down btn btn-danger" data-id="rating_30"><i class="icon-button icon-thumbs-down"></i></a> </div> </div> <div style="display:flex;align-items: center;flex-wrap: wrap"> <div style="display: inline-block;margin-right: 10px"> <a class="btn btn-default" title="Direct link to this example" href="https://csharp.hotexamples.com/examples/-/XPathNavigator/DeleteSelf/php-xpathnavigator-deleteself-method-examples.html#0x98057124d8594cf0630c843c116903353c1aefeb322ea71088c35d2e892ac574-401,,456,"><i class="icon-button icon-link"></i></a> <a rel="nofollow" class="btn btn-default" href="javascript:app.open('https://csharp.hotexamples.com/site/file?hash=0x98057124d8594cf0630c843c116903353c1aefeb322ea71088c35d2e892ac574')">Show file</a> </div> <div class="example-project-info"> <nobr> <a target="_blank" rel="nofollow" href="https://csharp.hotexamples.com/site/redirect"></a> </nobr> </div> </div> </div> <figure class="highlight"> <div class="example" data-id="30"> <pre class="line-numbers language-csharp" data-end="456" data-start="402" data-highlight="456"> /// <summary> /// This specifies the main conceptual XSL transform file and related information. /// </summary> /// <param name="sender"></param> /// <param name="args"></param> protected void OnTransformsItem(string keyword, XPathNavigator navigator) { string transform = _style.GetTransform(BuildEngineType.Reference); if (String.IsNullOrEmpty(transform)) { throw new BuildException("A document transformer is required."); } //<transform file="%DXROOT%\Presentation\Vs2005\transforms\main_conceptual.xsl"> //<argument key="metadata" value="true" /> //<argument key="languages"> // <language label="VisualBasic" name="VisualBasic" style="vb" /> // <language label="CSharp" name="CSharp" style="cs" /> // <language label="ManagedCPlusPlus" name="ManagedCPlusPlus" style="cpp" /> // <language label="JSharp" name="JSharp" style="cs" /> // <language label="JScript" name="JScript" style="cs" /> //</argument> //<argument key="RTMReleaseDate" value="June 2007" /> //</transform> XmlWriter xmlWriter = navigator.InsertAfter(); // For now, lets simply write the default... xmlWriter.WriteStartElement("transform"); // start - transform xmlWriter.WriteAttributeString("file", transform); xmlWriter.WriteStartElement("argument"); // start - argument/metadata xmlWriter.WriteAttributeString("key", "metadata"); xmlWriter.WriteAttributeString("value", "true"); xmlWriter.WriteEndElement(); // end - argument/metadata xmlWriter.WriteStartElement("argument"); // start - argument/languages xmlWriter.WriteAttributeString("key", "languages"); WriteSyntaxTypes(xmlWriter, _group.SyntaxUsage); xmlWriter.WriteEndElement(); // end - argument/languages if (_settings.ShowUpdatedDate) { xmlWriter.WriteStartElement("argument"); // start - argument/RTMReleaseDate xmlWriter.WriteAttributeString("key", "RTMReleaseDate"); xmlWriter.WriteAttributeString("value", DateTime.Now.ToString()); xmlWriter.WriteEndElement(); // end - argument/RTMReleaseDate } xmlWriter.WriteEndElement(); // end - transform xmlWriter.Close(); navigator.DeleteSelf(); }</pre> </div> </figure> </div> <div id="all-examples"></div> </div> </div> </div> <div class="page-side-banner hidden-xs hidden-sm hidden-md" style="width:300px"> <div id="ezoic-pub-ad-placeholder-131"> <div class="fx" style="width:300px"> <script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script> <!-- right-sidebar-fx --> <ins class="adsbygoogle" style="display:block" data-ad-client="ca-pub-3697522372581514" data-ad-slot="8968655429" data-ad-format="auto" data-full-width-responsive="true"></ins> <script> (adsbygoogle = window.adsbygoogle || []).push({}); </script> </div> </div> </div> </div> </div> <footer class="footer"> <div class="container"> <div class="row"> <div class="col-md-12" style="text-align: center"> <a href="https://csharp.hotexamples.com/site/trends?type=csharp%7Cc"> Top Classes </a> | <a href="https://csharpdoc.hotexamples.com/doc/map">Documentation</a> | <a href="/site/privacy">Privacy Policy</a> | <a href="https://cpp.hotexamples.com/direct-sales.html">Advertise with us</a> </div> </div> <div class="row"> <div class="col-md-12" style="text-align: center"> <a href="https://hotexamples.com/">PHP</a> | <a href="https://csharp.hotexamples.com/">C# (CSharp)</a> | <a href="https://java.hotexamples.com/">Java</a> | <a href="https://golang.hotexamples.com/">Golang</a> | <a href="https://cpp.hotexamples.com/">C++ (Cpp)</a> | <a href="https://python.hotexamples.com/">Python</a> | <a href="https://javascript.hotexamples.com/">JavaScript</a> | <a href="https://typescript.hotexamples.com/">TypeScript</a> </div> </div> <div class="row"> <div class="col-md-12" style="text-align: center"> <a href="https://csharp.hotexamples.com/examples/-/XPathNavigator/DeleteSelf/php-xpathnavigator-deleteself-method-examples.html">EN</a> | <a href="https://csharp.hotexamples.com/ru/examples/-/XPathNavigator/DeleteSelf/php-xpathnavigator-deleteself-method-examples.html">RU</a> | <a href="https://csharp.hotexamples.com/de/examples/-/XPathNavigator/DeleteSelf/php-xpathnavigator-deleteself-method-examples.html">DE</a> | <a href="https://csharp.hotexamples.com/fr/examples/-/XPathNavigator/DeleteSelf/php-xpathnavigator-deleteself-method-examples.html">FR</a> | <a href="https://csharp.hotexamples.com/es/examples/-/XPathNavigator/DeleteSelf/php-xpathnavigator-deleteself-method-examples.html">ES</a> | <a href="https://csharp.hotexamples.com/pt/examples/-/XPathNavigator/DeleteSelf/php-xpathnavigator-deleteself-method-examples.html">PT</a> | <a href="https://csharp.hotexamples.com/it/examples/-/XPathNavigator/DeleteSelf/php-xpathnavigator-deleteself-method-examples.html">IT</a> | <a href="https://csharp.hotexamples.com/jp/examples/-/XPathNavigator/DeleteSelf/php-xpathnavigator-deleteself-method-examples.html">JP</a> | <a href="https://csharp.hotexamples.com/zh/examples/-/XPathNavigator/DeleteSelf/php-xpathnavigator-deleteself-method-examples.html">ZH</a> | <a href="https://csharp.hotexamples.com/ko/examples/-/XPathNavigator/DeleteSelf/php-xpathnavigator-deleteself-method-examples.html">KO</a> </div> </div> <div class="row"> <div class="col-md-10 col-md-offset-1"> </div> <div class="col-md-1"> <!--LiveInternet counter--> <script type="text/javascript"><!-- document.write("<a href='//www.liveinternet.ru/click' " + "target=_blank><img src='//counter.yadro.ru/hit?t44.6;r" + escape(document.referrer) + ((typeof (screen) == "undefined") ? "" : ";s" + screen.width + "*" + screen.height + "*" + (screen.colorDepth ? screen.colorDepth : screen.pixelDepth)) + ";u" + escape(document.URL) + ";" + Math.random() + "' alt='' title='LiveInternet' " + "border='0' width='31' height='31'><\/a>"); //--></script><!--/LiveInternet--> </div> </div> </div> </footer> <script src="//ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script> <script src="/assets/30dd86a6f06b64184847037c52c63e07aa3c9a26.js"></script> <script>jQuery(function ($) { jQuery('#search-form').yiiActiveForm([{"id":"searchform-lang","name":"lang","container":".field-searchform-lang","input":"#searchform-lang","enableAjaxValidation":true},{"id":"searchform-search","name":"search","container":".field-searchform-search","input":"#searchform-search","enableAjaxValidation":true,"validate":function (attribute, value, messages, deferred, $form) {yii.validation.required(value, messages, {"message":"Search cannot be blank."});}}], []); });</script></body> </html>