dcsimg


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: validating xml agains xsd

Threaded View

  1. #1
    Join Date
    Jul 2008
    Posts
    32

    Question validating xml agains xsd

    reference
    http://forums.devx.com/archive/index.php/t-97477.html

    in vb 6.0 i am using msxml4 for validating against the xsd

    this is the code i have
    Code:
    Dim xmlschema As MSXML2.XMLSchemaCache40
            Dim objXML As MSXML2.DOMDocument40
            Dim xmldom As MSXML2.DOMDocument40
    'Dim xmlschema As MSXML2.XMLSchemaCache30
    Set xmlschema = New MSXML2.XMLSchemaCache40
    xmlschema.Add "abc", "c:\xml\schema.xsd"
    
    'Create an XML DOMDocument object.
    
    Set xmldom = New MSXML2.DOMDocument40
    
    'Assign the schema cache to the DOM document.
    'schemas collection.
    Set xmldom.schemas = xmlschema
    
    'Load books.xml as the DOM document.
    xmldom.async = False
    xmldom.Load "c:\xml\12.xml"
    
    'Return validation results in message to the user.
    If xmldom.parseError.errorCode <> 0 Then
         MsgBox xmldom.parseError.errorCode & " " & _
         xmldom.parseError.reason
    Else
         MsgBox "No Error"
    End If
    Exit Sub
    ErrHandler:
    MsgBox (Err.Description)
    xmlschema.Add "abc", "c:\xml\schema.xsd" in this line i just added abc, is anything frmxsd file to be referenced over there


    when i run it i am getting error ---------------------------
    Project1
    ---------------------------
    -2146697210 The system cannot locate the object specified.


    ---------------------------
    OK
    ---------------------------

    how to resolve it
    & if the sml is not matching te xsd it shld throw a proper error msg with the reason
    Last edited by Hack; 12-20-2010 at 06:33 AM. Reason: Added Code Tags

Similar Threads

  1. validating XML against given XSD
    By svibuk in forum XML
    Replies: 3
    Last Post: 11-15-2010, 06:35 AM
  2. Replies: 1
    Last Post: 10-20-2010, 10:50 AM
  3. Validating XML fragment against schema
    By teclioness in forum .NET
    Replies: 0
    Last Post: 10-07-2005, 07:10 AM
  4. Try XML Junction
    By Tim in forum xml.announcements
    Replies: 0
    Last Post: 10-11-2001, 04:00 PM
  5. Data Junction Announces XML Junction 7.51
    By Tim Frost in forum xml.announcements
    Replies: 0
    Last Post: 04-02-2001, 10:53 AM

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