Note that there are some explanatory texts on larger screens.

plurals
  1. POWhat does XmlReader.Parse() do?
    primarykey
    data
    text
    <p>edit: The project is an old project and the below code is one class in there that handles the xml.</p> <p>There is a question to get the xsd from an old legacy application, but all it seems to be doing is: xmlReader.ParseXml(fileName,outputFile); in the ProcessXml() method.</p> <pre><code>using System; using System.IO; using System.Configuration; using Utilities; namespace JobProcessor { public class XmlJob : Job { #region variables private string ftpServer; private string ftpUserName; private string ftpPassWord; private string ftpDestination; ///&lt;summary&gt;The xml reader used to get validation information from the xmp parsing&lt;/summary&gt; protected XmlReader xmlReader = new XmlReader(); private string outputFile; public XmlJob(string fileName, string type) : base(fileName, type){ ftpServer = ConfigurationManager.AppSettings[type + "-ftp"]; ftpUserName = ConfigurationManager.AppSettings[type + "-ftpUser"]; ftpPassWord = ConfigurationManager.AppSettings[type + "-ftpPass"]; ftpDestination = ConfigurationManager.AppSettings[type + "-ftpDest"]; } protected bool ConfigureXmlReader(){ int recType = 0; try{ //set up the record types (i.e. the elements that trigger a new record in the output while(ConfigurationManager.AppSettings[type + "-RecordType" + recType.ToString("00")] != null){ xmlReader.AddRecordType(ConfigurationManager.AppSettings[type + "-RecordType" + recType.ToString("00")],recType.ToString("00")); recType++; } //store the number of types xmlReader.SetNoRecordTypes(recType); }catch(Exception e){ HandleError("Error loading record types\r\n" + e.ToString() + "\r\n" + e.StackTrace + "\r\n"); return(false); } try{ //set up the fields which make up each record type for(int i=0;i&lt;recType;i++){ xmlReader.AddFieldsList(i,ConfigurationManager.AppSettings[type + "-" + i.ToString("00") + "Fields"]); } }catch(Exception e){ HandleError("Error loading field list\r\n" + e.ToString() + "\r\n" + e.StackTrace + "\r\n"); return(false); } return(true); } public override void RunJob(){ outputFile = Path.Combine(destinationDirectory, Path.GetFileNameWithoutExtension(fileName) + ".flat"); if(!ConfigureXmlReader()){ return; } if(!CheckInputFile()){ return; } if(!ProcessXml()){ return; } if(!Validate()){ return; } if(ftpServer!=null &amp;&amp; ftpUserName!=null &amp;&amp; ftpPassWord!=null &amp;&amp; ftpDestination!=null){ if(!FtpFile()){ return; } } MoveOriginalFile(); } protected virtual bool Validate(){ return(true); } protected bool ProcessXml(){ /* * Process the xml file into a delimited format */ try{ xmlReader.ParseXml(fileName,outputFile); }catch(Exception e){ HandleError("Error parsing XML file\r\n" + e.ToString() + "\r\n" + e.StackTrace + "\r\n"); return(false); } return(true); } protected bool FtpFile(){ try{ FtpMethods.UploadFile(ftpServer,ftpUserName,ftpPassWord,outputFile,ftpDestination); }catch(Exception e){ HandleError("Error FTPing file\r\n" + e.ToString() + "\r\n" + e.StackTrace + "\r\n"); return(false); } return(true); } #endregion } </code></pre> <p>}</p> <p>What exactly does this command do? F1 doesn't find anything and searching google gets me to a lot of xmlTextReaders.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload