Can anybody suggest me how to validate xml against the DTD in vb


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Can anybody suggest me how to validate xml against the DTD in vb

  1. #1
    AshIndia Guest

    Can anybody suggest me how to validate xml against the DTD in vb


    I am working on the xml DOM Document , I have successfully tested the xml
    file With the XML spy against the DTD. I want to know the similar functionality
    in the vb to validate against the DTD. Can anybody suggest me.
    Thanking you
    Ash

  2. #2
    JD Guest

    Re: Can anybody suggest me how to validate xml against the DTD in vb


    First, create a DOMDocument object:
    Set oDoc = New MSXML.DomDocument
    Prepare the document for validation
    oDoc.validateOnParse = True 'validate against DTD
    oDoc.resolveExternals = True 'use external references (parameter entities,
    etc.)

    Load your XML file:
    oDoc.load ("file.xml")

    If oDoc.parseError.ErrorCode <> 0 Then ' if any error
    MsgBox oDoc.parseError.ErrorCode
    Else
    MsgBox "No Errors!"
    End If

    Hope this helps,
    J


    "AshIndia" <ashokpas@yahoo.com> wrote:
    >
    >I am working on the xml DOM Document , I have successfully tested the xml
    >file With the XML spy against the DTD. I want to know the similar functionality
    >in the vb to validate against the DTD. Can anybody suggest me.
    >Thanking you
    >Ash





Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center