Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

ENTITY causing document load to fail

Posted on 2012-03-16
5
Medium Priority
?
297 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 19

Assisted Solution

by:zc2
zc2 earned 600 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 19

Accepted Solution

by:
zc2 earned 600 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction In my previous article (http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SSIS/A_9150-Loading-XML-Using-SSIS.html) I showed you how the XML Source component can be used to load XML files into a SQL Server database, us…
Many times as a report developer I've been asked to display normalized data such as three rows with values Jack, Joe, and Bob as a single comma-separated string such as 'Jack, Joe, Bob', and vice versa.  Here's how to do it. 
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…

704 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