public override bool Read() { var read = base.Read(); switch (base.NodeType) { case XmlNodeType.Element: _nsManager.PushScope(); for (var go = BaseReader.MoveToFirstAttribute(); go; go = BaseReader.MoveToNextAttribute()) { if (BaseReader.NamespaceURI != _xmlNsNamespace) { continue; } var prefix = GetNamespacePrefix(); // Only push if it's not already defined. if (_nsManager.LookupNamespace(prefix) == null) { _nsManager.AddNamespace(prefix, Value); } } if (BaseReader.HasAttributes) { BaseReader.MoveToElement(); } break; case XmlNodeType.EndElement: _nsManager.PopScope(); break; } return(read); }
/// <devdoc> /// <para> /// Moves to the first attribute. /// </para> /// </devdoc> public override bool MoveToFirstAttribute() { var result = BaseReader.MoveToFirstAttribute(); if (result) { _XPathCollection.Advance(this); } return(result); }
/// <summary> /// See <see cref="XmlReader.Read"/>. /// </summary> public override bool Read() { bool read = base.Read(); if (NodeType == XmlNodeType.Element) { nsManager.PushScope(); for (bool go = BaseReader.MoveToFirstAttribute(); go; go = BaseReader.MoveToNextAttribute()) { if (BaseReader.NamespaceURI != xmlNsNamespace) { continue; } string prefix = GetNamespacePrefix(); // Only push if it's not already defined. if (nsManager.LookupNamespace(prefix) == null) { nsManager.AddNamespace(prefix, Value); } } // If it had attributes, we surely moved through all of them searching for namespaces if (BaseReader.HasAttributes) { BaseReader.MoveToElement(); } } else if (NodeType == XmlNodeType.EndElement) { nsManager.PopScope(); } return(read); }
/// <inheritdoc/> public override bool MoveToFirstAttribute() => BaseReader.MoveToFirstAttribute();
/// <inheritdoc/> public override bool MoveToFirstAttribute() { return(BaseReader.MoveToFirstAttribute()); }