Esempio n. 1
0
        public void ReadFrom(XmlDocument xmldoc)
        {
            try
            {
                MapInfoDocument doc = MapInfoDocument.Parse(xmldoc, NamespaceManager);
                mapInfo = doc.GetMapInfo();

                maps = new Dictionary <int, XSSFMap>();
                foreach (CT_Map map in mapInfo.Map)
                {
                    maps[(int)map.ID] = new XSSFMap(map, this);
                }
            }
            catch (XmlException e)
            {
                throw new IOException(e.Message);
            }
        }
Esempio n. 2
0
        public void TestMapInfoExists()
        {
            XSSFWorkbook wb = XSSFTestDataSamples.OpenSampleWorkbook("CustomXMLMappings.xlsx");

            MapInfo        mapInfo        = null;
            SingleXmlCells SingleXMLCells = null;

            foreach (POIXMLDocumentPart p in wb.GetRelations())
            {
                if (p is MapInfo)
                {
                    mapInfo = (MapInfo)p;


                    CT_MapInfo ctMapInfo = mapInfo.GetCTMapInfo();

                    Assert.IsNotNull(ctMapInfo);

                    Assert.AreEqual(1, ctMapInfo.Schema.Count);

                    foreach (XSSFMap map in mapInfo.GetAllXSSFMaps())
                    {
                        string xmlSchema = map.GetSchema();
                        Assert.IsNotNull(xmlSchema);
                    }
                }
            }

            XSSFSheet sheet1 = (XSSFSheet)wb.GetSheetAt(0);

            foreach (POIXMLDocumentPart p in sheet1.GetRelations())
            {
                if (p is SingleXmlCells)
                {
                    SingleXMLCells = (SingleXmlCells)p;
                }
            }
            Assert.IsNotNull(mapInfo);
            Assert.IsNotNull(SingleXMLCells);
        }
Esempio n. 3
0
 public MapInfo()
     : base()
 {
     mapInfo = new CT_MapInfo();
 }
Esempio n. 4
0
 public MapInfo()
 {
     this.mapInfo = new CT_MapInfo();
 }