dbTalk Databases Forums  

cannot read xml file all of the sudden

comp.database.ms-access comp.database.ms-access


Discuss cannot read xml file all of the sudden in the comp.database.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Jill
 
Posts: n/a

Default cannot read xml file all of the sudden - 05-09-2005 , 05:07 PM






Hi I am using
ms acces 2002 to read an xml file.
I am using the DOM object in ms access - version xml 4 with service pack 2.
here is the start of the code below. But I am having trouble reading in the
xml file. It seems to be well formed and I was even able to read an earlier
version of the file. This file is a result of being zipped. Could that be
the case? Maybe some invisible chars causing the problem.

How can I test this bit of code. I get no 'Product' nodes returned. Where
as before the file was traversed nicely. It seems the older and new file
were identical, but I cannot read the newer one. What can I do?
The header for both is:

<?xml version="1.0" encoding="UTF-8"?>

Dim test As DOMDocument
Dim nodelist As IXMLDOMNodeList
Dim anode As IXMLDOMNode


Set test = New DOMDocument
test.async = False
test.Load "c:\testxml.xml"

Set nodelist = test.getElementsByTagName("Product")

-------------

Thanks so much




Reply With Quote
  #2  
Old   
Joe Fawcett
 
Posts: n/a

Default Re: cannot read xml file all of the sudden - 05-10-2005 , 02:12 AM






"Jill" <jillfridge (AT) hotmail (DOT) com> wrote

Quote:
Hi I am using
ms acces 2002 to read an xml file.
I am using the DOM object in ms access - version xml 4 with service pack 2.
here is the start of the code below. But I am having trouble reading in the
xml file. It seems to be well formed and I was even able to read an earlier
version of the file. This file is a result of being zipped. Could that be
the case? Maybe some invisible chars causing the problem.

How can I test this bit of code. I get no 'Product' nodes returned. Where as
before the file was traversed nicely. It seems the older and new file were
identical, but I cannot read the newer one. What can I do?
The header for both is:

?xml version="1.0" encoding="UTF-8"?

Dim test As DOMDocument
Dim nodelist As IXMLDOMNodeList
Dim anode As IXMLDOMNode


Set test = New DOMDocument
test.async = False
test.Load "c:\testxml.xml"

Set nodelist = test.getElementsByTagName("Product")

-------------

Thanks so much


Unless you specify the version it's possible you are not using version 4 parser:
Dim test As DOMDocument40
Set test = New DOMDocument40

You'll have to show at least some of the file. Does the latest version of the
file use namespaces whereas the previous ones didn't?

--

Joe (MVP - XML)

https://mvp.support.microsoft.com/pr...8-8741D22D17A5




Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.