Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Validatingreader is obsolete

Validatingreader is obsolete

Scheduled Pinned Locked Moved ASP.NET
xmlhelpcsharpdatabase
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • I Offline
    I Offline
    ishwarya mahadevan
    wrote on last edited by
    #1

    Hi, I m currently developing a project on Xml Editor in vb.net...While trying to validate the xml against dtd i m getting the following error : XmlValidatingReader is obsolete. I tried using XmlReaderSettings but its showing an error saying that "The XmlSchemaSet on the document is either null or has no schemas in it. Provide schema information before calling Validate." This is the coding i ve written : Dim xmlV As New XmlDocument Dim xmlP As New XmlTextReader(TempFile) Dim settings As New XmlReaderSettings Dim eventhandler As ValidationEventHandler eventhandler = New ValidationEventHandler(AddressOf WriteErrorLog) xmlV.Validate(eventhandler) settings.ValidationType = ValidationType.DTD settings.ProhibitDtd = False Dim reader As XmlReader reader = XmlReader.Create(xmlP, settings) xmlV.Load(reader) ErrStr = "" ListBox1.Items.Clear() IsValid = True Do Try If reader.Read() Then lineInf = CType(xmlV, IXmlLineInfo) End If Catch exx As Exception Try IsValid = False If lineInf.HasLineInfo Then ErrStr = lineInf.LineNumber.ToString + ": " + lineInf.LinePosition.ToString + " " + exx.Message End If If exx.Message.IndexOf("EndElement") > 1 Then Exit Do End If ListBox1.Items.Add(ErrStr) Catch eeex As Exception MsgBox("Some unexpected error occurred " + vbNewLine + eeex.Message, MsgBoxStyle.Information, "Error") Exit Do End Try End Try Loop While Not xmlP.EOF reader.Close() xmlP.Close() Me.Cursor = System.Windows.Forms.Cursors.Default If IsValid = False Then MsgBox("File is not valid", MsgBoxStyle.Exclamation, "Error") Else MsgBox("File is valid", MsgBoxStyle.Information, "OK") End If End Sub Can anyone pls help me out in finding the error??? THanks in advance.

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups