当前位置: 首页>>代码示例>>C#>>正文


C# Xml.IXmlNamespaceResolver类代码示例

本文整理汇总了C#中System.Xml.IXmlNamespaceResolver的典型用法代码示例。如果您正苦于以下问题:C# IXmlNamespaceResolver类的具体用法?C# IXmlNamespaceResolver怎么用?C# IXmlNamespaceResolver使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


IXmlNamespaceResolver类属于System.Xml命名空间,在下文中一共展示了IXmlNamespaceResolver类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GetNameTable

		private XmlNameTable GetNameTable (NSResolver nss1, NSResolver nss2)
		{
			XmlNameTable nt = null;
			if (nss1 is XmlNamespaceManager)
				nt = ((XmlNamespaceManager) nss1).NameTable;
			if (nss2 is XmlNamespaceManager)
				nt = ((XmlNamespaceManager) nss2).NameTable;
			if (nt == null)
				nt = new NameTable ();
			return nt;
		}
开发者ID:runefs,项目名称:Marvin,代码行数:11,代码来源:RncWriter.cs

示例2: RncWriter

		public RncWriter (TextWriter writer, NSResolver structureNamespaces, NSResolver dataNamespaces)
		{
			this.w = writer;
			this.nsmgr = structureNamespaces;
			this.datansmgr = dataNamespaces;
			XmlNameTable nt = GetNameTable (nsmgr, datansmgr);
			if (nsmgr == null)
				nsmgr = new XmlNamespaceManager (nt);
			if (datansmgr == null)
				datansmgr = new XmlNamespaceManager (nt);
		}
开发者ID:runefs,项目名称:Marvin,代码行数:11,代码来源:RncWriter.cs

示例3: EvaluateBoolean

		internal bool EvaluateBoolean (XPathExpression expr, XPathNodeIterator context, NSResolver ctx)
		{
			CompiledExpression cexpr = (CompiledExpression) expr;
			if (ctx == null)
				ctx = cexpr.NamespaceManager;
			
			if (context == null)
				context = new NullIterator (this, cexpr.NamespaceManager);
			BaseIterator iterContext = ToBaseIterator (context, ctx);
			iterContext.NamespaceManager = ctx;
			return cexpr.EvaluateBoolean (iterContext);
		}
开发者ID:calumjiao,项目名称:Mono-Class-Libraries,代码行数:12,代码来源:XPathNavigator.cs

示例4: ProcessMatch

		// In this method, attributes are ignored.
		// It might throw Exception.
		public void ProcessMatch (bool isAttribute, ArrayList qnameStack, object sender, XmlNameTable nameTable, string sourceUri, object schemaType, NSResolver nsResolver, IXmlLineInfo li, int depth, string attrName, string attrNS, object attrValue, bool isXsiNil, ArrayList currentKeyFieldConsumers)
		{
			for (int i = 0; i < KeyFields.Count; i++) {
				XsdKeyEntryField keyField = KeyFields [i];
				XsdIdentityPath path = keyField.Matches (isAttribute, sender, nameTable, qnameStack, sourceUri, schemaType, nsResolver, li, depth, attrName, attrNS, attrValue);
				if (path == null)
					continue;

				if (keyField.FieldFound) {
					// HACK: This is not logical by nature. Attributes never be cosuming,
					// so I used it as a temporary mark to sign it is *just* validated now.
					if (!keyField.Consuming)
						throw new ValException ("Two or more matching field was found.",
							sender, sourceUri, this.OwnerSequence.SourceSchemaIdentity, null);
					else
						keyField.Consuming = false;
				}
				if (keyField.Consumed) 
					continue;

				if (isXsiNil && !keyField.SetIdentityField (Guid.Empty, true, XsdAnySimpleType.Instance, depth, li))
					throw new ValException ("Two or more identical field was found.", sender, sourceUri, OwnerSequence.SourceSchemaIdentity, null);
				XmlSchemaComplexType ct = schemaType as XmlSchemaComplexType;
				if (ct != null && 
					(ct.ContentType == XmlSchemaContentType.Empty || ct.ContentType == XmlSchemaContentType.ElementOnly) && 
					schemaType != XmlSchemaComplexType.AnyType)
					throw new ValException ("Specified schema type is complex type, which is not allowed for identity constraints.", sender, sourceUri, OwnerSequence.SourceSchemaIdentity, null);
				keyField.FieldFound = true;
				keyField.FieldFoundPath = path;
				keyField.FieldFoundDepth = depth;
				keyField.Consuming = true;
				if (li != null && li.HasLineInfo ()) {
					keyField.FieldHasLineInfo = true;
					keyField.FieldLineNumber = li.LineNumber;
					keyField.FieldLinePosition = li.LinePosition;
				}
				currentKeyFieldConsumers.Add (keyField);
			}
		}
开发者ID:nobled,项目名称:mono,代码行数:41,代码来源:XsdIdentityState.cs

