本文整理匯總了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;
}
示例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);
}
示例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);
}
示例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);
}
}
示例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;
}
示例6: BaseIterator
internal BaseIterator (BaseIterator other)
{
_nsm = other._nsm;
position = other.position;
}
示例7: NullIterator
public NullIterator (XPathNavigator nav, NSResolver nsm) : base (nav, nsm) {}
示例8: WrapperIterator
public WrapperIterator (XPathNodeIterator iter, NSResolver nsm)
: base (nsm)
{
this.iter = iter;
}
示例9: StringValueType
internal override ValueType ParseValueType (string s, XmlNameTable nameTable, NSResolver nsmgr)
{
return new StringValueType (ParseValue (s, nameTable, nsmgr) as string);
}
示例10: ParseValueType
internal override ValueType ParseValueType (string s, XmlNameTable nameTable, NSResolver nsmgr)
{
return DateTime.ParseExact (Normalize(s), "---dd", null);
}
示例11: UriValueType
internal override ValueType ParseValueType (string s, XmlNameTable nameTable, NSResolver nsmgr)
{
return new UriValueType ((XmlSchemaUri) ParseValue (s, nameTable, nsmgr));
}
示例12: ParseValue
public override object ParseValue (string s,
XmlNameTable nameTable, NSResolver nsmgr)
{
return new XmlSchemaUri (Normalize (s));
}
示例13: QNameValueType
internal override ValueType ParseValueType (string s, XmlNameTable nameTable, NSResolver nsmgr)
{
return new QNameValueType (ParseValue (s, nameTable, nsmgr) as XmlQualifiedName);
}
示例14: WriteCompact
public void WriteCompact (TextWriter writer, NSResolver res)
{
WriteCompact (new RncWriter (writer, res));
}
示例15: ListIterator
public ListIterator (IList list, NSResolver nsm) : base (nsm)
{
_list = list;
}