本文整理汇总了C#中System.Xml.Schema.XmlSchemaObjectTable类的典型用法代码示例。如果您正苦于以下问题:C# XmlSchemaObjectTable类的具体用法?C# XmlSchemaObjectTable怎么用?C# XmlSchemaObjectTable使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
XmlSchemaObjectTable类属于System.Xml.Schema命名空间,在下文中一共展示了XmlSchemaObjectTable类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddToTable
public static void AddToTable (XmlSchemaObjectTable table, XmlSchemaObject obj,
XmlQualifiedName qname, ValidationEventHandler h)
{
if (table.Contains (qname)) {
// FIXME: This logic unexpectedly allows
// one redefining item and two or more redefining items.
// FIXME: redefining item is not simple replacement,
// but much more complex stuff.
if (obj.isRedefineChild) { // take precedence.
if (obj.redefinedObject != null)
obj.error (h, String.Format ("Named item {0} was already contained in the schema object table.", qname));
else
obj.redefinedObject = table [qname];
table.Set (qname, obj);
}
else if (table [qname].isRedefineChild) {
if (table [qname].redefinedObject != null)
obj.error (h, String.Format ("Named item {0} was already contained in the schema object table.", qname));
else
table [qname].redefinedObject = obj;
return; // never add to the table.
}
else if (StrictMsCompliant) {
table.Set (qname, obj);
}
else
obj.error (h, String.Format ("Named item {0} was already contained in the schema object table. {1}",
qname, "Consider setting MONO_STRICT_MS_COMPLIANT to 'yes' to mimic MS implementation."));
}
else
table.Set (qname, obj);
}
示例2: XmlSchemaRedefine
public XmlSchemaRedefine()
{
attributeGroups = new XmlSchemaObjectTable();
groups = new XmlSchemaObjectTable();
items = new XmlSchemaObjectCollection(this);
schemaTypes = new XmlSchemaObjectTable();
}
示例3: AddTableToSchema
// Adds all items in the XmlSchemaObjectTable to the specified XmlSchema
//
private static void AddTableToSchema(XmlSchema outSch, XmlSchemaObjectTable table)
{
var e = table.GetEnumerator();
while (e.MoveNext())
{
outSch.Items.Add((XmlSchemaObject)e.Value);
}
}
示例4: Compiler
public Compiler(XmlNameTable nameTable, ValidationEventHandler eventHandler, XmlSchema schemaForSchema, XmlSchemaCompilationSettings compilationSettings) : base(nameTable, null, eventHandler, compilationSettings)
{
this.attributes = new XmlSchemaObjectTable();
this.attributeGroups = new XmlSchemaObjectTable();
this.elements = new XmlSchemaObjectTable();
this.schemaTypes = new XmlSchemaObjectTable();
this.groups = new XmlSchemaObjectTable();
this.notations = new XmlSchemaObjectTable();
this.examplars = new XmlSchemaObjectTable();
this.identityConstraints = new XmlSchemaObjectTable();
this.complexTypeStack = new Stack();
this.schemasToCompile = new Hashtable();
this.importedSchemas = new Hashtable();
this.schemaForSchema = schemaForSchema;
}
示例5: VerifySchemaValid
internal override void VerifySchemaValid(XmlSchemaObjectTable notations, XmlSchemaObject caller)
{
for (Datatype_NOTATION e_notation = this; e_notation != null; e_notation = (Datatype_NOTATION) e_notation.Base)
{
if ((e_notation.Restriction != null) && ((e_notation.Restriction.Flags & RestrictionFlags.Enumeration) != 0))
{
for (int i = 0; i < e_notation.Restriction.Enumeration.Count; i++)
{
XmlQualifiedName name = (XmlQualifiedName) e_notation.Restriction.Enumeration[i];
if (!notations.Contains(name))
{
throw new XmlSchemaException("Sch_NotationRequired", caller);
}
}
return;
}
}
throw new XmlSchemaException("Sch_NotationRequired", caller);
}
示例6: DumpAttributes
private string DumpAttributes(XmlSchemaObjectTable attributeUses, XmlSchemaAnyAttribute attributeWildcard) {
StringBuilder sb = new StringBuilder();
sb.Append("[");
bool first = true;
foreach (XmlSchemaAttribute attribute in attributeUses.Values) {
if (attribute.Use != XmlSchemaUse.Prohibited) {
if (first) {
first = false;
}
else {
sb.Append(" ");
}
sb.Append(attribute.QualifiedName.Name);
if (attribute.Use == XmlSchemaUse.Optional || attribute.Use == XmlSchemaUse.None) {
sb.Append("?");
}
}
}
if (attributeWildcard != null) {
if (attributeUses.Count != 0) {
sb.Append(" ");
}
sb.Append("<");
sb.Append(attributeWildcard.NamespaceList.ToString());
sb.Append(">");
}
sb.Append("] - [");
first = true;
foreach (XmlSchemaAttribute attribute in attributeUses.Values) {
if (attribute.Use == XmlSchemaUse.Prohibited) {
if (first) {
first = false;
}
else {
sb.Append(" ");
}
sb.Append(attribute.QualifiedName.Name);
}
}
sb.Append("]");
return sb.ToString();
}
示例7: XmlSchema
public XmlSchema ()
{
attributeFormDefault= XmlSchemaForm.None;
blockDefault = XmlSchemaDerivationMethod.None;
elementFormDefault = XmlSchemaForm.None;
finalDefault = XmlSchemaDerivationMethod.None;
includes = new XmlSchemaObjectCollection();
isCompiled = false;
items = new XmlSchemaObjectCollection();
attributeGroups = new XmlSchemaObjectTable();
attributes = new XmlSchemaObjectTable();
elements = new XmlSchemaObjectTable();
groups = new XmlSchemaObjectTable();
notations = new XmlSchemaObjectTable();
schemaTypes = new XmlSchemaObjectTable();
}
示例8: TraverseAttributes
private void TraverseAttributes(XmlSchemaObjectTable derivedAttributes, ClrContentTypeInfo typeInfo)
{
foreach (XmlSchemaAttribute derivedAttribute in derivedAttributes.Values)
{
Debug.Assert(derivedAttribute.AttributeSchemaType != null); //For use=prohibited, without derivation it doesnt mean anything, hence attribute should be compiled
ClrBasePropertyInfo propertyInfo = BuildProperty(derivedAttribute, false, false);
BuildAnnotationInformation(propertyInfo, derivedAttribute, false, false);
typeInfo.AddMember(propertyInfo);
}
}
示例9: GetAttributeFromNS
private XmlSchemaAttribute GetAttributeFromNS(string ns, bool other, XmlSchemaObjectTable attributes)
{
if (other) {
foreach(XmlSchemaAttribute attr in schemaSet.GlobalAttributes.Values) {
if (attr.QualifiedName.Namespace != ns && attr.QualifiedName.Namespace != string.Empty && attributes[attr.QualifiedName] == null) {
return attr;
}
}
}
else {
foreach(XmlSchemaAttribute attr in schemaSet.GlobalAttributes.Values) {
if (attr.QualifiedName.Namespace == ns && attributes[attr.QualifiedName] == null) {
return attr;
}
}
}
return null;
}
示例10: AddAttributes
private XmlQueryCardinality AddAttributes(List<XmlQueryType> list, XmlSchemaObjectTable attributeUses, XmlSchemaAnyAttribute attributeWildcard, XmlQueryType filter) {
XmlQueryCardinality card = XmlQueryCardinality.Zero;
if (attributeWildcard != null) {
XmlSchemaType attributeSchemaType = attributeWildcard.ProcessContentsCorrect == XmlSchemaContentProcessing.Skip ? DatatypeImplementation.UntypedAtomicType : DatatypeImplementation.AnySimpleType;
// wildcard will match more then one attribute
switch (attributeWildcard.NamespaceList.Type) {
case NamespaceList.ListType.Set:
foreach (string ns in attributeWildcard.NamespaceList.Enumerate) {
card += AddFilteredPrime(list, CreateAttributeType(ns, false, attributeSchemaType), filter);
}
break;
case NamespaceList.ListType.Other:
card += AddFilteredPrime(list, CreateAttributeType(attributeWildcard.NamespaceList.Excluded, true, attributeSchemaType), filter);
break;
case NamespaceList.ListType.Any:
default:
card += AddFilteredPrime(list, attributeWildcard.ProcessContentsCorrect == XmlSchemaContentProcessing.Skip ? UntypedAttribute : Attribute, filter);
break;
}
// Always optional
card *= XmlQueryCardinality.ZeroOrOne;
}
foreach (XmlSchemaAttribute attribute in attributeUses.Values) {
XmlQueryCardinality cardAttr = AddFilteredPrime(list, CreateAttributeType(attribute), filter);
if (cardAttr != XmlQueryCardinality.Zero) {
Debug.Assert(cardAttr == XmlQueryCardinality.ZeroOrOne || cardAttr == XmlQueryCardinality.One);
card += (attribute.Use == XmlSchemaUse.Optional ? XmlQueryCardinality.ZeroOrOne : cardAttr);
}
}
return card;
}
示例11: SchemaCollectionCompiler
public SchemaCollectionCompiler(XmlNameTable nameTable, ValidationEventHandler eventHandler) : base(nameTable, null, eventHandler)
{
this.examplars = new XmlSchemaObjectTable();
this.complexTypeStack = new Stack();
}
示例12: ValidateUniqueTypeAttribution
internal override void ValidateUniqueTypeAttribution (XmlSchemaObjectTable labels,
ValidationEventHandler h, XmlSchema schema)
{
if (TargetGroup != null)
TargetGroup.Particle.ValidateUniqueTypeAttribution (labels, h, schema);
}
示例13: XSOEnumerator
internal XSOEnumerator(List<XmlSchemaObjectTable.XmlSchemaObjectEntry> entries, int size, XmlSchemaObjectTable.EnumeratorType enumType)
{
this.entries = entries;
this.size = size;
this.enumType = enumType;
this.currentIndex = -1;
}
示例14: VerifySchemaValid
internal override void VerifySchemaValid(XmlSchemaObjectTable notations, XmlSchemaObject caller) {
// Only datatypes that are derived from NOTATION by specifying a value for enumeration can be used in a schema.
// Furthermore, the value of all enumeration facets must match the name of a notation declared in the current schema. //
for(Datatype_NOTATION dt = this; dt != null; dt = (Datatype_NOTATION)dt.Base) {
if (dt.Restriction != null && (dt.Restriction.Flags & RestrictionFlags.Enumeration) != 0) {
for (int i = 0; i < dt.Restriction.Enumeration.Count; ++i) {
XmlQualifiedName notation = (XmlQualifiedName)dt.Restriction.Enumeration[i];
if (!notations.Contains(notation)) {
throw new XmlSchemaException(Res.Sch_NotationRequired, caller);
}
}
return;
}
}
throw new XmlSchemaException(Res.Sch_NotationRequired, caller);
}
示例15: XSODictionaryEnumerator
internal XSODictionaryEnumerator(List<XmlSchemaObjectTable.XmlSchemaObjectEntry> entries, int size, XmlSchemaObjectTable.EnumeratorType enumType) : base(entries, size, enumType)
{
}