title: trouble programming with xml files in delphi
body: <p>Hi I am a beginner programmer tyring to use TXMLparser with Delphi to just read a small xml file so I can understand how they work.</p>
  
  <p>I have the following structure in xml file 'parser.xml' ;</p>
  
  <pre><code>&lt;rule&gt;
    &lt;alert&gt;priority 3&lt;/alert&gt;
    &lt;desc&gt; &lt;/desc&gt;
    &lt;action&gt;beep&lt;/action&gt;
  &lt;/rule&gt;
  </code></pre>
  
  <p>And I have the following code in delphi </p>
  
  <pre><code>VAR
    Parser : TXmlParser;
    rule, alert: string;
    i:integer;
  
  BEGIN
    Parser := TXmlParser.Create;
    Parser.Normalize := TRUE;
    Parser.LoadFromFile ('c:\parser.xml');
    Parser.StartScan;
  
    WHILE Parser.Scan DO
      CASE Parser.CurPartType OF
        ptStartTag,
        ptEmptyTag :            
          For i:=0 TO Parser.CurAttr.Count-1 Do
          Begin
            rule :=Parser.CurAttr.rule (i);
            alert :=Parser.CurAttr.alert (i);
        ptContent,
        ptCData    : // Process Parser.CurContent field here
        ptEndTag   : // Process End-Tag here (Parser.CurName)
        ptPI       : // Process PI here 
                     // (Parser.CurName is the target, Parser.CurContent)
      END;
    Parser.Free;
  end.
  </code></pre>
  
  <p>I dont understand where, and with what syntax (e.g.  or 'rule' or rule) I am to enter in the xml tags. 
  I obtained the base of the code from the XML website, but the FOR loop is mine.. Seems to work ok but rule and alert come back as undeclared identifiers, even though they are set in VAR</p>
  
  <p>Any help on where to enter and how to enter the tags and why identifiers arent recognised would be appreciated.</p>
  
  <p>Thanks</p>