DevTreks.Data/EditHelpers/XmlIO.cs
/// <summary>
/// True if navigator already has the id in the xPathQry
/// </summary>
True if navigator already has the id in the xPathQry
True if navigator already has the id in the xPathQry
public static bool HasSameId(string xPathQry, string prefix, string urn,
            XPathNavigator navigator)
        {
            bool bHasSameId = false;
            XPathNodeIterator oIterator = null;
            if (xPathQry.IndexOf(prefix) > 0)
            {
                XmlNamespaceManager oNSManager = new XmlNamespaceManager(navigator.NameTable);
                oNSManager.AddNamespace(prefix, urn);
                oIterator = navigator.Select(xPathQry, oNSManager);
            }
            else
            {
                XPathExpression oXPathExp;
                oXPathExp = navigator.Compile(xPathQry);
                oIterator = navigator.Select(oXPathExp);
            }
            if (oIterator != null)
            {
                if (oIterator.Count != 0)
                {
                    bHasSameId = true;
                }
            }
            return bHasSameId;
        }
public static bool HasSameId ( string xPathQry , string prefix , string urn , XPathNavigator navigator ) { bool bHasSameId = false ; XPathNodeIterator oIterator = null ; if ( xPathQry . IndexOf ( prefix ) > 0 ) { XmlNamespaceManager oNSManager = new XmlNamespaceManager ( navigator . NameTable ) ; oNSManager . AddNamespace ( prefix , urn ) ; oIterator = navigator . Select ( xPathQry , oNSManager ) ; } else { XPathExpression oXPathExp ; oXPathExp = navigator . Compile ( xPathQry ) ; oIterator = navigator . Select ( oXPathExp ) ; } if ( oIterator != null ) { if ( oIterator . Count != 0 ) { bHasSameId = true ; } } return bHasSameId ; }
True if navigator already has the id in the xPathQry
True if navigator already has the id in the xPathQry
xPathQry
string
prefix
string
urn
string
navigator
XPathNavigator