DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 2 of 2
  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





Bookmarks

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


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links