Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 299
  • Last Modified:

ENTITY causing document load to fail

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
touch-base
Asked:
touch-base
  • 2
  • 2
2 Solutions
 
gpizzutoCommented:
Try to type CLIENT in lower case
0
 
touch-baseAuthor Commented:
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
 
zc2Commented:
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
 
touch-baseAuthor Commented:
Sorry for delay in getting back; the validateonparse setting makes no difference.
0
 
zc2Commented:
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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now