Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

loadXML not loading

Status
Not open for further replies.

Smith3

Programmer
Nov 24, 2003
8
US
Hello All,

I have an ASP page that performs an sql call to get data for a second sql call. The first loads fine but when I try to load the second set of xml data the load is unsuccessful. Here is the line to load the xml data...

success = objXmlData.loadXML(objXmlHttp.responseXML.xml)

This returns true on the first sql call but false on the second. Does anyone have any ideas I can try?

Smith
 
the only way is to load on another variable, or to release the old one and to initialize it again

Ion Filipski
1c.bmp
 
How do I release the old variable and initialize it again? Which variable do I do this to?

Thanks for the help!

Smith3
 
objXmlData = 0;//if is autopointer

objXmlData->Release()

CoCreateInstance....objXmlData...

important is what there is no method to unload xml

Ion Filipski
1c.bmp
 
I tried this and the load still didn't work.

objXmlData = 0
rootNode = 0
var objXmlData = Server.CreateObject("MSXML2.DOMDocument")

I even tried to create a new variable call objXmlData2 and the still failed.

Is there something that I am missing?

Smith3
 
maybe the xml you try to load is not well formed, whch language are you using?

To release an OLE pointer in VB you shoudld do:

set theobj = null

but anyway, if the XML you try to load is not well formed it will not load.

Ion Filipski
1c.bmp
 
I noticed that before each string column I have a space. Would that do it? I know "&" will but will spaces?

Here is the xml file...

<?xml version=&quot;1.0&quot;?><ResultSet><Row><Column>204</Column><Column> TTL FIXED ASSETS</Column><Column>5011053.41</Column></Row><Row><Column>204</Column><Column> TTL INC EARNED NOT COLLECTED</Column><Column>1696580.49</Column></Row><Row><Column>204</Column><Column> TTL OTHER ASSETS</Column><Column>4093116.86</Column></Row><Row><Column>204</Column><Column> TTL CASH & DUE FROM BANKS</Column><Column>9583128.26</Column></Row><Row><Column>204</Column><Column> TTL EARNING ASSETS</Column><Column>263553195.11</Column></Row></ResultSet>

Smith3
 
I don't believe spaces in your case does not generate problems. In many cases spaces are just ignored.

Ion Filipski
1c.bmp
 
Can you explain this to me? I wasn't getting this error before but now I am getting....

Whitespace is not allowed at this location. Error processing resource ' Line 1, Position 365

Where do I look for Line 1, Position 365 in the xml string?

Smith3
 
in any text editor, look at first line and find the character 365

Ion Filipski
1c.bmp
 
I figured it out. There was an &quot;&&quot; in one of my columns. I used the .replace(&quot;&&quot;,&quot;&amp;&quot;) method and everything is great!

Thanks for you help!!!

Smith
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top