コード例 #1
0
ファイル: XmlValidator.cs プロジェクト: wchen02/BulletHell
 public XmlValidator(XmlStruct xmlStruct)
 {
     this.xmlStruct = xmlStruct;
 }
コード例 #2
0
ファイル: XmlValidator.cs プロジェクト: wchen02/BulletHell
 private void readElement(XmlStruct xmlStruct, XmlTextReader reader, XmlTag element)
 {
     /* If the stack is emepty, push only the root tag */
     if (stack.Count == 0 && element.Tag == xmlStruct.Root.Tag)
     {
         stack.Push(element);
         readAttribute(xmlStruct.Root, reader, element);
     }
     else if (stack.Count > 0 && readChildren(stack.Peek(), reader, element)) // else push, if the tag is a child of the stack.Peek().
     {
         stack.Push(element);
         readAttribute(stack.Peek(), reader, element);
     }
     else
         throw new Exception("Error 5: Invalid Tag '" + element.Tag + "'. " + "Line " + reader.LineNumber + ", position " + reader.LinePosition);
 }