示例#1
0
 public void ReadFrom(Stream is1)
 {
     try
     {
         int         cnt = 0;
         XmlDocument xml = ConvertStreamToXml(is1);
         _sstDoc = SstDocument.Parse(xml, NamespaceManager);
         CT_Sst sst = _sstDoc.GetSst();
         count       = (int)sst.count;
         uniqueCount = (int)sst.uniqueCount;
         foreach (CT_Rst st in sst.si)
         {
             string key = GetKey(st);
             if (key != null && !stmap.ContainsKey(key))
             {
                 stmap.Add(key, cnt);
             }
             strings.Add(st);
             cnt++;
         }
     }
     catch (XmlException e)
     {
         throw new IOException("unable to parse shared strings table", e);
     }
 }
示例#2
0
 public void ReadFrom(Stream is1)
 {
     try
     {
         int cnt = 0;
         _sstDoc = SstDocument.Parse(is1);
         CT_Sst sst = _sstDoc.GetSst();
         count       = (int)sst.count;
         uniqueCount = (int)sst.uniqueCount;
         foreach (CT_Rst st in sst.si)
         {
             string key = GetKey(st);
             if (key != null && !stmap.ContainsKey(key))
             {
                 stmap.Add(key, cnt);
             }
             strings.Add(st);
             cnt++;
         }
     }
     catch (XmlException e)
     {
         throw new IOException(e.Message);
     }
 }
示例#3
0
        /**
         * Add an entry to this Shared String table (a new value is appened to the end).
         *
         * <p>
         * If the Shared String table already Contains this <code>CT_Rst</code> bean, its index is returned.
         * Otherwise a new entry is aded.
         * </p>
         *
         * @param st the entry to add
         * @return index the index of Added entry
         */
        public int AddEntry(CT_Rst st)
        {
            String s = GetKey(st);

            count++;
            if (stmap.ContainsKey(s))
            {
                return(stmap[s]);
            }

            uniqueCount++;
            //create a CT_Rst bean attached to this SstDocument and copy the argument CT_Rst into it
            CT_Rst newSt = new CT_Rst();

            _sstDoc.GetSst().si.Add(newSt);
            newSt.Set(st);
            int idx = strings.Count;

            stmap[s] = idx;
            strings.Add(newSt);
            return(idx);
        }
示例#4
0
        public void ReadFrom(XmlDocument xml)
        {
            int cnt = 0;

            _sstDoc = SstDocument.Parse(xml, NamespaceManager);
            CT_Sst sst = _sstDoc.GetSst();

            count       = (int)sst.count;
            uniqueCount = (int)sst.uniqueCount;
            foreach (CT_Rst st in sst.si)
            {
                string key = GetKey(st);
                if (key != null && !stmap.ContainsKey(key))
                {
                    stmap.Add(key, cnt);
                }
                strings.Add(st);
                cnt++;
            }
        }
示例#5
0
 public void ReadFrom(Stream is1)
 {
     try
     {
         int cnt = 0;
         _sstDoc = SstDocument.Parse(is1);
         CT_Sst sst = _sstDoc.GetSst();
         count = (int)sst.count;
         uniqueCount = (int)sst.uniqueCount;
         foreach (CT_Rst st in sst.si)
         {
             string key=GetKey(st);
             if(key!=null && !stmap.ContainsKey(key))
                 stmap.Add(key, cnt);
             strings.Add(st);
             cnt++;
         }
     }
     catch (XmlException e)
     {
         throw new IOException(e.Message);
     }
 }
示例#6
0
        public void ReadFrom(XmlDocument xml)
        {
                 int cnt = 0;
                _sstDoc = SstDocument.Parse(xml, NameSpaceManager);
                CT_Sst sst = _sstDoc.GetSst();
                count = (int)sst.count;
                uniqueCount = (int)sst.uniqueCount;
                foreach (CT_Rst st in sst.si)
                {
                     string key=GetKey(st);
                   if(key!=null && !stmap.ContainsKey(key))
                       stmap.Add(key, cnt);
                   strings.Add(st);
                    cnt++;
                }

        }