Commit Graph
43 Commits
Author SHA1 Message Date
Atsushi Eno 874d3b1389 Fix bug #12035 - xsi:nil='true' was ignored in some scenario.
"some scenario" I mean:

- There is a sequence with more than one elements in xsd,
- The second element is nillable and its type has content elements, and
- The corresponding XML element specifies xsi:nil='true'

Then it resulted in a validation error as if it were missing the required
content.
2013-08-08 01:00:10 +09:00
Atsushi Eno 19eac76e6e Fix regression in XmlSchemaValidator (bug #10245): collection misoperation due to parameter renaming. 2013-02-13 21:13:27 +09:00
Martin Baulig 7d170f400d Sync parameter names with .NET. 2012-06-03 04:02:28 +02:00
Atsushi Eno 8062ba1e7b Fixed bug #3504 - implemented ValidateEndElement() var argument support.
It is documented in MSDN and I could implement it.

For the actual implementation of object-to-string conversion, I could pick
up dead old XmlValueConverter class from pre-RTM .NET 2.0(!).
It is now added to the sources where applicable.
2012-03-09 23:52:34 +09:00
Atsushi Eno 09d3ef3aea Fill XmlSchemaInfo validity for attributes (some were missing). Part of bugfix #3504. 2012-03-09 21:51:19 +09:00
Atsushi Eno 0d4ad4e387 Simple content restriction was not validated when it is in further reference.
Fixed bug #595947. It was complexType [base]-> complexType [base]-> simpleType.
2011-02-08 20:52:20 +09:00
Atsushi Eno 960484aa14 Use AttributeSchemaType as it is 2.0 API. This fixes incorrectly skipped type validation. 2010-11-30 00:09:13 +09:00
Atsushi Eno dc3a99c440 2010-06-14 Atsushi Enomoto <[email protected]>
* XmlDocument.cs : do not create XmlSchemaInfo instance every time
	  it validates a node.

	* XmlSchemaValidator.cs : limit validity initialization. In some
	  cases it failed to set Invalid.


svn path=/trunk/mcs/; revision=158867
2010-06-14 07:35:04 +00:00
Atsushi Eno f577f78eec 2010-06-14 Atsushi Enomoto <[email protected]>
* XmlSchemaValidator.cs : fill Validity. Fixed bug #613682.


svn path=/trunk/mcs/; revision=158866
2010-06-14 06:55:54 +00:00
Atsushi Eno fb729447e3 2009-04-22 Atsushi Enomoto <[email protected]>
* XmlSchemaValidator.cs : quick fix for bug #496205. Reset xsi:type
	  and endelement.

	* XmlSchemaValidatorTests.cs : added test for bug #496192 and #496205.

	* 496192.xml, 496192.xsd : new test files.


svn path=/trunk/mcs/; revision=132351
2009-04-22 08:08:52 +00:00
Atsushi Eno 0e439d038d 2009-04-22 Atsushi Enomoto <[email protected]>
* XmlQualifiedName.cs : added Parse() overload that is used for
	  xsd validation.

	* XmlSchemaValidator.cs, BuiltInDatatype.cs, XmlAtomicValue.cs:
	  use xsd-supported version of XmlQualifiedName.Parse().
	  Fixed bug #496205.


svn path=/trunk/mcs/; revision=132347
2009-04-22 05:43:28 +00:00
Atsushi Eno 19813940cf 2009-03-17 Atsushi Enomoto <[email protected]>
* XmlSchemaValidator.cs : check identity constraints on default or
	  fixed attributes too.


svn path=/trunk/mcs/; revision=129532
2009-03-17 07:34:10 +00:00
Atsushi Eno 45e218154c 2009-03-16 Atsushi Enomoto <[email protected]>
* XmlSchemaValidator.cs : check identities for untyped attributes.
	  Attribute keyfield test must adjust depth, or it never matches.
	  Missing braces for IgnoreIdentity test.


svn path=/trunk/mcs/; revision=129464
2009-03-16 16:13:56 +00:00
Atsushi Eno aff31f7ba1 2009-03-16 Atsushi Enomoto <[email protected]>
* XmlSchemaUtil.cs, XmlSchemaValidator.cs : predefined non-primitive
	  xml schema types now validate fixed values as expected.


svn path=/trunk/mcs/; revision=129443
2009-03-16 14:13:28 +00:00
Atsushi Eno 015ecae5f8 2009-01-30 Atsushi Enomoto <[email protected]>
* XmlSchemaValidator.cs : when xsi:nil is true, do not validate
	  text string. Fixed bug #469713.

	* XsdValidatingReader.cs : when xsi:nil is true, do not validate
	  text string.

	* XmlSchemaValidatorTests.cs : added test for bug #469713.


svn path=/trunk/mcs/; revision=125069
2009-01-30 11:14:22 +00:00
Atsushi Eno 42e6fd4373 2008-12-09 Atsushi Enomoto <[email protected]>
* XsdValidatingReader.cs : skip text validation under xs:any.
	  Fixed part of bug #449512.

	* XmlSchemaValidator.cs : skip text validation under xs:any.

	* XmlValidatingReaderTests.cs : added test for validating mixed
	  element under xs:any.


svn path=/trunk/mcs/; revision=121093
2008-12-09 11:19:20 +00:00
Gonzalo Paniagua Javier 884e641b80 grammar
svn path=/trunk/mcs/; revision=119578
2008-11-21 05:32:13 +00:00
Atsushi Eno ff8c76700f fix bug #435206.
svn path=/trunk/mcs/; revision=117232
2008-10-28 01:14:03 +00:00
Atsushi Eno 6b68299d0f fix bug #433774.
svn path=/trunk/mcs/; revision=117216
2008-10-27 23:57:04 +00:00
Atsushi Eno 65acaeb5a9 2008-09-09 Atsushi Enomoto <[email protected]>
* XmlSchemaValidator.cs : do not try to validate CloseStartElement
	  when it should be skipped. Fixed bug #422581.

	* XmlSchemaValidatorTests.cs : added test for bug #422581.

	* 422581.xsd, 422581.xml : new files.


svn path=/trunk/mcs/; revision=112583
2008-09-09 13:20:23 +00:00
Marek Safar 95a6e77b85 Warnings cleanup
svn path=/trunk/mcs/; revision=111839
2008-08-28 16:53:31 +00:00
Atsushi Eno ea43bd0eb7 2008-02-04 Atsushi Enomoto <[email protected]>
* XmlSchemaValidator.cs : added couple of null argument check.
	  Do not depend on XmlSchemaInfo to retrieve attribute value (it
	  could be null).
	  Do not practically validate attribute when it is not in validating
	  state (i.e. inside xs:any). Fixed bug #358408.

	* XmlSchemaValidatorTests.cs : new. Test for bug #358408.

	* 358408.xsd : new test file.

	* System.Xml_test.dll.sources : added XmlSchemaValidatorTests.cs.
	* Makefile : extra distfiles (358408.xsd).


svn path=/trunk/mcs/; revision=94729
2008-02-04 08:49:05 +00:00
Atsushi Eno b265ee6b99 2007-11-12 Atsushi Enomoto <[email protected]>
* XmlSchemaValidator.cs : XmlValueGetter actually needs string value
	  to validate against a restricted simple type (beyond ParseValue()). 
	  Fixed bug #339934.

	* XsdValidatingReaderTests.cs : added test for #339934.

	in Test/System.Xml.Schema/standalone_tests:
	* Makefile : now we try both default and 2.0 profile tests (i.e.
	  "make run-test" and "make PROFILE=net_2_0").
	  For 2.0, use XmlReader.Create().


svn path=/trunk/mcs/; revision=89432
2007-11-12 00:55:56 +00:00
Atsushi Eno 2b16027631 2007-08-02 Atsushi Enomoto <[email protected]>
* XmlSchemaValidator.cs : another extra whitespace rejection.
	  Fixed another issue reported on bug #82183.

	* XsdValidatingReaderTests.cs : another test posted on bug #82183.


svn path=/trunk/mcs/; revision=83264
2007-08-02 07:10:22 +00:00
Atsushi Eno 97eb3b6ec2 2007-07-25 Atsushi Enomoto <[email protected]>
* XmlSchemaValidator.cs : do not reject whitespaces in elementOnly
	  content model. Fixed bug #82183.

	* XsdValidatingReader.cs : reject more whitespaces in empty model
	  element.


svn path=/trunk/mcs/; revision=82652
2007-07-25 09:31:38 +00:00
Atsushi Eno 5be9aab4de 2007-07-17 Atsushi Enomoto <[email protected]>
* XsdValidatingReader.cs : Process empty and element-only contents
	  differently along with the spec 3.4.4 Element Locally Valid (Complex 
	  Type) 2.3 (and 2.1 respectively). Itchy specification indeed.
	  This demanded not a few internal changes. Fixed bug #82099.

	* XmlSchemaValidator.cs : dependent changes to 
	  XsdParticleValidationState. Changed ValidateWhitespace() to do
	  the same as we do in XsdValidatingReader.

	* XsdValidatingReaderTests.cs : added test for bug #82099.


svn path=/trunk/mcs/; revision=82098
2007-07-17 13:36:31 +00:00
Atsushi Eno 1d3440fc5d sanitizing MonoTODOs.
svn path=/trunk/mcs/; revision=67899
2006-11-15 11:31:25 +00:00
Atsushi Eno 623b56116c 2006-10-27 Atsushi Enomoto <[email protected]>
* XmlSchemaValidator.cs : it must also be fixed for method signature
	  change.
	* XmlSchemaSimpleTypeRestriction.cs : on .NET 2.0, use 
	  IXmlNamespaceResolver for XmlSchemaValidator.

	* XsdValidatingReaderTests.cs : the previous test raises different
	  exception in 2.0.


svn path=/trunk/mcs/; revision=67032
2006-10-27 16:17:11 +00:00
Atsushi Eno 68c182e20c 2006-01-11 Atsushi Enomoto <[email protected]>
* XmlSchemaValidatingReader.cs : removed unused constructors.
	  Now it implements IXmlSchemaInfo. Use XmlSchemaType instead of
	  Object to represent schema types.

	* XmlSchemaAttribute.cs, XmlSchemaElement.cs : AttributeSchemaType
	  and ElementSchemaType were not working fine for anySimpleType.
	* XmlSchemaValidator.cs : When actual schema type was complex,
	  schema types was not filled correctly. Modified some extra comments.
	* XmlSchemaSet.cs, XmlSchemaType.cs : removed extra MonoTODOs.


svn path=/trunk/mcs/; revision=55371
2006-01-11 13:21:19 +00:00
Atsushi Eno 12b7f166b6 2006-01-06 Atsushi Enomoto <[email protected]>
* XmlValidatingReader.cs : In ReadTypedValue(), treat Whitespace
	  nodes as target string nodes as well as other text nodes.

	* XsdValidatingReader.cs :
	  Don't use normalized string as input to AssessStringValid(). It 
	  incorrectly invalidates strings against simple types with length-
	  related facets.
	  Now that we don't ignore whitespaces, we need to explicitly allow
	  pure whitespace texts in ElementOnly/Empty model.

	* XmlSchemaSimpleTypeRestriction.cs : maxLength and minLength were
	  likely to be ignored in ValidateNonListValueWithFacets().
	* XmlSchemaValidator.cs : Don't use normalized string value as the
	  input to AssessStringValid().

	* XsdValidatingReaderTests.cs : test for ReadTypeValue() that it
	  does not ignore whitespace nodes, and it does not normalize string
	  incorrectly.


svn path=/trunk/mcs/; revision=55129
2006-01-06 04:47:46 +00:00
Atsushi Eno beabaefd1f 2005-11-07 Atsushi Enomoto <[email protected]>
* XmlSchemaValidator.cs : added missing ValidateWhitespace and
	  ValidateText, though the latter I think is LAMESPEC.


svn path=/trunk/mcs/; revision=52660
2005-11-07 18:17:27 +00:00
Atsushi Eno 38e3987552 2005-11-07 Atsushi Enomoto <[email protected]>
* XmlReader.cs : dependent XmlSchemaValidationFlags fix.
	  Added ReadElementContentAsObject() and ReadContentAsObject().
	* XmlReader.cs, XmlTextReader.cs :
	  LookupNamespace(string,bool) is now private.
	* XmlReader.cs, XmlNode,cs :
	  [DebuggerDisplay].

	* XmlSchemaValidationFlags.cs : updated to match 2.0 RTM.
	* XmlSchemaValidator.cs : related fix.

	* XmlSchemaValidatingReader.cs : XmlSchemaValidationFlags is updated.

	* XmlReaderSettingsTests.cs : XmlSchemaValidationFlags is updated.



svn path=/trunk/mcs/; revision=52659
2005-11-07 17:22:05 +00:00
Atsushi Eno d7e2e92951 2005-11-07 Atsushi Enomoto <[email protected]>
* XmlValueGetter.cs, XmlSchemaValidator.cs, XmlSchemaException.cs,
	  XmlSchemaAttribute.cs : Updated API to match 2.0 RTM. Most of the
	  changes are related to XmlValueGetter change.

	* XsdValidatingReader.cs, XmlSchemaValidatingReader.cs,
	  XsdIdentityState.cs :
	  Dependent changes caused by XmlValueGetter changes.

	* xsdtest.cs : updated to match 2.0 RTM API.


svn path=/trunk/mcs/; revision=52650
2005-11-07 12:56:29 +00:00
Atsushi Eno 596ecb5cdc 2005-11-07 Atsushi Enomoto <[email protected]>
* XmlSchemaValidator.cs : sealed.
	* ValidationEventArgs.cs : not sealed in 2.0.
	* XmlSchemaCollection.cs : added private ICollection.Count (to erase
	  IsVirtual difference).


svn path=/trunk/mcs/; revision=52638
2005-11-07 08:57:45 +00:00
Atsushi Eno ccef6c8982 2005-09-25 Atsushi Enomoto <[email protected]>
* XmlSchemaValidationFlags.cs, XmlSchemaValidator.cs :
	  NET_2_0 API updates.

	* XmlReader.cs, XmlReaderSettings.cs, XmlDocument.cs:
	  XmlSchemaValidationFlags updates.

	* XmlSchemaValidatingReader.cs: XmlSchemaValidationFlags updates.

	* XmlReaderSettingsTests.cs : XmlSchemaValidationFlags NET_2_0 update.


svn path=/trunk/mcs/; revision=50732
2005-09-25 17:43:39 +00:00
Ben Maurer 0e8decdb37 remove svn:executable from .cs files
svn path=/trunk/mcs/; revision=46562
2005-06-27 15:51:40 +00:00
Atsushi Eno 4e91a8b292 2005-01-17 Atsushi Enomoto <[email protected]>
* XmlSchemaValidator.cs : in case of open start tag,
	  ValidateEndElement() calls ValidateEndOfAttributes().



svn path=/trunk/mcs/; revision=39006
2005-01-17 09:41:58 +00:00
Atsushi Eno b259fe7d06 2004-12-16 Atsushi Enomoto <[email protected]>
* XmlSchemaValidator.cs : ValidateElement() was not LAMESPEC. Added
	  some comments on ValidateEndElement().


svn path=/trunk/mcs/; revision=37838
2004-12-16 15:37:31 +00:00
Atsushi Eno 2ef0fa83bf 2004-12-16 Atsushi Enomoto <[email protected]>
* XmlSchemaValidator.cs : fill schemaInfo as long as possible right now.


svn path=/trunk/mcs/; revision=37833
2004-12-16 14:00:21 +00:00
Atsushi Eno fea4a4c50c 2004-12-16 Atsushi Enomoto <[email protected]>
* XsdParticleValidationState.cs :
	  Removed some unused or unnecessary members. Readonlify some members.
	  Added GetExpectedParticles(ArrayList) and overriden in all state
	  types, which is used in XmlSchemaValidator.GetExpectedParticles().

	* XmlSchemaValidator.cs : implemented GetExpectedParticles() and
	  SkipToEndElement ().



svn path=/trunk/mcs/; revision=37823
2004-12-16 09:53:19 +00:00
Atsushi Eno 103fb0642d 2004-12-15 Atsushi Enomoto <[email protected]>
* xsdtest.cs : added --v2 option that uses XmlReader.Create()
	  instead of XmlValidatingReader.

	* XmlFilterReader.cs : don't expect XmlReaderSettings of its source.

	* XmlSchemaValidatingReader.cs : xsi:* attributes are now handled via
	  XmlSchemaValidator.ValidateElement().
	  Removed some obsolete overrides.

	* XmlReader.cs :
	  Create() should assure NameTable!=null on creating XmlTextReader.
	  Now use XmlSchemaValidatingReader for all xsd validation.
	* XmlTextReader2.cs :
	  Don't use input reader's Settings. It is null.
	* XmlReaderSettings.cs : added XmlResolver.

	* XmlSchemaSet.cs : set default resolver. Clear components before
	  recompilation.
	* XmlSchemaValidator.cs :
	  SourceUri is System.Uri.
	  GetUnspecifiedDefaultAttributes() is allowed only when it is inside
	  start tag.
	  Added AddSchema().
	  Added duplicate attribute check.
	  Added ValidateElement() that takes xsi:* parameters.
	  (http://lab.msdn.microsoft.com/productfeedback/viewfeedback.aspx?feedbackId=7fc38ea1-c306-4fb7-8631-0e174b0ff3c6)
	  HandleXsiNil() now just takes string parameter.



svn path=/trunk/mcs/; revision=37782
2004-12-15 13:58:32 +00:00
Atsushi Eno 2ff40096cb 2004-12-14 Atsushi Enomoto <[email protected]>
* System.Xml.dll.sources : added XmlSchemaValidatingReader.

	* XmlSchemaValidatingReader.cs : new file; another XmlReader 
	  implementation that handles XSD validation. It is an reference
	  application for XmlSchemaValidator.
	* XsdValidatingReader.cs : Use readerLineInfo for IXmlLineInfo.

	* XmlReaderSettings.cs : XsdValidate and DtdValidate are now
	  ValidationType.
	* XmlReader.cs : In Create(), use XmlSchemaValidatingReader for xsd
	  validation.

	* XmlSchemaValidator.cs : implemented basic validation feature.



svn path=/trunk/mcs/; revision=37739
2004-12-14 12:09:23 +00:00
Atsushi Eno 9a2a6c86f3 2004-12-08 Atsushi Enomoto <[email protected]>
* System.Xml.dll.sources : added XmlSchemaValidator.cs,
	  XmlValueGetter.cs and XmlSchemaValidationFlags.cs.

	* XmlException.cs : added SecurityPermissionAttributes.
	* XmlReaderSettings.cs,
	  XmlReader.cs : added ValidationFlags and removed obsolete ones.

	* XmlValueGetter.cs,
	  XmlSchemaValidationFlags.cs,
	  XmlSchemaValidator.cs : added.
	* XmlSchemaSet.cs : XmlResolver is now internally gettable.


svn path=/trunk/mcs/; revision=37398
2004-12-08 17:14:21 +00:00