當前位置: 首頁>>代碼示例>>C#>>正文


C# Xml.XmlNameTable類代碼示例

本文整理匯總了C#中System.Xml.XmlNameTable的典型用法代碼示例。如果您正苦於以下問題:C# XmlNameTable類的具體用法?C# XmlNameTable怎麽用?C# XmlNameTable使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


XmlNameTable類屬於System.Xml命名空間,在下文中一共展示了XmlNameTable類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: XmlParserContext

 /// <include file='doc\XmlParserContext.uex' path='docs/doc[@for="XmlParserContext.XmlParserContext3"]/*' />
 public XmlParserContext(XmlNameTable nt, XmlNamespaceManager nsMgr, String docTypeName,
                   String pubId, String sysId, String internalSubset, String baseURI,
                   String xmlLang, XmlSpace xmlSpace, Encoding enc)
 {
     
     if (nsMgr != null) {
         if (nt == null) {
             _nt = nsMgr.NameTable;
         }
         else {
             if ( (object)nt != (object)  nsMgr.NameTable ) {
                 throw new XmlException(Res.Xml_NotSameNametable);
             }
             _nt = nt;
         }
     }
     else {
         _nt = nt;
     }
     
     _nsMgr              = nsMgr;
     _docTypeName        = (null == docTypeName ? String.Empty : docTypeName);
     _pubId              = (null == pubId ? String.Empty : pubId);
     _sysId              = (null == sysId ? String.Empty : sysId);
     _internalSubset     = (null == internalSubset ? String.Empty : internalSubset);
     _baseURI            = (null == baseURI ? String.Empty : baseURI);
     _xmlLang            = (null == xmlLang ? String.Empty : xmlLang);
     _xmlSpace           = xmlSpace;
     _encoding           = enc;
     
 }
開發者ID:ArildF,項目名稱:masters,代碼行數:32,代碼來源:xmlparsercontext.cs

示例2: XmlNamespaceManager

	// Constructor.
	public XmlNamespaceManager(XmlNameTable nameTable)
			{
				// Validate the parameters.
				if(nameTable == null)
				{
					throw new ArgumentNullException("nameTable");
				}

				// Record the name table for later.
				this.nameTable = nameTable;

				// Add special namespaces for "xml" and "xmlns".
				xmlCompareQuick = nameTable.Add("xml");
				xmlNsCompareQuick = nameTable.Add("xmlns");
				namespaces = new NamespaceInfo
					(xmlCompareQuick,
					 nameTable.Add(XmlDocument.xmlnsXml),
					 null);
				namespaces = new NamespaceInfo
					(xmlNsCompareQuick,
					 nameTable.Add(XmlDocument.xmlns),
					 namespaces);

				// Mark the position of the outermost scope level.
				namespaces = new NamespaceInfo(null, String.Empty, namespaces);
			}
開發者ID:jjenki11,項目名稱:blaze-chem-rendering,代碼行數:27,代碼來源:XmlNamespaceManager.cs

示例3: XmlCsvReader

 /// <summary>
 /// Construct an XmlCsvReader.
 /// </summary>
 /// <param name="input">The .csv input stream</param>
 /// <param name="baseUri">The base URI of the .csv.</param>
 /// <param name="nametable">The nametable to use for atomizing element names</param>
 public XmlCsvReader(Stream input, Encoding encoding, Uri baseUri, XmlNameTable nametable)
 {
     _baseUri = baseUri;
     _encoding = encoding;
     _csvReader = new CsvReader(input, encoding, 4096);
     _nt = nametable;
 }
開發者ID:Dronacharya-Org,項目名稱:Dronacharya,代碼行數:13,代碼來源:XmlCsvReader.cs

示例4: TryParseValue

 internal override Exception TryParseValue(string s, XmlNameTable nameTable, IXmlNamespaceResolver nsmgr, out object typedValue)
 {
     typedValue = null;
     Exception exception = DatatypeImplementation.binaryFacetsChecker.CheckLexicalFacets(ref s, this);
     if (exception == null)
     {
         byte[] buffer = null;
         try
         {
             buffer = XmlConvert.FromBinHexString(s, false);
         }
         catch (ArgumentException exception2)
         {
             return exception2;
         }
         catch (XmlException exception3)
         {
             return exception3;
         }
         exception = DatatypeImplementation.binaryFacetsChecker.CheckValueFacets(buffer, this);
         if (exception == null)
         {
             typedValue = buffer;
             return null;
         }
     }
     return exception;
 }
開發者ID:pritesh-mandowara-sp,項目名稱:DecompliedDotNetLibraries,代碼行數:28,代碼來源:Datatype_hexBinary.cs

