static Attributes CreateAttributes(params AttrKeyValue[] keyValues) { Attributes attrs = new Attributes(); int j = keyValues.Length; ArrayList attrArr = attrs.attArray; for (int i = 0; i < j; ++i) { AttrKeyValue kv = keyValues[i]; SaxAttribute saxAttr = new SaxAttribute(); saxAttr.Name = kv.name; saxAttr.NamespaceURI = ""; saxAttr.Value = kv.value; attrArr.Add(saxAttr); } return(attrs); }
// called by property list builder internal string getValue(int index) { SaxAttribute saxAtt = (SaxAttribute)attArray[index]; return(saxAtt.Value); }
// called by property list builder internal string getQName(int index) { SaxAttribute saxAtt = (SaxAttribute)attArray[index]; return(saxAtt.Name); }
internal void Parse(XmlReader reader) { int buflen = 500; char[] buffer = new char[buflen]; try { object nsuri = reader.NameTable.Add("http://www.w3.org/2000/xmlns/"); FonetDriver.ActiveDriver.FireFonetInfo("Building formatting object tree"); streamRenderer.StartRenderer(); while (reader.Read()) { switch (reader.NodeType) { case XmlNodeType.Element: Attributes atts = new Attributes(); while (reader.MoveToNextAttribute()) { if (!reader.NamespaceURI.Equals(nsuri)) { SaxAttribute newAtt = new SaxAttribute(); newAtt.Name = reader.Name; newAtt.NamespaceURI = reader.NamespaceURI; newAtt.Value = reader.Value; atts.attArray.Add(newAtt); } } reader.MoveToElement(); StartElement(reader.NamespaceURI, reader.LocalName, atts.TrimArray()); if (reader.IsEmptyElement) { EndElement(); } break; case XmlNodeType.EndElement: EndElement(); break; case XmlNodeType.Text: char[] chars = reader.ReadString().ToCharArray(); if (currentFObj != null) { currentFObj.AddCharacters(chars, 0, chars.Length); } if (reader.NodeType == XmlNodeType.Element) { goto case XmlNodeType.Element; } if (reader.NodeType == XmlNodeType.EndElement) { goto case XmlNodeType.EndElement; } break; default: break; } } FonetDriver.ActiveDriver.FireFonetInfo("Parsing of document complete, stopping renderer"); streamRenderer.StopRenderer(); } catch (Exception exception) { FonetDriver.ActiveDriver.FireFonetError(exception.ToString()); } finally { if (reader.ReadState != ReadState.Closed) { reader.Close(); } } }