/// <inheritdoc /> protected override string QualifyXPath(string xpath, string prefix, string uri = null, int index = -1, bool isAttribute = false) { // Determine namespace if not provided. var ns = uri ?? CurrentNamespace; if (isAttribute && string.IsNullOrEmpty(prefix)) { // Don't qualify the default namespace for attributes ns = string.Empty; } return(XPathManager.QualifyXPath(xpath, prefix, ns, index, isAttribute)); }
/// <summary> /// Construct the qualified XPath for the supplied path. /// </summary> /// <param name="xpath">Base XPath to qualify.</param> /// <param name="prefix">Prefix to use, must provide to evaluate qualified attributes</param> /// <param name="xmlNamespace">XML namespace to apply.</param> /// <param name="index">Index if part of a node collection.</param> /// <param name="isAttribute">Whether we are accessing a element or attribute.</param> /// <returns>The qualified path.</returns> protected virtual string QualifyXPath(string xpath, string prefix, string xmlNamespace = null, int index = -1, bool isAttribute = false) { // Determine namespace if not provided. var ns = xmlNamespace ?? CurrentNamespace; if (isAttribute && string.IsNullOrEmpty(prefix)) { // Don't qualify the default namespace for attributes // TODO: How to inject this, might need schema-qualfied for some apps ns = string.Empty; } return(XPathManager.QualifyXPath(xpath, prefix, ns, index, isAttribute)); }