private void ReadElementBinary (int ident)
{
// element
node.NodeType = XmlNodeType.Element;
node.Prefix = String.Empty;
context.NamespaceManager.PushScope ();
switch (ident) {
case BF.ElemString:
node.LocalName = ReadUTF8 ();
break;
case BF.ElemStringPrefix:
node.Prefix = ReadUTF8 ();
node.NSSlot = ns_slot++;
goto case BF.ElemString;
case BF.ElemIndex:
node.DictLocalName = ReadDictName ();
break;
case BF.ElemIndexPrefix:
node.Prefix = ReadUTF8 ();
node.NSSlot = ns_slot++;
goto case BF.ElemIndex;
default:
if (BF.PrefixNElemIndexStart <= ident && ident <= BF.PrefixNElemIndexEnd) {
node.Prefix = ((char) (ident - BF.PrefixNElemIndexStart + 'a')).ToString ();
node.DictLocalName = ReadDictName ();
} else if (BF.PrefixNElemStringStart <= ident && ident <= BF.PrefixNElemStringEnd) {
node.Prefix = ((char) (ident - BF.PrefixNElemStringStart + 'a')).ToString ();
node.LocalName = ReadUTF8 ();
}
else
throw new XmlException (String.Format ("Invalid element node type {0:X02} in hexadecimal", ident));
break;
}
bool loop = true;
do {
ident = ReadByteOrError ();
switch (ident) {
case BF.AttrString:
case BF.AttrStringPrefix:
case BF.AttrIndex:
case BF.AttrIndexPrefix:
ReadAttribute ((byte) ident);
break;
case BF.DefaultNSString:
case BF.PrefixNSString:
case BF.DefaultNSIndex:
case BF.PrefixNSIndex:
ReadNamespace ((byte) ident);
break;
default:
if (BF.PrefixNAttrStringStart <= ident && ident <= BF.PrefixNAttrStringEnd ||
BF.PrefixNAttrIndexStart <= ident && ident <= BF.PrefixNAttrIndexEnd)
ReadAttribute ((byte) ident);
else {
next = ident;
loop = false;
}
break;
}
} while (loop);
node.NS = context.NamespaceManager.LookupNamespace (node.Prefix) ?? String.Empty;
foreach (AttrNodeInfo a in attributes)
if (a.Prefix.Length > 0)
a.NS = context.NamespaceManager.LookupNamespace (a.Prefix);
ns_store.Clear ();
ns_dict_store.Clear ();
}