4. Working with Classes : XML Support for OpenROAD : Examples of XML Capabilities : Example: Parsing XML
 
Share this page                  
Example: Parsing XML
The following portion of code parses the XML file “my.xml” and, if an error is generated, displays the error text or, in case of success, identifies the name of the root element.
DECLARE
    xd      = XMLDocument;
ENDDECLARE
{
  IF xd.ParseURL(urllocation='C:\temp\my.xml')<>ER_OK
  THEN
      MESSAGE xd.Errortext;
  ELSE
      MESSAGE 'RootElement: '+xd.RootElement.Name;
  ENDIF;
}