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); } }
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); } }
/** * 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); }
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++; } }
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); } }
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++; } }