本文整理汇总了C#中System.Xml.Schema.XsdBuilder类的典型用法代码示例。如果您正苦于以下问题:C# XsdBuilder类的具体用法?C# XsdBuilder怎么用?C# XsdBuilder使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
XsdBuilder类属于System.Xml.Schema命名空间,在下文中一共展示了XsdBuilder类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: StartParsingAsync
public async Task StartParsingAsync(XmlReader reader, string targetNamespace) {
this.reader = reader;
positionInfo = PositionInfo.GetPositionInfo(reader);
namespaceManager = reader.NamespaceManager;
if (namespaceManager == null) {
namespaceManager = new XmlNamespaceManager(nameTable);
isProcessNamespaces = true;
}
else {
isProcessNamespaces = false;
}
while (reader.NodeType != XmlNodeType.Element && await reader.ReadAsync().ConfigureAwait(false)) {}
markupDepth = int.MaxValue;
schemaXmlDepth = reader.Depth;
SchemaType rootType = schemaNames.SchemaTypeFromRoot(reader.LocalName, reader.NamespaceURI);
string code;
if (!CheckSchemaRoot(rootType, out code)) {
throw new XmlSchemaException(code, reader.BaseURI, positionInfo.LineNumber, positionInfo.LinePosition);
}
if (schemaType == SchemaType.XSD) {
schema = new XmlSchema();
schema.BaseUri = new Uri(reader.BaseURI, UriKind.RelativeOrAbsolute);
builder = new XsdBuilder(reader, namespaceManager, schema, nameTable, schemaNames, eventHandler);
}
else {
Debug.Assert(schemaType == SchemaType.XDR);
xdrSchema = new SchemaInfo();
xdrSchema.SchemaType = SchemaType.XDR;
builder = new XdrBuilder(reader, namespaceManager, xdrSchema, targetNamespace, nameTable, schemaNames, eventHandler);
((XdrBuilder)builder).XmlResolver = xmlResolver;
}
}
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:35,代码来源:ParserAsync.cs
示例2: BuildGroupRef_Ref
private static void BuildGroupRef_Ref(XsdBuilder builder, string value) {
builder.groupRef.RefName = builder.ParseQName(value, "ref");
}
开发者ID:uQr,项目名称:referencesource,代码行数:3,代码来源:XsdBuilder.cs
示例3: BuildDocumentation_XmlLang
private static void BuildDocumentation_XmlLang(XsdBuilder builder, string value) {
try {
builder.documentation.Language = value;
}
catch (XmlSchemaException e) {
e.SetSource(builder.reader.BaseURI, builder.positionInfo.LineNumber, builder.positionInfo.LinePosition);
builder.SendValidationEvent(e);
}
}
开发者ID:uQr,项目名称:referencesource,代码行数:9,代码来源:XsdBuilder.cs
示例4: InitDocumentation
/*
<documentation
source = uriReference>
Content: ({any})*
</documentation>
*/
private static void InitDocumentation(XsdBuilder builder, string value) {
builder.xso = builder.documentation = new XmlSchemaDocumentation();
builder.annotation.Items.Add(builder.documentation);
builder.markup = new XmlNode[] {};
}
开发者ID:uQr,项目名称:referencesource,代码行数:11,代码来源:XsdBuilder.cs
示例5: BuildAppinfo_Source
private static void BuildAppinfo_Source(XsdBuilder builder, string value) {
builder.appInfo.Source = ParseUriReference(value);
}
开发者ID:uQr,项目名称:referencesource,代码行数:3,代码来源:XsdBuilder.cs
示例6: InitAnnotation
/*
<annotation>
Content: (appinfo | documentation)*
</annotation>
*/
private static void InitAnnotation(XsdBuilder builder, string value) {
// On most elements annotations are only allowed to be the first child
// (so the element must not have any children by now), and only one annotation is allowed.
// Exceptions are xs:schema and xs:redefine, these can have any number of annotations
// in any place.
if (builder.hasChild &&
builder.ParentElement != SchemaNames.Token.XsdSchema &&
builder.ParentElement != SchemaNames.Token.XsdRedefine) {
builder.SendValidationEvent(Res.Sch_AnnotationLocation, null);
}
builder.xso = builder.annotation = new XmlSchemaAnnotation();
builder.ParentContainer.AddAnnotation(builder.annotation);
}
开发者ID:uQr,项目名称:referencesource,代码行数:18,代码来源:XsdBuilder.cs
示例7: InitField
/*
<field
id = ID
xpath = An XPath expression
{any attributes with non-schema namespace . . .}>
Content: (annotation?)
</field>
*/
private static void InitField(XsdBuilder builder, string value) {
builder.xso = builder.xpath = new XmlSchemaXPath();
// no selector before fields?
if ( builder.identityConstraint.Selector == null ) {
builder.SendValidationEvent(Res.Sch_SelectorBeforeFields, builder.identityConstraint.Name);
}
builder.identityConstraint.Fields.Add(builder.xpath);
}
开发者ID:uQr,项目名称:referencesource,代码行数:16,代码来源:XsdBuilder.cs
示例8: InitSelector
/*
<selector
id = ID
xpath = An XPath expression
{any attributes with non-schema namespace . . .}>
Content: (annotation?)
</selector>
*/
private static void InitSelector(XsdBuilder builder, string value) {
builder.xso = builder.xpath = new XmlSchemaXPath();
if ( builder.identityConstraint.Selector == null ) {
builder.identityConstraint.Selector = builder.xpath;
}
else {
builder.SendValidationEvent(Res.Sch_DupSelector, builder.identityConstraint.Name);
}
}
开发者ID:uQr,项目名称:referencesource,代码行数:17,代码来源:XsdBuilder.cs
示例9: InitNotation
/*
<notation
id = ID
name = NCName
public = A public identifier, per ISO 8879
system = uriReference
{any attributes with non-schema namespace . . .}>
Content: (annotation?)
</notation>
*/
private static void InitNotation(XsdBuilder builder, string value) {
builder.xso = builder.notation = new XmlSchemaNotation();
builder.canIncludeImport = false;
builder.schema.Items.Add(builder.notation);
}
开发者ID:uQr,项目名称:referencesource,代码行数:15,代码来源:XsdBuilder.cs
示例10: BuildAny_ProcessContents
private static void BuildAny_ProcessContents(XsdBuilder builder, string value) {
builder.anyElement.ProcessContents = (XmlSchemaContentProcessing)builder.ParseEnum(value, "processContents", ProcessContentsStringValues);
}
开发者ID:uQr,项目名称:referencesource,代码行数:3,代码来源:XsdBuilder.cs
示例11: BuildAny_Namespace
private static void BuildAny_Namespace(XsdBuilder builder, string value) {
builder.anyElement.Namespace = value;
}
开发者ID:uQr,项目名称:referencesource,代码行数:3,代码来源:XsdBuilder.cs
示例12: InitAny
/*
<any
id = ID
maxOccurs = for maxOccurs : 1
minOccurs = nonNegativeInteger : 1
namespace = ##any | ##other | list of {uri, ##targetNamespace, ##local} : ##any
processContents = skip | lax | strict : strict
{any attributes with non-schema namespace . . .}>
Content: (annotation?)
</any>
*/
private static void InitAny(XsdBuilder builder, string value) {
builder.xso = builder.particle = builder.anyElement = new XmlSchemaAny();
builder.AddParticle(builder.anyElement);
}
开发者ID:uQr,项目名称:referencesource,代码行数:15,代码来源:XsdBuilder.cs
示例13: InitSequence
/*
<sequence
id = ID
maxOccurs = for maxOccurs : 1
minOccurs = nonNegativeInteger : 1
{any attributes with non-schema namespace . . .}>
Content: (annotation? , (element | group | choice | sequence | any)*)
</sequence>
*/
private static void InitSequence(XsdBuilder builder, string value) {
builder.xso = builder.particle = builder.sequence = new XmlSchemaSequence();
builder.AddParticle(builder.sequence);
}
开发者ID:uQr,项目名称:referencesource,代码行数:13,代码来源:XsdBuilder.cs
示例14: InitChoice
/*
<choice
id = ID
maxOccurs = for maxOccurs : 1
minOccurs = nonNegativeInteger : 1
{any attributes with non-schema namespace . . .}>
Content: (annotation? , (element | group | choice | sequence | any)*)
</choice>
*/
private static void InitChoice(XsdBuilder builder, string value) {
builder.xso = builder.particle = builder.choice = new XmlSchemaChoice();
builder.AddParticle(builder.choice);
}
开发者ID:uQr,项目名称:referencesource,代码行数:13,代码来源:XsdBuilder.cs
示例15: InitAll
/*
<all
id = ID
maxOccurs = for maxOccurs : 1
minOccurs = nonNegativeInteger : 1
{any attributes with non-schema namespace . . .}>
Content: (annotation? , element*)
</all>
*/
private static void InitAll(XsdBuilder builder, string value) {
builder.xso = builder.particle = builder.all = new XmlSchemaAll();
builder.AddParticle(builder.all);
}
开发者ID:uQr,项目名称:referencesource,代码行数:13,代码来源:XsdBuilder.cs
示例16: BuildIdentityConstraint_Name
private static void BuildIdentityConstraint_Name(XsdBuilder builder, string value) {
builder.identityConstraint.Name = value;
}
开发者ID:uQr,项目名称:referencesource,代码行数:3,代码来源:XsdBuilder.cs
示例17: BuildIdentityConstraint_Refer
private static void BuildIdentityConstraint_Refer(XsdBuilder builder, string value) {
if (builder.identityConstraint is XmlSchemaKeyref) {
((XmlSchemaKeyref)builder.identityConstraint).Refer = builder.ParseQName(value, "refer");
}
else {
builder.SendValidationEvent(Res.Sch_UnsupportedAttribute, "refer");
}
}
开发者ID:uQr,项目名称:referencesource,代码行数:8,代码来源:XsdBuilder.cs
示例18: BuildNotation_Name
private static void BuildNotation_Name(XsdBuilder builder, string value) {
builder.notation.Name = value;
}
开发者ID:uQr,项目名称:referencesource,代码行数:3,代码来源:XsdBuilder.cs
示例19: BuildSelector_XPath
private static void BuildSelector_XPath(XsdBuilder builder, string value) {
builder.xpath.XPath = value;
}
开发者ID:uQr,项目名称:referencesource,代码行数:3,代码来源:XsdBuilder.cs
示例20: BuildNotation_Public
private static void BuildNotation_Public(XsdBuilder builder, string value) {
builder.notation.Public = value;
}
开发者ID:uQr,项目名称:referencesource,代码行数:3,代码来源:XsdBuilder.cs
注:本文中的System.Xml.Schema.XsdBuilder类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论