Solved

ENTITY causing document load to fail

Posted on 2012-03-16
5
295 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 8

Expert Comment

by:gpizzuto
ID: 37728756
Try to type CLIENT in lower case
0
 
LVL 1

Author Comment

by:touch-base
ID: 37728766
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
ID: 37729537
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
ID: 37794926
Sorry for delay in getting back; the validateonparse setting makes no difference.
0
 
LVL 18

Accepted Solution

by:
zc2 earned 200 total points
ID: 37796491
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

How Do You Stack Up Against Your Peers?

With today’s modern enterprise so dependent on digital infrastructures, the impact of major incidents has increased dramatically. Grab the report now to gain insight into how your organization ranks against your peers and learn best-in-class strategies to resolve incidents.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
The Client Need Led Us to RSS I recently had an investment company ask me how they might notify their constituents about their newsworthy publications.  Probably you would think "Facebook" or "Twitter" but this is an interesting client.  Their cons…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

734 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