public static ComplexType ParseComplexType(this XmlNodeReader reader) { ComplexType newComplexType = new ComplexType(); XmlReader subtree = reader.ReadSubtree(); while (subtree.Read()) { if (subtree.NodeType == XmlNodeType.Element) { if (subtree.Name.Equals("xsd:element")) { Element element = subtree.ParseElement(); newComplexType.Items.Add(element); //Console.WriteLine(element.Name); } } } if (reader.MoveToAttribute("name")) { newComplexType.Name = reader.ReadContentAsString(); } return(newComplexType); }
public static Include ParseInclude(this XmlNodeReader reader) { Include include = new Include(); if (reader.MoveToAttribute("schemaLocation")) { include.SchemaLocation = reader.ReadContentAsString(); } return(include); }
public static IDictionary <string, string> ParseSchemaHeader(this XmlNodeReader reader) { IDictionary <string, string> nsTable = new Dictionary <string, string>(); for (int i = 0; i < reader.AttributeCount; i++) { reader.MoveToAttribute(i); if (reader.Name.Contains("xmlns:")) { nsTable.Add(reader.Name.Substring(6), reader.ReadContentAsString()); } } return(nsTable); }