public INXmlElementReader Create() { inputStream.Seek(1, SeekOrigin.Current); var nodeName = inputStream.ReadWord(); var line = inputStream.ReadRestOfLine().Trim(); if (!line.EndsWith(">")) { throw new NXmlReaderFormatException("Missing element closing brace on same line element is declared"); } var attributes = new NXmlNodeAttributes(line.Trim('>', '/')); INXmlElementReader reader; if (line.EndsWith("/>")) { reader = new NXmlCompactElementReader(attributes, nodeName); } else { reader = new NXmlElementReader(inputStream, attributes, nodeName); } return reader; }
public NXmlCompactElementReader(NXmlNodeAttributes attributes, string name) { Attributes = attributes; Name = name; }
public NXmlElementReader(XmlStreamReader inputStream, NXmlNodeAttributes attributes, string name) { this.inputStream = inputStream; Attributes = attributes; Name = name; }