a strange error while trying to validate an XML document

14 views
Skip to first unread message

Jonathan Sion

unread,
Aug 28, 2008, 12:16:59 PM8/28/08
to DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web Services,.NET Remoting
Hi,
i have a basic XML file which i am trying to validate. i get the
error:

"An element or attribute information item has already been validated
from the '' namespace. It is an error if 'xsi:schemaLocation',
'xsi:noNamespaceSchemaLocation', or an inline schema occurs for that
namespace."

anybody knows why?? the code i am using is: (pretty basic, simply
setting options and reading the file)

thanks!
------------------------------------------------------------------------------------------

Dim oSettings As New XmlReaderSettings
oSettings.ValidationType = ValidationType.Schema
oSettings.ValidationFlags =
XmlSchemaValidationFlags.ProcessInlineSchema Or _

XmlSchemaValidationFlags.ReportValidationWarnings Or _

XmlSchemaValidationFlags.AllowXmlAttributes


Dim reader As XmlReader = XmlReader.Create(sFileName,
oSettings)


AddHandler oSettings.ValidationEventHandler, AddressOf
ValidationHandler

While Reader.Read()
' Reads the whole file and will call the validation
' handler subroutine if an error is detected. Doing
' it this way allows us to pick out ALL of the errors
' from the XML, rather than bombing out on the first
' one.
End While

Reply all
Reply to author
Forward
0 new messages