示例5: SgmlDtd

 /// <summary>
 ///     Initialises a new instance of the <see cref="SgmlDtd" /> class.
 /// </summary>
 /// <param name="name">The name of the DTD.</param>
 /// <param name="nt">
 ///     The <see cref="XmlNameTable" /> is NOT used.
 /// </param>
 public SgmlDtd(string name, XmlNameTable nt) {
     this.m_name = name;
     this.m_elements = new Dictionary<string, ElementDecl>();
     this.m_pentities = new Dictionary<string, Entity>();
     this.m_entities = new Dictionary<string, Entity>();
     this.m_sb = new StringBuilder();
 }
開發者ID:roomaroo,項目名稱:coapp.powershell,代碼行數:14,代碼來源:SgmlDtd.cs

示例6: ParseValue

 public override object ParseValue(string s, XmlNameTable nameTable, IXmlNamespaceResolver nsmgr)
 {
     object obj2;
     if ((s == null) || (s.Length == 0))
     {
         throw new XmlSchemaException("Sch_EmptyAttributeValue", string.Empty);
     }
     if (nsmgr == null)
     {
         throw new ArgumentNullException("nsmgr");
     }
     try
     {
         string str;
         obj2 = XmlQualifiedName.Parse(s.Trim(), nsmgr, out str);
     }
     catch (XmlSchemaException exception)
     {
         throw exception;
     }
     catch (Exception exception2)
     {
         throw new XmlSchemaException(Res.GetString("Sch_InvalidValue", new object[] { s }), exception2);
     }
     return obj2;
 }
開發者ID:pritesh-mandowara-sp,項目名稱:DecompliedDotNetLibraries,代碼行數:26,代碼來源:Datatype_QNameXdr.cs

示例7: XmlLightNavigator

		private XmlLightNavigator(XmlNameTable names, XmlLightElement current, List<string> attrNames, int attribute)
		{
			_names = names;
			_current = current;
			_attrNames = attrNames;
			_attribute = attribute;
		}
開發者ID:modulexcite,項目名稱:CSharpTest.Net.Tools,代碼行數:7,代碼來源:XmlLightNavigator.cs

示例8: TryParseValue

 internal override Exception TryParseValue(string s, XmlNameTable nameTable, IXmlNamespaceResolver nsmgr, out object typedValue)
 {
     typedValue = null;
     if ((s == null) || (s.Length == 0))
     {
         return new XmlSchemaException("Sch_EmptyAttributeValue", string.Empty);
     }
     Exception exception = DatatypeImplementation.durationFacetsChecker.CheckLexicalFacets(ref s, this);
     if (exception == null)
     {
         XsdDuration duration;
         exception = XsdDuration.TryParse(s, XsdDuration.DurationType.YearMonthDuration, out duration);
         if (exception == null)
         {
             TimeSpan span;
             exception = duration.TryToTimeSpan(XsdDuration.DurationType.YearMonthDuration, out span);
             if (exception == null)
             {
                 exception = DatatypeImplementation.durationFacetsChecker.CheckValueFacets(span, this);
                 if (exception == null)
                 {
                     typedValue = span;
                     return null;
                 }
             }
         }
     }
     return exception;
 }
開發者ID:pritesh-mandowara-sp,項目名稱:DecompliedDotNetLibraries,代碼行數:29,代碼來源:Datatype_yearMonthDuration.cs

示例9: XNodeReader

 internal XNodeReader(XNode node, XmlNameTable nameTable, ReaderOptions options)
 {
     this.source = node;
     this.root = node;
     this.nameTable = (nameTable != null) ? nameTable : CreateNameTable();
     this.omitDuplicateNamespaces = (options & ReaderOptions.OmitDuplicateNamespaces) != ReaderOptions.None;
 }
開發者ID:pritesh-mandowara-sp,項目名稱:DecompliedDotNetLibraries,代碼行數:7,代碼來源:XNodeReader.cs

示例10: TryParseValue

 internal override Exception TryParseValue(string s, XmlNameTable nameTable, IXmlNamespaceResolver nsmgr, out object typedValue)
 {
     typedValue = null;
     if ((s == null) || (s.Length == 0))
     {
         return new XmlSchemaException("Sch_EmptyAttributeValue", string.Empty);
     }
     Exception exception = DatatypeImplementation.qnameFacetsChecker.CheckLexicalFacets(ref s, this);
     if (exception == null)
     {
         XmlQualifiedName name = null;
         try
         {
             string str;
             name = XmlQualifiedName.Parse(s, nsmgr, out str);
         }
         catch (ArgumentException exception2)
         {
             return exception2;
         }
         catch (XmlException exception3)
         {
             return exception3;
         }
         exception = DatatypeImplementation.qnameFacetsChecker.CheckValueFacets(name, this);
         if (exception == null)
         {
             typedValue = name;
             return null;
         }
     }
     return exception;
 }
開發者ID:pritesh-mandowara-sp,項目名稱:DecompliedDotNetLibraries,代碼行數:33,代碼來源:Datatype_NOTATION.cs

