public bool ReadAttributeValue( ref int level, ref bool bResolveEntity, ref XmlNodeType nt ) {
if ( nAttrInd != -1 ) {
Debug.Assert( curNode.NodeType == XmlNodeType.XmlDeclaration || curNode.NodeType == XmlNodeType.DocumentType );
if ( !this.bOnAttrVal ) {
this.bOnAttrVal = true;
level++;
nt = XmlNodeType.Text;
return true;
}
return false;
}
if( curNode.NodeType == XmlNodeType.Attribute ) {
XmlNode firstChild = curNode.FirstChild;
if ( firstChild != null ) {
curNode = firstChild;
nt = curNode.NodeType;
level++;
this.bOnAttrVal = true;
return true;
}
}
else if ( this.bOnAttrVal ) {
XmlNode nextSibling = null;
if ( curNode.NodeType == XmlNodeType.EntityReference && bResolveEntity ) {
//going down to ent ref node
curNode = curNode.FirstChild;
nt = curNode.NodeType;
Debug.Assert( curNode != null );
level++;
bResolveEntity = false;
return true;
}
else
nextSibling = curNode.NextSibling;
if ( nextSibling == null ) {
XmlNode parentNode = curNode.ParentNode;
//Check if its parent is entity ref node is sufficient, because in this senario, ent ref node can't have more than 1 level of children that are not other ent ref nodes
if ( parentNode != null && parentNode.NodeType == XmlNodeType.EntityReference ) {
//come back from ent ref node
curNode = parentNode;
nt = XmlNodeType.EndEntity;
level--;
return true;
}
}
if ( nextSibling != null ) {
curNode = nextSibling;
nt = curNode.NodeType;
return true;
}
else
return false;
}
return false;
}