Exemple #1
0
        static void Main(string[] args)
        {
            StringBuilder xmloutput = new StringBuilder();

            XCRI.XmlGeneration.Interfaces.IXmlGenerator gen =
                XCRI.XmlGeneration.XmlGeneratorFactory.GetXmlGenerator(XCRI.XCRIProfiles.XCRI_v1_2);

            XCRI.Catalog catalog = new XCRI.Catalog();
            catalog.Descriptions.Add(new Description()
            {
                Value = "Catalog for Cornwall College"
            });
            catalog.Providers.Add(new XCRIBuilder.CornwallCollegeProvider());

            gen.RootElement = catalog;

            gen.Generate(xmloutput);
            xmloutput = xmloutput.Replace("&lt;", "<");
            xmloutput = xmloutput.Replace("&gt;", ">");
            xmloutput = xmloutput.Replace("li value=" + "\"0\"", "li");
            xmloutput = xmloutput.Replace("encoding=\"utf-16\"", "encoding=\"utf-8\"");

            string outputfile = @"c:\temp\xmloutput.xml";

            if (args.Length > 0)
            {
                outputfile = args[0];
            }

            File.WriteAllText(outputfile, xmloutput.ToString());
        }
 public void CheckXCRI12()
 {
     XCRI.XmlGeneration.Interfaces.IXmlGenerator gen
         = XCRI.XmlGeneration.XmlGeneratorFactory.GetXmlGenerator(XCRIProfiles.XCRI_v1_2);
     if (gen == null)
     {
         Assert.Fail("XmlGeneratorFactory did not return a generator for XCRI 1.2");
     }
     if (!(gen is XCRI.XmlGeneration.XCRICAP12.Generator))
     {
         Assert.Fail("XmlGeneratorFactory did not return an instance of XmlGeneration.XCRICAP12.Generator when expected");
     }
 }
 public void CheckAllProfiles()
 {
     XCRI.XmlGeneration.Interfaces.IXmlGenerator gen
         = XCRI.XmlGeneration.XmlGeneratorFactory.GetXmlGenerator(XCRIProfiles.All);
 }
 public void CheckNoProfile()
 {
     XCRI.XmlGeneration.Interfaces.IXmlGenerator gen
         = XCRI.XmlGeneration.XmlGeneratorFactory.GetXmlGenerator(XCRIProfiles.None);
 }