示例5: Matches

		// if matchesAttr then check attributes; otherwise check elements.
		internal XsdIdentityPath Matches (bool matchesAttr, object sender, XmlNameTable nameTable, ArrayList qnameStack, string sourceUri, object schemaType, NSResolver nsResolver, IXmlLineInfo lineInfo, int depth, string attrName, string attrNS, object attrValue)
		{
			XsdIdentityPath matchedAttrPath = null;

			for (int i = 0; i < field.Paths.Length; i++) {
				XsdIdentityPath path = field.Paths [i];
				bool isAttribute = path.IsAttribute;
				if (matchesAttr != isAttribute)
					continue;
				XsdIdentityStep step;
				if (path.IsAttribute) {
					step = path.OrderedSteps [path.OrderedSteps.Length - 1];
					bool match = false;
					if (step.IsAnyName || step.NsName != null) {
						if (step.IsAnyName || attrNS == step.NsName)
							match = true;
					}
					else if (step.Name == attrName && step.Namespace == attrNS)
						match = true;
					if (!match)
						continue;
					// first -1 is to reduce attr path step, next -1 is to reduce Attribute's depth in XmlReader.
					if (entry.StartDepth + (path.OrderedSteps.Length - 1) != depth - 1)
						continue; // matched at different nest level
					matchedAttrPath = path;
				}
				if (FieldFound && (depth > this.FieldFoundDepth && this.FieldFoundPath == path))
					continue; // don't return; other fields might hit errorneously.

				// Only "." hits.
				if (path.OrderedSteps.Length == 0) {
					if (depth == entry.StartDepth)
						return path;
					else
						continue;
				}
				// It does not hit as yet (too shallow to hit).
				if (depth - entry.StartDepth < path.OrderedSteps.Length - 1)
					continue;

				int iter = path.OrderedSteps.Length;
				if (isAttribute)
					iter--;
				if (path.Descendants && depth < entry.StartDepth + iter)
					continue;
				else if (!path.Descendants && depth != entry.StartDepth + iter)
					continue;

				iter--;

				for (; iter >= 0; iter--) {
					step = path.OrderedSteps [iter];
					if (step.IsCurrent || step.IsAnyName)
						continue;
					XmlQualifiedName qname = (XmlQualifiedName) qnameStack [entry.StartDepth + iter + (isAttribute ? 0 : 1)];
					if (step.NsName != null && qname.Namespace == step.NsName)
						continue;
					if ((step.Name == "*" || step.Name == qname.Name) &&
						step.Namespace == qname.Namespace)
						continue;
					else
						break;
				}
				if (iter >= 0)	// i.e. did not match against the path.
					continue;

				if (!matchesAttr)
					return path;
			}
			if (matchedAttrPath != null) {
				this.FillAttributeFieldValue (sender, nameTable, sourceUri, schemaType, nsResolver, attrValue, lineInfo, depth);
				if (this.Identity != null)
					return matchedAttrPath;
			}
			return null;
		}
开发者ID:nobled,项目名称:mono,代码行数:77,代码来源:XsdIdentityState.cs

示例6: BaseIterator

		internal BaseIterator (BaseIterator other)
		{
			_nsm = other._nsm;
			position = other.position;
		}
开发者ID:cyplo,项目名称:mono,代码行数:5,代码来源:Iterator.cs

示例7: NullIterator

		public NullIterator (XPathNavigator nav, NSResolver nsm) : base (nav, nsm) {}
开发者ID:cyplo,项目名称:mono,代码行数:1,代码来源:Iterator.cs

示例8: WrapperIterator

		public WrapperIterator (XPathNodeIterator iter, NSResolver nsm)
			: base (nsm)
		{
			this.iter = iter;
		}
开发者ID:cyplo,项目名称:mono,代码行数:5,代码来源:Iterator.cs

示例9: StringValueType

		internal override ValueType ParseValueType (string s, XmlNameTable nameTable, NSResolver nsmgr) 
		{
			return new StringValueType (ParseValue (s, nameTable, nsmgr) as string);
		}
开发者ID:nobled,项目名称:mono,代码行数:4,代码来源:BuiltInDatatype.cs

示例10: ParseValueType

		internal override ValueType ParseValueType (string s, XmlNameTable nameTable, NSResolver nsmgr) 
		{
			return DateTime.ParseExact (Normalize(s), "---dd", null);
		}
开发者ID:nobled,项目名称:mono,代码行数:4,代码来源:BuiltInDatatype.cs

示例11: UriValueType

		internal override ValueType ParseValueType (string s, XmlNameTable nameTable, NSResolver nsmgr) 
		{
			return new UriValueType ((XmlSchemaUri) ParseValue (s, nameTable, nsmgr));
		}
开发者ID:nobled,项目名称:mono,代码行数:4,代码来源:BuiltInDatatype.cs

示例12: ParseValue

		public override object ParseValue (string s,
			XmlNameTable nameTable, NSResolver nsmgr)
		{
			return new XmlSchemaUri (Normalize (s));
		}
开发者ID:nobled,项目名称:mono,代码行数:5,代码来源:BuiltInDatatype.cs

示例13: QNameValueType

		internal override ValueType ParseValueType (string s, XmlNameTable nameTable, NSResolver nsmgr) 
		{
			return new QNameValueType (ParseValue (s, nameTable, nsmgr) as XmlQualifiedName);
		}
开发者ID:nobled,项目名称:mono,代码行数:4,代码来源:BuiltInDatatype.cs

示例14: WriteCompact

		public void WriteCompact (TextWriter writer, NSResolver res)
		{
			WriteCompact (new RncWriter (writer, res));
		}
开发者ID:Profit0004,项目名称:mono,代码行数:4,代码来源:RelaxngPattern.cs

示例15: ListIterator

		public ListIterator (IList list, NSResolver nsm) : base (nsm)
		{
			_list = list;
		}
开发者ID:cyplo,项目名称:mono,代码行数:4,代码来源:Iterator.cs


注:本文中的System.Xml.IXmlNamespaceResolver类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。