2 writes to reader
System.Xml (2)
System\Xml\Schema\BaseValidator.cs (2)
37
reader
= other.reader;
50
this.
reader
= reader;
171 references to reader
System.Xml (171)
System\Xml\Schema\AutoValidator.cs (21)
30
reader
.Validator = new XdrValidator(this);
31
reader
.Validator.Validate();
35
reader
.Validator = new XsdValidator(this);
36
reader
.Validator.Validate();
52
if (
reader
.Schemas != null &&
reader
.Schemas.Count > 0) {
53
XmlSchemaCollectionEnumerator enumerator =
reader
.Schemas.GetEnumerator();
64
if (
reader
.NodeType == XmlNodeType.Element) {
65
SchemaType schemaType = SchemaNames.SchemaTypeFromRoot(
reader
.LocalName,
reader
.NamespaceURI);
73
int count =
reader
.AttributeCount;
75
reader
.MoveToAttribute(i);
76
string objectNs =
reader
.NamespaceURI;
77
string objectName =
reader
.LocalName;
79
if(XdrBuilder.IsXdrSchema(
reader
.Value)) {
80
reader
.MoveToElement();
85
reader
.MoveToElement();
89
reader
.SchemaTypeObject = XmlSchemaDatatype.FromXdrName(
reader
.Value);
90
reader
.MoveToElement();
95
reader
.MoveToElement();
System\Xml\Schema\BaseValidator.cs (9)
37
reader = other.
reader
;
59
get { return
reader
; }
163
SaveTextValue(
reader
.Value);
178
SaveTextValue(
reader
.Value);
201
SendValidationEvent(new XmlSchemaException(code, args,
reader
.BaseURI, positionInfo.LineNumber, positionInfo.LinePosition));
205
SendValidationEvent(new XmlSchemaException(code, arg,
reader
.BaseURI, positionInfo.LineNumber, positionInfo.LinePosition));
209
SendValidationEvent(new XmlSchemaException(code, new string[] { arg1, arg2 },
reader
.BaseURI, positionInfo.LineNumber, positionInfo.LinePosition));
217
SendValidationEvent(new XmlSchemaException(code, msg,
reader
.BaseURI, positionInfo.LineNumber, positionInfo.LinePosition), severity);
221
SendValidationEvent(new XmlSchemaException(code, args,
reader
.BaseURI, positionInfo.LineNumber, positionInfo.LinePosition), severity);
System\Xml\Schema\DtdValidator.cs (25)
42
Debug.Assert(
reader
!= null);
54
switch (
reader
.NodeType) {
57
if (
reader
.IsEmptyElement) {
77
if (!GenEntity( new XmlQualifiedName(
reader
.LocalName,
reader
.Prefix) ) ){
87
if(
reader
.Depth == 0 &&
88
reader
.NodeType == XmlNodeType.Element) {
95
if (
reader
.StandAlone && // VC 1 - iv
116
elementName.Init(
reader
.LocalName,
reader
.Prefix);
117
if ( (
reader
.Depth == 0) &&
129
Debug.Assert(
reader
.NodeType == XmlNodeType.Element);
134
XmlSchemaValidator.ElementValidationError(elementName, context, EventHandler,
reader
,
reader
.BaseURI, PositionInfo.LineNumber, PositionInfo.LinePosition, null);
155
reader
.SchemaTypeObject = null;
156
SchemaAttDef attnDef = context.ElementDecl.GetAttDef( new XmlQualifiedName(
reader
.LocalName,
reader
.Prefix) );
163
if (attnDef.Datatype != null && !
reader
.IsDefault) { //Since XmlTextReader adds default attributes, do not check again
169
SendValidationEvent(Res.Sch_UndeclaredAttribute,
reader
.Name);
230
XmlSchemaValidator.CompleteValidationError(context, EventHandler,
reader
,
reader
.BaseURI, PositionInfo.LineNumber, PositionInfo.LinePosition, null);
286
reader
.TypedValueObject = null;
298
reader
.TypedValueObject = typedValue;
377
if (
reader
.StandAlone && en.DeclaredInExternal) {
404
SendValidationEvent(new XmlSchemaException(Res.Sch_UndeclaredId, next.Id,
reader
.BaseURI, next.LineNo, next.LinePos));
System\Xml\Schema\XdrValidator.cs (44)
40
nsManager =
reader
.NamespaceManager;
59
switch (
reader
.NodeType) {
62
if (
reader
.IsEmptyElement) {
82
elementName.Init(
reader
.LocalName, XmlSchemaDatatype.XdrCanonizeUri(
reader
.NamespaceURI, NameTable, SchemaNames));
84
if (SchemaNames.IsXDRRoot(elementName.Name, elementName.Namespace) &&
reader
.Depth > 0) {
86
inlineSchemaParser.StartParsing(
reader
, null);
99
XmlSchemaValidator.ElementValidationError(elementName, context, EventHandler,
reader
,
reader
.BaseURI, PositionInfo.LineNumber, PositionInfo.LinePosition, null);
146
XmlSchemaValidator.CompleteValidationError(context, EventHandler,
reader
,
reader
.BaseURI, PositionInfo.LineNumber, PositionInfo.LinePosition, null);
166
if (
reader
.Depth == 0) {
169
if (
reader
.MoveToFirstAttribute()) {
171
string objectNs =
reader
.NamespaceURI;
172
string objectName =
reader
.LocalName;
174
LoadSchema(
reader
.Value);
176
nsManager.AddNamespace(
reader
.Prefix.Length == 0 ? string.Empty :
reader
.LocalName,
reader
.Value);
183
reader
.SchemaTypeObject = XmlSchemaDatatype.FromXdrName(
reader
.Value);
186
} while(
reader
.MoveToNextAttribute());
187
reader
.MoveToElement();
201
reader
.SchemaTypeObject = context.ElementDecl.SchemaType;
204
reader
.SchemaTypeObject = context.ElementDecl.Datatype;
206
if (
reader
.IsEmptyElement && !context.IsNill && context.ElementDecl.DefaultValueTyped != null) {
207
reader
.TypedValueObject = context.ElementDecl.DefaultValueTyped;
215
if (
reader
.MoveToFirstAttribute()) {
217
if ((object)
reader
.NamespaceURI == (object)SchemaNames.NsXmlNs) {
222
reader
.SchemaTypeObject = null;
223
SchemaAttDef attnDef = schemaInfo.GetAttributeXdr(context.ElementDecl, QualifiedName(
reader
.LocalName,
reader
.NamespaceURI));
228
reader
.SchemaTypeObject = (attnDef.SchemaType != null) ? (object)attnDef.SchemaType : (object)attnDef.Datatype;
230
string attributeValue =
reader
.Value;
238
e.SetSource(
reader
.BaseURI, PositionInfo.LineNumber, PositionInfo.LinePosition);
241
} while(
reader
.MoveToNextAttribute());
242
reader
.MoveToElement();
250
reader
.AddDefaultAttribute((SchemaAttDef)context.ElementDecl.DefaultAttDefs[i]);
255
context.ElementDecl.CheckAttributes(attPresence,
reader
.StandAlone);
258
e.SetSource(
reader
.BaseURI, PositionInfo.LineNumber, PositionInfo.LinePosition);
358
ProcessEntity(schemaInfo, name, this, EventHandler,
reader
.BaseURI, PositionInfo.LineNumber, PositionInfo.LinePosition);
381
reader
.TypedValueObject = null;
397
reader
.TypedValueObject = typedValue;
560
SendValidationEvent(new XmlSchemaException(Res.Sch_UndeclaredId, next.Id,
reader
.BaseURI, next.LineNo, next.LinePos));
System\Xml\Schema\XsdValidator.cs (72)
58
nsManager =
reader
.NamespaceManager;
87
switch (
reader
.NodeType) {
90
if (
reader
.IsEmptyElement) {
154
elementName.Init(
reader
.LocalName,
reader
.NamespaceURI);
156
if (IsXSDRoot(elementName.Name, elementName.Namespace) &&
reader
.Depth > 0) {
158
inlineSchemaParser.StartParsing(
reader
, null);
180
XmlSchemaValidator.ElementValidationError(elementName, context, EventHandler,
reader
,
reader
.BaseURI, PositionInfo.LineNumber, PositionInfo.LinePosition, null);
229
if (
reader
.Depth == 0) {
239
if (
reader
.MoveToFirstAttribute()) {
241
string objectNs =
reader
.NamespaceURI;
242
string objectName =
reader
.LocalName;
244
LoadSchema(
reader
.Value, null);
246
nsManager.AddNamespace(
reader
.Prefix.Length == 0 ? string.Empty :
reader
.LocalName,
reader
.Value);
251
xsiSchemaLocation = (string[])dtStringArray.ParseValue(
reader
.Value, NameTable, nsManager);
254
xsiNoNamespaceSchemaLocation =
reader
.Value;
257
xsiType = (XmlQualifiedName)dtQName.ParseValue(
reader
.Value, NameTable, nsManager);
260
xsiNil =
reader
.Value;
263
} while(
reader
.MoveToNextAttribute());
264
reader
.MoveToElement();
284
XmlSchemaValidator.CompleteValidationError(context, EventHandler,
reader
,
reader
.BaseURI, PositionInfo.LineNumber, PositionInfo.LinePosition, null);
376
reader
.SchemaTypeObject = context.ElementDecl.SchemaType;
378
if (
reader
.IsEmptyElement && !context.IsNill && context.ElementDecl.DefaultValueTyped != null) {
379
reader
.TypedValueObject = UnWrapUnion(context.ElementDecl.DefaultValueTyped);
383
reader
.TypedValueObject = null; //Typed value cleanup
390
if (
reader
.MoveToFirstAttribute()) {
392
if ((object)
reader
.NamespaceURI == (object)NsXmlNs) {
395
if ((object)
reader
.NamespaceURI == (object)NsXsi) {
400
reader
.SchemaTypeObject = null;
401
XmlQualifiedName attQName = new XmlQualifiedName(
reader
.LocalName,
reader
.NamespaceURI);
410
reader
.SchemaTypeObject = attnDef.SchemaType;
415
CheckValue(
reader
.Value, attnDef);
418
AttributeIdentityConstraints(
reader
.LocalName,
reader
.NamespaceURI,
reader
.TypedValueObject,
reader
.Value, attnDef);
435
e.SetSource(
reader
.BaseURI, PositionInfo.LineNumber, PositionInfo.LinePosition);
438
} while(
reader
.MoveToNextAttribute());
439
reader
.MoveToElement();
447
reader
.AddDefaultAttribute(attdef);
457
context.ElementDecl.CheckAttributes(attPresence,
reader
.StandAlone);
460
e.SetSource(
reader
.BaseURI, PositionInfo.LineNumber, PositionInfo.LinePosition);
571
ProcessEntity(schemaInfo, name, this, EventHandler,
reader
.BaseURI, PositionInfo.LineNumber, PositionInfo.LinePosition);
583
reader
.TypedValueObject = null;
618
reader
.TypedValueObject = typedValue;
683
SendValidationEvent(new XmlSchemaException(Res.Sch_UndeclaredId, next.Id,
reader
.BaseURI, next.LineNo, next.LinePos));
771
if (constraints[j].axisSelector.MoveToStartElement(
reader
.LocalName,
reader
.NamespaceURI)) {
774
Debug.WriteLine("Name: " +
reader
.LocalName + "\t|\tURI: " +
reader
.NamespaceURI + "\n");
784
if (laxis.MoveToStartElement(
reader
.LocalName,
reader
.NamespaceURI)) {
789
SendValidationEvent(Res.Sch_FieldSimpleTypeExpected,
reader
.LocalName);
867
Debug.WriteLine("Name: " +
reader
.LocalName + "\t|\tURI: " +
reader
.NamespaceURI + "\t|\tValue: " +
reader
.TypedValueObject + "\n");
873
SendValidationEvent (Res.Sch_FieldSingleValueExpected,
reader
.LocalName);
878
if(
reader
.TypedValueObject != null && stringValue.Length != 0) {
879
laxis.Ks[laxis.Column] = new TypedObject(
reader
.TypedValueObject,stringValue,context.ElementDecl.Datatype);
884
laxis.EndElement(
reader
.LocalName,
reader
.NamespaceURI);
887
if (constraints[i].axisSelector.EndElement(
reader
.LocalName,
reader
.NamespaceURI)) {
896
SendValidationEvent(new XmlSchemaException(Res.Sch_MissingKey, constraints[i].constraint.name.ToString(),
reader
.BaseURI, ks.PosLine, ks.PosCol));
904
reader
.BaseURI, ks.PosLine, ks.PosCol));
918
reader
.BaseURI, ks.PosLine, ks.PosCol));
953
reader
.BaseURI, ks.PosLine, ks.PosCol));