/// <summary> /// Build an element node and attach it to its parent, if one exists. Make the element the new parent node. /// </summary> public void WriteStartElement(string?prefix, string localName, string?ns, string?baseUri) { int hash; Debug.Assert(prefix != null && localName != null && ns != null && localName.Length != 0 && baseUri != null); if (_atomizeNames) { prefix = _nameTable.Add(prefix); localName = _nameTable.Add(localName); ns = _nameTable.Add(ns); } AddSibling(XPathNodeType.Element, localName, ns, prefix, baseUri); _pageParent = _pageSibling; _idxParent = _idxSibling; _idxSibling = 0; // Link elements with the same name together hash = (_pageParent[_idxParent].LocalNameHashCode & (ElementIndexSize - 1)); _elemNameIndex[hash] = LinkSimilarElements(_elemNameIndex[hash].Page, _elemNameIndex[hash].Index, _pageParent, _idxParent); // If elements within this document might have IDs, then cache the name of the ID attribute, if one exists if (_elemIdMap != null) { _idAttrName = (XmlQualifiedName?)_elemIdMap[new XmlQualifiedName(localName, prefix)]; } }
public void AddLang(string lang) { Debug.Assert(lang != null); lang = _nameTable.Add(lang); if (RefEquals(lang, Lang)) { return; } AddRecord(new QName(null, Lang, AtomLang)); Lang = lang; }
/// <summary> /// Constructor. /// </summary> /// <param name="atomInputContext">The ATOM input context to read from.</param> internal ODataAtomPropertyAndValueDeserializer(ODataAtomInputContext atomInputContext) : base(atomInputContext) { DebugUtils.CheckNoExternalCallers(); XmlNameTable nameTable = this.XmlReader.NameTable; this.EmptyNamespace = nameTable.Add(string.Empty); this.ODataNullAttributeName = nameTable.Add(AtomConstants.ODataNullAttributeName); this.ODataCollectionItemElementName = nameTable.Add(AtomConstants.ODataCollectionItemElementName); this.AtomTypeAttributeName = nameTable.Add(AtomConstants.AtomTypeAttributeName); }
/// <summary> /// Constructor. /// </summary> /// <param name="atomInputContext">The ATOM input context to read from.</param> internal ODataAtomEntityReferenceLinkDeserializer(ODataAtomInputContext atomInputContext) : base(atomInputContext) { DebugUtils.CheckNoExternalCallers(); XmlNameTable nameTable = this.XmlReader.NameTable; this.ODataLinksElementName = nameTable.Add(AtomConstants.ODataLinksElementName); this.ODataCountElementName = nameTable.Add(AtomConstants.ODataCountElementName); this.ODataNextElementName = nameTable.Add(AtomConstants.ODataNextLinkElementName); this.ODataUriElementName = nameTable.Add(AtomConstants.ODataUriElementName); }
public void Atomize(XmlNameTable nameTable) { if (LocalName != null) { LocalName = nameTable.Add(LocalName); } if (NamespaceName != null) { NamespaceName = nameTable.Add(NamespaceName); } }
private void BuildIdentityMap(XmlNameTable nameTable, DataTable dataTable) { ArrayList tableList = GetSelfAndDescendants(dataTable); // Get list of tables we're loading // This includes our table and // related tables tree _tableSchemaMap = new XmlNodeIdHashtable(tableList.Count); // Create hash table to hold all // tables to load. foreach (DataTable t in tableList) { // For each table TableSchemaInfo tableSchemaInfo = AddTableSchema(nameTable, t); // Create schema info if (tableSchemaInfo != null) { foreach (DataColumn c in t.Columns) { // Add column information // don't include auto-generated PK, FK and any hidden columns to be part of mapping if (IsMappedColumn(c)) { AddColumnSchema(nameTable, c, tableSchemaInfo.ColumnsSchemaMap); } } foreach (DataRelation r in t.ChildRelations) { // Add nested tables information if (r.Nested) { // Is it nested? // don't include non nested tables // Handle namespaces and names as usuall string _tableLocalName = XmlConvert.EncodeLocalName(r.ChildTable.TableName); string?tableLocalName = nameTable.Get(_tableLocalName) ?? nameTable.Add(_tableLocalName); string?tableNamespace = nameTable.Get(r.ChildTable.Namespace) ?? nameTable.Add(r.ChildTable.Namespace); XmlNodeIdentety idTable = new XmlNodeIdentety(tableLocalName, tableNamespace); tableSchemaInfo.ColumnsSchemaMap[idTable] = r.ChildTable; } } } } }
public MFTestResults SPOTXml_NameTableTest5() { /// <summary> /// Tests the NameTable class under SPOT.Xml /// </summary> /// bool testResult = true; try { XmlReader testReader = XmlReader.Create(new TestStream()); XmlNameTable testNT = new XmlNameTable(); object root = testNT.Add("root"); object element1 = testNT.Add("TestElement1"); testReader.Read(); object localName = testReader.LocalName; if (!(localName == root)) { Log.Exception("1st reading, expected local name '" + root + "' but got '" + localName + "'"); testResult = false; } testReader.Read(); localName = testReader.LocalName; if (!(localName == element1)) { Log.Exception("2nd reading, expected local name '" + element1 + "' but got '" + localName + "'"); testResult = false; } testNT.Add("test1"); if (testNT.Get("root").GetType() != Type.GetType("System.String")) { testResult = false; Log.Exception("Get(string) got wrong type"); } if (testNT.Get("root") != "root") { testResult = false; Log.Exception("Get(string) got wrong data"); } } catch (Exception e) { testResult = false; Log.Exception("Incorrect exception caught: ", e); } return(testResult ? MFTestResults.Pass : MFTestResults.Fail); }
void ReadColumnNames() { if (_csvReader.Read()) { // If column names were already provided then we just skip this row. if (_names == null) { _names = new string[_csvReader.FieldCount]; for (int i = 0; i < _csvReader.FieldCount; i++) { _names[i] = _nt.Add(_csvReader[i]); } } } }
internal ODataAtomServiceDocumentDeserializer(ODataAtomInputContext atomInputContext) : base(atomInputContext) { XmlNameTable nameTable = base.XmlReader.NameTable; this.AtomPublishingServiceElementName = nameTable.Add("service"); this.AtomPublishingWorkspaceElementName = nameTable.Add("workspace"); this.AtomPublishingCollectionElementName = nameTable.Add("collection"); this.AtomPublishingAcceptElementName = nameTable.Add("accept"); this.AtomPublishingCategoriesElementName = nameTable.Add("categories"); this.AtomHRefAttributeName = nameTable.Add("href"); this.AtomPublishingNamespace = nameTable.Add("http://www.w3.org/2007/app"); this.AtomNamespace = nameTable.Add("http://www.w3.org/2005/Atom"); this.AtomTitleElementName = nameTable.Add("title"); this.EmptyNamespace = nameTable.Add(string.Empty); }
private static void HandleSpecialColumn(DataColumn col, XmlNameTable nameTable, XmlNodeIdHashtable columns) { // if column name starts with xml, we encode it manually and add it for look up Debug.Assert(col.ColumnName.StartsWith("xml", StringComparison.OrdinalIgnoreCase), "column name should start with xml"); string tempColumnName; if ('x' == col.ColumnName[0]) { tempColumnName = "_x0078_"; // lower case xml... -> _x0078_ml... } else { tempColumnName = "_x0058_"; // upper case Xml... -> _x0058_ml... } tempColumnName = string.Concat(tempColumnName, col.ColumnName.AsSpan(1)); if (nameTable.Get(tempColumnName) == null) { nameTable.Add(tempColumnName); } string? columnNamespace = nameTable.Get(col.Namespace); XmlNodeIdentety idColumn = new XmlNodeIdentety(tempColumnName, columnNamespace); columns[idColumn] = col; }
public override object ParseValue(string s, XmlNameTable nameTable, IXmlNamespaceResolver nsmgr) { if (nameTable == null) { throw new ArgumentNullException("name table"); } if (nsmgr == null) { throw new ArgumentNullException("namespace manager"); } XmlQualifiedName xmlQualifiedName = XmlQualifiedName.Parse(s, nsmgr, true); nameTable.Add(xmlQualifiedName.Name); nameTable.Add(xmlQualifiedName.Namespace); return(xmlQualifiedName); }
internal static string XdrCanonizeUri(string uri, XmlNameTable nameTable, SchemaNames schemaNames) { string nsXdr; int length = 5; bool flag = false; if ((uri.Length > 5) && uri.StartsWith("uuid:", StringComparison.Ordinal)) { flag = true; } else if ((uri.Length > 9) && uri.StartsWith("urn:uuid:", StringComparison.Ordinal)) { flag = true; length = 9; } if (flag) { nsXdr = nameTable.Add(uri.Substring(0, length) + uri.Substring(length, uri.Length - length).ToUpper(CultureInfo.InvariantCulture)); } else { nsXdr = uri; } if (Ref.Equal(schemaNames.NsDataTypeAlias, nsXdr) || Ref.Equal(schemaNames.NsDataTypeOld, nsXdr)) { return(schemaNames.NsDataType); } if (Ref.Equal(schemaNames.NsXdrAlias, nsXdr)) { nsXdr = schemaNames.NsXdr; } return(nsXdr); }
// Constructor. public NameCache(XmlNameTable nt) : base(128) // avoid expanding of hashtable { nameTable = nt; // only NameTable is guaranted to use String.Empty emptyString = nt.Add(String.Empty); }
public string GetString(int iOffset, int iLength, XmlNameTable nameTable) { char[] charBuffer = this.GetCharBuffer(iLength); int charsLength = this.GetChars(iOffset, iLength, charBuffer); return(nameTable.Add(charBuffer, 0, charsLength)); }
public string GetEscapedString(int iOffset, int length, XmlNameTable nameTable) { char[] charBuffer = this.GetCharBuffer(length); int escapedChars = this.GetEscapedChars(iOffset, length, charBuffer); return(nameTable.Add(charBuffer, 0, escapedChars)); }
public BaseProcessor(XmlNameTable nameTable, System.Xml.Schema.SchemaNames schemaNames, ValidationEventHandler eventHandler, XmlSchemaCompilationSettings compilationSettings) { this.nameTable = nameTable; this.schemaNames = schemaNames; this.eventHandler = eventHandler; this.compilationSettings = compilationSettings; this.NsXml = nameTable.Add("http://www.w3.org/XML/1998/namespace"); }
/// <summary> /// Constructor. /// </summary> /// <param name="atomInputContext">The ATOM input context to read from.</param> internal ODataAtomServiceDocumentDeserializer(ODataAtomInputContext atomInputContext) : base(atomInputContext) { DebugUtils.CheckNoExternalCallers(); XmlNameTable nameTable = this.XmlReader.NameTable; this.AtomPublishingServiceElementName = nameTable.Add(AtomConstants.AtomPublishingServiceElementName); this.AtomPublishingWorkspaceElementName = nameTable.Add(AtomConstants.AtomPublishingWorkspaceElementName); this.AtomPublishingCollectionElementName = nameTable.Add(AtomConstants.AtomPublishingCollectionElementName); this.AtomPublishingAcceptElementName = nameTable.Add(AtomConstants.AtomPublishingAcceptElementName); this.AtomPublishingCategoriesElementName = nameTable.Add(AtomConstants.AtomPublishingCategoriesElementName); this.AtomHRefAttributeName = nameTable.Add(AtomConstants.AtomHRefAttributeName); this.AtomPublishingNamespace = nameTable.Add(AtomConstants.AtomPublishingNamespace); this.AtomNamespace = nameTable.Add(AtomConstants.AtomNamespace); this.AtomTitleElementName = nameTable.Add(AtomConstants.AtomTitleElementName); this.EmptyNamespace = nameTable.Add(string.Empty); }
public ScopeManager(XmlNameTable nameTable) { _nameTable = nameTable; _stringEmpty = nameTable.Add(string.Empty); Lang = _stringEmpty; Space = XmlSpace.None; Reset(); }
: this(nameTable, schemaNames, eventHandler, new XmlSchemaCompilationSettings()) {} //Use the default for XmlSchemaCollection public BaseProcessor(XmlNameTable nameTable, SchemaNames schemaNames, ValidationEventHandler eventHandler, XmlSchemaCompilationSettings compilationSettings) { Debug.Assert(nameTable != null); this.nameTable = nameTable; this.schemaNames = schemaNames; this.eventHandler = eventHandler; this.compilationSettings = compilationSettings; NsXml = nameTable.Add(XmlReservedNs.NsXml); }
private static XmlSchema GetBuildInSchema(XmlNameTable nt) { XmlSchema schema = new XmlSchema(); schema.TargetNamespace = XmlReservedNs.NsXml; XmlSchemaAttribute lang = new XmlSchemaAttribute(); lang.Name = "lang"; lang.SchemaTypeName = new XmlQualifiedName("language", nt.Add(XmlReservedNs.NsXsd)); schema.Items.Add(lang); XmlSchemaAttribute space = new XmlSchemaAttribute(); space.Name = "space"; XmlSchemaSimpleType type = new XmlSchemaSimpleType(); XmlSchemaSimpleTypeRestriction r = new XmlSchemaSimpleTypeRestriction(); r.BaseTypeName = new XmlQualifiedName("NCName", nt.Add(XmlReservedNs.NsXsd)); XmlSchemaEnumerationFacet space_default = new XmlSchemaEnumerationFacet(); space_default.Value = "default"; r.Facets.Add(space_default); XmlSchemaEnumerationFacet space_preserve = new XmlSchemaEnumerationFacet(); space_preserve.Value = "preserve"; r.Facets.Add(space_preserve); type.Content = r; space.SchemaType = type; space.DefaultValue = "preserve"; schema.Items.Add(space); XmlSchemaAttributeGroup attributeGroup = new XmlSchemaAttributeGroup(); attributeGroup.Name = "specialAttrs"; XmlSchemaAttribute langRef = new XmlSchemaAttribute(); langRef.RefName = new XmlQualifiedName("lang", XmlReservedNs.NsXml); attributeGroup.Attributes.Add(langRef); XmlSchemaAttribute spaceRef = new XmlSchemaAttribute(); spaceRef.RefName = new XmlQualifiedName("space", XmlReservedNs.NsXml); attributeGroup.Attributes.Add(spaceRef); schema.Items.Add(attributeGroup); return(schema); }
private TableSchemaInfo AddTableSchema(XmlNameTable nameTable, DataTable table) { // Enzol:This is the opposite of the previous function: // we populate the nametable so that the hash comparison can happen as // object comparison instead of strings. // Sdub: GetIdentity is called from two places: BuildIdentityMap() and LoadRows() // First case deals with decoded names; Second one with encoded names. // We decided encoded names in first case (instead of decoding them in second) // because it save us time in LoadRows(). We have, as usual, more data them schemas string _tableLocalName = table.EncodedTableName; // Table name string?tableLocalName = nameTable.Get(_tableLocalName); // Look it up in nametable if (tableLocalName == null) { // If not found tableLocalName = nameTable.Add(_tableLocalName); // Add it } table._encodedTableName = tableLocalName; // And set it back string?tableNamespace = nameTable.Get(table.Namespace); // Look ip table namespace if (tableNamespace == null) { // If not found tableNamespace = nameTable.Add(table.Namespace); // Add it } else { if (table._tableNamespace != null) // Update table namespace { table._tableNamespace = tableNamespace; } } TableSchemaInfo tableSchemaInfo = new TableSchemaInfo(table); // Create new table schema info _tableSchemaMap[new XmlNodeIdentety(tableLocalName, tableNamespace)] = tableSchemaInfo; // And add it to the hashtable return(tableSchemaInfo); // Return it as we have to populate // Column schema map and Child table // schema map in it }
public XPathNavigator(XObject obj) { _obj = obj; _nameTable = new NameTable(); _nameTable.Add(string.Empty); _nameTable.Add("http://www.w3.org/2000/xmlns/"); _nameTable.Add("http://www.w3.org/XML/1998/namespace"); }
// Constructor. public NodeManager(XmlNameTable nt, ErrorHandler eh) { current = (int)Type.None; attributes = null; error = eh; nodes = new NodeInfo[11]; nodes[current] = new DefaultNodeInfo(); xml = nt.Add("xml"); }
} //Use the default for XmlSchemaCollection public BaseProcessor(XmlNameTable nameTable, SchemaNames schemaNames, ValidationEventHandler eventHandler, XmlSchemaCompilationSettings compilationSettings) { Debug.Assert(nameTable != null); this.nameTable = nameTable; this.schemaNames = schemaNames; this.eventHandler = eventHandler; this.compilationSettings = compilationSettings; NsXml = nameTable.Add(XmlReservedNs.NsXml); }
public BaseProcessor(XmlNameTable nameTable, SchemaNames?schemaNames, ValidationEventHandler?eventHandler, XmlSchemaCompilationSettings?compilationSettings) { Debug.Assert(nameTable != null); _nameTable = nameTable; _schemaNames = schemaNames; _eventHandler = eventHandler; _compilationSettings = compilationSettings; _nsXml = nameTable.Add(XmlReservedNs.NsXml); }
/// <summary> /// Constructor. /// </summary> /// <param name="atomInputContext">The ATOM input context to read from.</param> /// <param name="inSourceElement">Whether this deserializer is reading feed metadata for a source element (true) or a feed element (false).</param> internal ODataAtomFeedMetadataDeserializer(ODataAtomInputContext atomInputContext, bool inSourceElement) : base(atomInputContext) { XmlNameTable nameTable = this.XmlReader.NameTable; this.EmptyNamespace = nameTable.Add(string.Empty); this.InSourceElement = inSourceElement; }
private void BuildIdentityMap(XmlNameTable nameTable, DataSet dataSet) { this.tableSchemaMap = new XmlNodeIdHashtable(dataSet.Tables.Count); string str3 = nameTable.Get(dataSet.Namespace); if (str3 == null) { str3 = nameTable.Add(dataSet.Namespace); } dataSet.namespaceURI = str3; foreach (DataTable table in dataSet.Tables) { TableSchemaInfo info = this.AddTableSchema(nameTable, table); if (info != null) { foreach (DataColumn column in table.Columns) { if (IsMappedColumn(column)) { this.AddColumnSchema(nameTable, column, info.ColumnsSchemaMap); } } foreach (DataRelation relation in table.ChildRelations) { if (relation.Nested) { string array = XmlConvert.EncodeLocalName(relation.ChildTable.TableName); string localName = nameTable.Get(array); if (localName == null) { localName = nameTable.Add(array); } string namespaceURI = nameTable.Get(relation.ChildTable.Namespace); if (namespaceURI == null) { namespaceURI = nameTable.Add(relation.ChildTable.Namespace); } XmlNodeIdentety identety = new XmlNodeIdentety(localName, namespaceURI); info.ColumnsSchemaMap[identety] = relation.ChildTable; } } } } }
private void Init() { // load predifined namespace to nametable for (int i = 1; i < NamespaceIdMap.Count; i++) { _xmlNameTable.Add(NamespaceIdMap.GetNamespaceUri((byte)i)); } _xmlNameTable.Add(xmlnsUri); // init XmlReaderSettings // O15:#3024890, Set IgnoreWhitespace to false for the SDK to handle the whitespace node type. We have to do this because // PPT does not use the preserve attribute (xml:space="preserve") for non-ignorable whitespaces. (See the bug for details.) XmlReaderSettings = new XmlReaderSettings { NameTable = _xmlNameTable, IgnoreWhitespace = false }; }
public static XmlNamespaceManager GetNamespaceScope(XmlNode context) { XmlDocument owner = null; if (context is XmlDocument) { owner = (XmlDocument)context; } else { owner = context.OwnerDocument; } XmlNameTable nt = owner.NameTable; XmlNamespaceManager nsmgr = new XmlNamespaceManager(nt); XmlNode parent = context; while (parent != null) { if (parent is XmlElement) { if (parent.Attributes != null) { foreach (XmlAttribute a in parent.Attributes) { if (a.NamespaceURI == XmlnsUri) { string prefix = nt.Add(a.LocalName); if (prefix == "xmlns") { prefix = ""; } if (!nsmgr.HasNamespace(prefix)) { nsmgr.AddNamespace(prefix, nt.Add(a.Value)); } } } } } parent = parent.ParentNode; } return(nsmgr); }
internal ODataAtomServiceDocumentMetadataDeserializer(ODataAtomInputContext atomInputContext) : base(atomInputContext) { XmlNameTable nameTable = base.XmlReader.NameTable; this.AtomNamespace = nameTable.Add("http://www.w3.org/2005/Atom"); this.AtomCategoryElementName = nameTable.Add("category"); this.AtomHRefAttributeName = nameTable.Add("href"); this.AtomPublishingFixedAttributeName = nameTable.Add("fixed"); this.AtomCategorySchemeAttributeName = nameTable.Add("scheme"); this.AtomCategoryTermAttributeName = nameTable.Add("term"); this.AtomCategoryLabelAttributeName = nameTable.Add("label"); this.EmptyNamespace = nameTable.Add(string.Empty); }
/// <summary> /// Get the named node pointer from the name table or add it to table if new /// </summary> /// <param name="table"></param> /// <param name="array"></param> /// <returns></returns> public static string GetOrAdd(this XmlNameTable table, string array) { var s = table.Get(array); if (s == null) { return(table.Add(array)); } return(s); }
internal string GeneratePrefix(string format) { string prefix; do { prefix = string.Format(CultureInfo.InvariantCulture, format, _prefixIndex++); } while (_nameTable.Get(prefix) != null); return(_nameTable.Add(prefix)); }
public SchemaNames( XmlNameTable nameTable ) { this.nameTable = nameTable; NsDataType = nameTable.Add(XmlReservedNs.NsDataType); NsDataTypeAlias = nameTable.Add(XmlReservedNs.NsDataTypeAlias); NsDataTypeOld = nameTable.Add(XmlReservedNs.NsDataTypeOld); NsXml = nameTable.Add(XmlReservedNs.NsXml); NsXmlNs = nameTable.Add(XmlReservedNs.NsXmlNs); NsXdr = nameTable.Add(XmlReservedNs.NsXdr); NsXdrAlias = nameTable.Add(XmlReservedNs.NsXdrAlias); NsXs = nameTable.Add(XmlReservedNs.NsXs); NsXsi = nameTable.Add(XmlReservedNs.NsXsi); XsiType = nameTable.Add("type"); XsiNil = nameTable.Add("nil"); XsiSchemaLocation = nameTable.Add("schemaLocation"); XsiNoNamespaceSchemaLocation = nameTable.Add("noNamespaceSchemaLocation"); XsdSchema = nameTable.Add("schema"); XdrSchema = nameTable.Add("Schema"); QnPCData = new XmlQualifiedName( nameTable.Add("#PCDATA") ); QnXml = new XmlQualifiedName( nameTable.Add("xml") ); QnXmlNs = new XmlQualifiedName( nameTable.Add("xmlns"), NsXmlNs ); QnDtDt = new XmlQualifiedName( nameTable.Add("dt"), NsDataType ); QnXmlLang= new XmlQualifiedName( nameTable.Add("lang"), NsXml); // Empty namespace QnName = new XmlQualifiedName( nameTable.Add("name") ); QnType = new XmlQualifiedName( nameTable.Add("type") ); QnMaxOccurs = new XmlQualifiedName( nameTable.Add("maxOccurs") ); QnMinOccurs = new XmlQualifiedName( nameTable.Add("minOccurs") ); QnInfinite = new XmlQualifiedName( nameTable.Add("*") ); QnModel = new XmlQualifiedName( nameTable.Add("model") ); QnOpen = new XmlQualifiedName( nameTable.Add("open") ); QnClosed = new XmlQualifiedName( nameTable.Add("closed") ); QnContent = new XmlQualifiedName( nameTable.Add("content") ); QnMixed = new XmlQualifiedName( nameTable.Add("mixed") ); QnEmpty = new XmlQualifiedName( nameTable.Add("empty") ); QnEltOnly = new XmlQualifiedName( nameTable.Add("eltOnly") ); QnTextOnly = new XmlQualifiedName( nameTable.Add("textOnly") ); QnOrder = new XmlQualifiedName( nameTable.Add("order") ); QnSeq = new XmlQualifiedName( nameTable.Add("seq") ); QnOne = new XmlQualifiedName( nameTable.Add("one") ); QnMany = new XmlQualifiedName( nameTable.Add("many") ); QnRequired = new XmlQualifiedName( nameTable.Add("required") ); QnYes = new XmlQualifiedName( nameTable.Add("yes") ); QnNo = new XmlQualifiedName( nameTable.Add("no") ); QnString = new XmlQualifiedName( nameTable.Add("string") ); QnID = new XmlQualifiedName( nameTable.Add("id") ); QnIDRef = new XmlQualifiedName( nameTable.Add("idref") ); QnIDRefs = new XmlQualifiedName( nameTable.Add("idrefs") ); QnEntity = new XmlQualifiedName( nameTable.Add("entity") ); QnEntities = new XmlQualifiedName( nameTable.Add("entities") ); QnNmToken = new XmlQualifiedName( nameTable.Add("nmtoken") ); QnNmTokens = new XmlQualifiedName( nameTable.Add("nmtokens") ); QnEnumeration = new XmlQualifiedName( nameTable.Add("enumeration") ); QnDefault = new XmlQualifiedName( nameTable.Add("default") ); //For XSD Schema QnTargetNamespace = new XmlQualifiedName( nameTable.Add("targetNamespace") ); QnVersion = new XmlQualifiedName( nameTable.Add("version") ); QnFinalDefault = new XmlQualifiedName( nameTable.Add("finalDefault") ); QnBlockDefault = new XmlQualifiedName( nameTable.Add("blockDefault") ); QnFixed = new XmlQualifiedName( nameTable.Add("fixed") ); QnAbstract = new XmlQualifiedName( nameTable.Add("abstract") ); QnBlock = new XmlQualifiedName( nameTable.Add("block") ); QnSubstitutionGroup = new XmlQualifiedName( nameTable.Add("substitutionGroup") ); QnFinal = new XmlQualifiedName( nameTable.Add("final") ); QnNillable = new XmlQualifiedName( nameTable.Add("nillable") ); QnRef = new XmlQualifiedName( nameTable.Add("ref") ); QnBase = new XmlQualifiedName( nameTable.Add("base") ); QnDerivedBy = new XmlQualifiedName( nameTable.Add("derivedBy") ); QnNamespace = new XmlQualifiedName( nameTable.Add("namespace") ); QnProcessContents = new XmlQualifiedName( nameTable.Add("processContents") ); QnRefer = new XmlQualifiedName( nameTable.Add("refer") ); QnPublic = new XmlQualifiedName( nameTable.Add("public") ); QnSystem = new XmlQualifiedName( nameTable.Add("system") ); QnSchemaLocation = new XmlQualifiedName( nameTable.Add("schemaLocation") ); QnValue = new XmlQualifiedName( nameTable.Add("value") ); QnUse = new XmlQualifiedName( nameTable.Add("use") ); QnForm = new XmlQualifiedName( nameTable.Add("form") ); QnAttributeFormDefault = new XmlQualifiedName( nameTable.Add("attributeFormDefault") ); QnElementFormDefault = new XmlQualifiedName( nameTable.Add("elementFormDefault") ); QnSource = new XmlQualifiedName( nameTable.Add("source") ); QnMemberTypes = new XmlQualifiedName( nameTable.Add("memberTypes")); QnItemType = new XmlQualifiedName( nameTable.Add("itemType")); QnXPath = new XmlQualifiedName( nameTable.Add("xpath")); // XDR namespace QnXdrSchema = new XmlQualifiedName( XdrSchema, NsXdr ); QnXdrElementType = new XmlQualifiedName( nameTable.Add("ElementType"), NsXdr ); QnXdrElement = new XmlQualifiedName( nameTable.Add("element"), NsXdr ); QnXdrGroup = new XmlQualifiedName( nameTable.Add("group"), NsXdr ); QnXdrAttributeType = new XmlQualifiedName( nameTable.Add("AttributeType"), NsXdr ); QnXdrAttribute = new XmlQualifiedName( nameTable.Add("attribute"), NsXdr ); QnXdrDataType = new XmlQualifiedName( nameTable.Add("datatype"), NsXdr ); QnXdrDescription = new XmlQualifiedName( nameTable.Add("description"), NsXdr ); QnXdrExtends = new XmlQualifiedName( nameTable.Add("extends"), NsXdr ); // XDR alias namespace QnXdrAliasSchema = new XmlQualifiedName( nameTable.Add("Schema"), NsDataTypeAlias ); // DataType namespace QnDtType = new XmlQualifiedName( nameTable.Add("type"), NsDataType ); QnDtValues = new XmlQualifiedName( nameTable.Add("values"), NsDataType ); QnDtMaxLength = new XmlQualifiedName( nameTable.Add("maxLength"), NsDataType ); QnDtMinLength = new XmlQualifiedName( nameTable.Add("minLength"), NsDataType ); QnDtMax = new XmlQualifiedName( nameTable.Add("max"), NsDataType ); QnDtMin = new XmlQualifiedName( nameTable.Add("min"), NsDataType ); QnDtMinExclusive = new XmlQualifiedName( nameTable.Add("minExclusive"), NsDataType ); QnDtMaxExclusive = new XmlQualifiedName( nameTable.Add("maxExclusive"), NsDataType ); // XSD namespace QnXsdSchema = new XmlQualifiedName( XsdSchema, NsXs ); QnXsdAnnotation= new XmlQualifiedName( nameTable.Add("annotation"), NsXs ); QnXsdInclude= new XmlQualifiedName( nameTable.Add("include"), NsXs ); QnXsdImport= new XmlQualifiedName( nameTable.Add("import"), NsXs ); QnXsdElement = new XmlQualifiedName( nameTable.Add("element"), NsXs ); QnXsdAttribute = new XmlQualifiedName( nameTable.Add("attribute"), NsXs ); QnXsdAttributeGroup = new XmlQualifiedName( nameTable.Add("attributeGroup"), NsXs ); QnXsdAnyAttribute = new XmlQualifiedName( nameTable.Add("anyAttribute"), NsXs ); QnXsdGroup = new XmlQualifiedName( nameTable.Add("group"), NsXs ); QnXsdAll = new XmlQualifiedName( nameTable.Add("all"), NsXs ); QnXsdChoice = new XmlQualifiedName( nameTable.Add("choice"), NsXs ); QnXsdSequence = new XmlQualifiedName( nameTable.Add("sequence"), NsXs ); QnXsdAny = new XmlQualifiedName( nameTable.Add("any"), NsXs ); QnXsdNotation = new XmlQualifiedName( nameTable.Add("notation"), NsXs ); QnXsdSimpleType = new XmlQualifiedName( nameTable.Add("simpleType"), NsXs ); QnXsdComplexType = new XmlQualifiedName( nameTable.Add("complexType"), NsXs ); QnXsdUnique = new XmlQualifiedName( nameTable.Add("unique"), NsXs ); QnXsdKey = new XmlQualifiedName( nameTable.Add("key"), NsXs ); QnXsdKeyRef = new XmlQualifiedName( nameTable.Add("keyref"), NsXs ); QnXsdSelector= new XmlQualifiedName( nameTable.Add("selector"), NsXs ); QnXsdField= new XmlQualifiedName( nameTable.Add("field"), NsXs ); QnXsdMinExclusive= new XmlQualifiedName( nameTable.Add("minExclusive"), NsXs ); QnXsdMinInclusive= new XmlQualifiedName( nameTable.Add("minInclusive"), NsXs ); QnXsdMaxInclusive= new XmlQualifiedName( nameTable.Add("maxInclusive"), NsXs ); QnXsdMaxExclusive= new XmlQualifiedName( nameTable.Add("maxExclusive"), NsXs ); QnXsdTotalDigits= new XmlQualifiedName( nameTable.Add("totalDigits"), NsXs ); QnXsdFractionDigits= new XmlQualifiedName( nameTable.Add("fractionDigits"), NsXs ); QnXsdLength= new XmlQualifiedName( nameTable.Add("length"), NsXs ); QnXsdMinLength= new XmlQualifiedName( nameTable.Add("minLength"), NsXs ); QnXsdMaxLength= new XmlQualifiedName( nameTable.Add("maxLength"), NsXs ); QnXsdEnumeration= new XmlQualifiedName( nameTable.Add("enumeration"), NsXs ); QnXsdPattern= new XmlQualifiedName( nameTable.Add("pattern"), NsXs ); QnXsdDocumentation= new XmlQualifiedName( nameTable.Add("documentation"), NsXs ); QnXsdAppinfo= new XmlQualifiedName( nameTable.Add("appinfo"), NsXs ); QnXsdComplexContent= new XmlQualifiedName( nameTable.Add("complexContent"), NsXs ); QnXsdSimpleContent= new XmlQualifiedName( nameTable.Add("simpleContent"), NsXs ); QnXsdRestriction= new XmlQualifiedName( nameTable.Add("restriction"), NsXs ); QnXsdExtension= new XmlQualifiedName( nameTable.Add("extension"), NsXs ); QnXsdUnion= new XmlQualifiedName( nameTable.Add("union"), NsXs ); QnXsdList= new XmlQualifiedName( nameTable.Add("list"), NsXs ); QnXsdWhiteSpace= new XmlQualifiedName( nameTable.Add("whiteSpace"), NsXs ); QnXsdRedefine= new XmlQualifiedName( nameTable.Add("redefine"), NsXs ); QnXsdAnyType= new XmlQualifiedName( nameTable.Add("anyType"), NsXs ); //Create token to Qname table CreateTokenToQNameTable(); }
internal void Atomize(XmlNameTable nameTable) { name = nameTable.Add(name); if (ns != string.Empty) { ns = nameTable.Add(ns); } }
internal static XmlQualifiedName Parse(string s, XmlNameTable nameTable, XmlNamespaceManager nsmgr, out string prefix) { int colonPos = s.IndexOf(':'); if (colonPos > 0) { char[] text = s.ToCharArray(); prefix = nameTable.Add(text, 0, colonPos); XmlConvert.VerifyNCName(prefix); s = nameTable.Add(text, colonPos + 1, text.Length - colonPos - 1); } else { prefix = string.Empty; s = nameTable.Add(s); } XmlConvert.VerifyNCName(s); string uri = nsmgr.LookupNamespace(prefix); if (uri == null) { throw new XmlException(Res.Xml_UnknownNs, prefix); } return new XmlQualifiedName(s, uri); }
private void Load( XmlReader reader ) { nt = reader.NameTable; baseURI = reader.BaseURI; Debug.Assert(baseURI != null, "uri can't be null, isn't it?"); xmlnsUri = (nt != null ? nt.Add(XmlReservedNs.NsXmlNs) : XmlReservedNs.NsXmlNs); PositionInfo positionInfo = PositionInfo.GetPositionInfo(reader); if ( reader.ReadState == ReadState.Initial ) { if ( !reader.Read() ) return; } ReadChildNodes( root, baseURI, reader, positionInfo ); }