SenseNet.ContentRepository.Storage.XmlValidator.Validate C# (CSharp) Method

Validate() public method

public Validate ( IXPathNavigable xml ) : bool
xml IXPathNavigable
return bool
		public bool Validate(IXPathNavigable xml)
		{
			if (xml == null)
				throw new ArgumentNullException("xml");
			if (_schema == null)
				throw new InvalidOperationException(SR.Exceptions.XmlSchema.Msg_SchemaNotLoaded);

			XmlSchemaSet schema = new XmlSchemaSet();
			schema.Add(_schema);
			ClearErrors();

			XPathNavigator nav = xml.CreateNavigator();
			nav.MoveToFirstChild();
			//-- csak a semaval egyezo nevteru xml lehet valid
			if (schema.Schemas(nav.NamespaceURI).Count > 0)
				return xml.CreateNavigator().CheckValidity(schema, ValidationCallback);

			return false;
		}

Same methods

XmlValidator::Validate ( string xml ) : bool