Results 1 to 2 of 2

Thread: Msxml2.DOMDocument.5.0 - parsing an XML file

  1. #1
    Taz
    Taz is offline
    Senior Member Taz's Avatar
    Join Date
    Jan 2005
    Location
    London
    Posts
    2,152
    Thanks
    57
    Thanked
    29 times in 27 posts
    • Taz's system
      • Motherboard:
      • Gigabyte Z270 HD3P
      • CPU:
      • Intel Core i5 7600K
      • Memory:
      • Corsair CMK16GX4M2B3200C16R Vengeance LPX 16 GB
      • Storage:
      • Samsung 960 EVO M.2-2280 500GB (PCIe) + 1TB Sandisk Ultra II SSD (SATA)
      • Graphics card(s):
      • Asus NVIDIA GeForce GTX 1070 OC
      • PSU:
      • Corsair CS550M 550W Hybrid
      • Case:
      • NZXT Source 340
      • Operating System:
      • Windows 10 Pro
      • Monitor(s):
      • 34" Asus Designo Curve MX34VQ UWQHD Monitor
      • Internet:
      • Virgin Media M350

    Msxml2.DOMDocument.5.0 - parsing an XML file

    I've created a VBscript to validate an XML file. The essence of the XML validation consists of the following code:

    . . .

    Set xmlDoc = CreateObject("Msxml2.DOMDocument.5.0")
    xmlDoc.validateOnParse = True
    xmlDoc.async = False
    xmlDoc.load(sbrpFilename)

    If xmlDoc.parseError.errocode <> 0 Then
    . . .<error handler here>. . .

    . . .

    sbrpFilename is just a string to the XML file that needs to be validated. Now, this works fine under nearly all circumstances. I've had an enhancement request to modify the VBscript as the XML file that needs to be validated contains a DTD directive as follows (i've left out some of the detail):

    <!DOCTYPE ... http://.../config_1_0.dtd">

    This means that the XML parsing requires access to an external Web site (referenced in the URL) to retrieve the 'schema' for the XML document. Is it possible to get the XML parser to ignore the <!DOCTYPE> and DTD directive?

    I just need to be able to do a basic XML validation without retrieving anything from the Internet (as the PC that runs my VBscript is not allowed Internet connectivity).

    I'm hoping that I can just set a property in the xmlDoc object to do this.

  2. #2
    Large Member
    Join Date
    Apr 2004
    Posts
    3,720
    Thanks
    47
    Thanked
    99 times in 64 posts
    I'm guessing the easiest way is to download the dtd/schema and reference it locally from your doctype.
    To err is human. To really foul things up ... you need a computer.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 63
    Last Post: 14-11-2011, 09:17 AM
  2. Need help on my maxtor harddrives
    By arthurleung in forum PC Hardware and Components
    Replies: 10
    Last Post: 12-06-2007, 09:40 PM
  3. Multiple problems - help!
    By Ruggerbugger in forum Help! Quick Relief From Tech Headaches
    Replies: 7
    Last Post: 18-08-2006, 11:41 PM
  4. Nero or Burner ?
    By Foxile in forum Help! Quick Relief From Tech Headaches
    Replies: 30
    Last Post: 04-04-2005, 07:31 AM
  5. Dodgy DVD-r's ?
    By starside in forum Help! Quick Relief From Tech Headaches
    Replies: 12
    Last Post: 27-03-2005, 06:11 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •