public override string GetAttribute( int index ) {
if (index < 0)
goto Error;
XPathNavigator nav = GetElemNav();
if (null == nav)
goto Error;
if ( nav.MoveToFirstNamespace( XPathNamespaceScope.Local ) ) {
// namespaces are returned in reverse order,
// but we want to return them in the correct order,
// so first count the namespaces
int nsCount;
string value = GetNamespaceByIndex( nav, index, out nsCount );
if ( null != value ) {
return value;
}
index -= nsCount;
nav.MoveToParent();
}
if ( nav.MoveToFirstAttribute() ) {
do {
if (index == 0)
return nav.Value;
index--;
} while ( nav.MoveToNextAttribute() );
}
// can't find it... error
Error:
throw new ArgumentOutOfRangeException("index");
}