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);
        }
Esempio n. 2
0
 public NXmlElementReader(XmlStreamReader inputStream, NXmlNodeAttributes attributes, string name)
 {
     this.inputStream = inputStream;
     Attributes       = attributes;
     Name             = name;
 }
Esempio n. 3
0
 public NXmlCompactElementReader(NXmlNodeAttributes attributes, string name)
 {
     Attributes = attributes;
     Name       = name;
 }