Solved

ENTITY causing document load to fail

Posted on 2012-03-16
5
286 Views
Last Modified: 2012-04-03
It appears that the following fails to load the document after I include ENTITY declarations in the XML document:

Dim oXML
Set oXML = Server.CreateObject("Msxml2.DOMDocument")
oXML.async = false
oXML.setProperty "SelectionLanguage", "XPath"
oXML.load("c:\xml\myxml.xml")

Open in new window


Here's the doc:

<?xml version="1.0" ?>
<!DOCTYPE configuration [
  <!ENTITY CLIENT "Bob Smith Motors">
]>
<details>
	<client>&CLIENT;</client>
</details>

Open in new window

0
Comment
Question by:touch-base
  • 2
  • 2
5 Comments
 
LVL 8

Expert Comment

by:gpizzuto
Comment Utility
Try to type CLIENT in lower case
0
 
LVL 1

Author Comment

by:touch-base
Comment Utility
The XML snippet (which is just an example from a much bigger file which contains many mixed case names) loads & renders fine in IE, FF or Chrome...
0
 
LVL 18

Assisted Solution

by:zc2
zc2 earned 200 total points
Comment Utility
try to turn off the xml validation on load
oXML.validateonparse=false

Open in new window


about the property: http://msdn.microsoft.com/en-us/library/ms762791.aspx
0
 
LVL 1

Author Comment

by:touch-base
Comment Utility
Sorry for delay in getting back; the validateonparse setting makes no difference.
0
 
LVL 18

Accepted Solution

by:
zc2 earned 200 total points
Comment Utility
If the XML object you working with is v6, you should also set this property:
oXML.setProperty "ProhibitDTD", false

Open in new window


as a side advice, try to print out the error messages, it will let you figure out what's going wrong:

if oXML.parseError.errorCode <> 0 then
   Response.Write "Error: " & oXML.parseError.errorCode & " Reason: " & oXML.parseError.reason )
end if

Open in new window

0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Hello again, all.  For those of you that have been following along, you'll know that this is my third article on this topic (though it is not Part III).  This article is sort of remedial, and probably the topic with which I should have started the s…
Well hello again!  Glad to see you've made it this far without giving up.  In this, the fourth installment of my popular series, I'm going to cover functions and subroutines, what they are, and why they are useful.  Just in case you stumbled onto th…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now