public nano_node add_xml(string xml) { nano_doc doc = new nano_doc(string.Format("<root>{0}</root>", xml)); nano_node fn = null; foreach (nano_node nd in doc.root.nodes) { add(nd); if (fn == null) { fn = nd; } } return(fn); }
public void load_xml(string xml) { int i = 0; _decs.Clear(); while (true) { _skip_spaces(xml, ref i); if (xml[i] != '<') { throw new XMLParsingException("Unexpected token"); } i++; // skip < if (xml[i] == '?') // declaration { i++; // skip ? _parse_attrs(xml, ref i, _decs, '?', '>'); i++; // skip ending ? i++; // skip ending > continue; } if (xml[i] == '!') // doctype { while (xml[i] != '>') // skip doctype { i++; } i++; // skip > continue; } _root = new nano_node(xml, ref i); break; } }
public nano_node add(nano_node nd) { _nodes.Add(nd); return(nd); }
public nano_node add(string name) { nano_node nd = new nano_node(name); _nodes.Add(nd); return(nd); }