示例11: AddColumnSchema

 private bool AddColumnSchema(XmlNameTable nameTable, DataColumn col, XmlNodeIdHashtable columns)
 {
     string array = XmlConvert.EncodeLocalName(col.ColumnName);
     string localName = nameTable.Get(array);
     if (localName == null)
     {
         localName = nameTable.Add(array);
     }
     col.encodedColumnName = localName;
     string namespaceURI = nameTable.Get(col.Namespace);
     if (namespaceURI == null)
     {
         namespaceURI = nameTable.Add(col.Namespace);
     }
     else if (col._columnUri != null)
     {
         col._columnUri = namespaceURI;
     }
     XmlNodeIdentety identety = new XmlNodeIdentety(localName, namespaceURI);
     columns[identety] = col;
     if (col.ColumnName.StartsWith("xml", StringComparison.OrdinalIgnoreCase))
     {
         this.HandleSpecialColumn(col, nameTable, columns);
     }
     return true;
 }
開發者ID:pritesh-mandowara-sp,項目名稱:DecompliedDotNetLibraries,代碼行數:26,代碼來源:XmlToDatasetMap.cs

示例12: XmlPathProcessor

		public XmlPathProcessor(IList<XmlMatch> matchList, Action<XmlReader> action,
			XmlNameTable readerNameTable)
		{
			Guard.ArgumentNotNull(readerNameTable, "readerNameTable");

			Initialize(matchList, action, new XmlNamespaceManager(readerNameTable));
		}
開發者ID:zanyants,項目名稱:mvp.xml,代碼行數:7,代碼來源:XmlPathProcessor.cs

示例13: XmlSchemaValidator

 public XmlSchemaValidator(XmlNameTable nameTable, XmlSchemaSet schemas, IXmlNamespaceResolver namespaceResolver, XmlSchemaValidationFlags validationFlags)
 {
     if (nameTable == null)
     {
         throw new ArgumentNullException("nameTable");
     }
     if (schemas == null)
     {
         throw new ArgumentNullException("schemas");
     }
     if (namespaceResolver == null)
     {
         throw new ArgumentNullException("namespaceResolver");
     }
     this.nameTable = nameTable;
     this.nsResolver = namespaceResolver;
     this.validationFlags = validationFlags;
     if (((validationFlags & XmlSchemaValidationFlags.ProcessInlineSchema) != XmlSchemaValidationFlags.None) || ((validationFlags & XmlSchemaValidationFlags.ProcessSchemaLocation) != XmlSchemaValidationFlags.None))
     {
         this.schemaSet = new XmlSchemaSet(nameTable);
         this.schemaSet.ValidationEventHandler += schemas.GetEventHandler();
         this.schemaSet.CompilationSettings = schemas.CompilationSettings;
         this.schemaSet.XmlResolver = schemas.GetResolver();
         this.schemaSet.Add(schemas);
         this.validatedNamespaces = new Hashtable();
     }
     else
     {
         this.schemaSet = schemas;
     }
     this.Init();
 }
開發者ID:pritesh-mandowara-sp,項目名稱:DecompliedDotNetLibraries,代碼行數:32,代碼來源:XmlSchemaValidator.cs

示例14: RecordBuilder

 internal RecordBuilder(RecordOutput output, XmlNameTable nameTable) {
     Debug.Assert(output != null);
     this.output    = output;
     this.nameTable = nameTable != null ? nameTable : new NameTable();
     this.atoms     = new OutKeywords(this.nameTable);
     this.scopeManager   = new OutputScopeManager(this.nameTable, this.atoms);
 }
開發者ID:uQr,項目名稱:referencesource,代碼行數:7,代碼來源:RecordBuilder.cs

示例15: XmlTextReader

	protected XmlTextReader(XmlNameTable nt)
			{
				if(nt == null)
				{
					throw new ArgumentNullException("nt");
				}

				namespaces = true;
				normalize = false;
				depth = 0;
				readState = ReadState.Initial;
				whitespace = WhitespaceHandling.All;

				xmlBaseName = nt.Add("xml:base");
				xmlLangName = nt.Add("xml:lang");
				xmlSpaceName = nt.Add("xml:space");
				xmlNSPrefix = nt.Add("xmlns");
				xmlCompareQuick = nt.Add("xml");

				contextSupport = false;
				hasRoot = true;
				incDepth = false;
				xmlPopScope = false;
				xmlnsPopScope = false;
				sawPreserve = -1;
				state = State.XmlDeclaration;
				elementNames = new Stack();
				nodes = new NodeManager(nt, new ErrorHandler(Error));
				input = new XmlParserInput
					(null, nt, new EOFHandler(HandleEOF), new ErrorHandler(Error));
				context = new XmlParserContext
					(nt, new XmlNamespaceManager(nt), String.Empty, XmlSpace.None);
				resolver = new XmlUrlResolver();
				dtdReader = new XmlDTDReader(context);
			}
開發者ID:jjenki11,項目名稱:blaze-chem-rendering,代碼行數:35,代碼來源:XmlTextReader.cs


注:本文中的System.Xml.XmlNameTable類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。