| View previous topic :: View next topic |
| Author |
Message |
sham Guest
|
Posted: Thu Oct 05, 2006 10:08 pm Post subject: XML document must have a top level element upgrade |
|
|
Hi to all,
We have an application that has been working fine for months. I believe the
client has updated some of the software on the box and we are now getting
the error "XML document must have a top level element" in our application.
I have checked the msxml3.dll on the box and it is a different version of
the dll on my machine (which does not raise an exception). I have upgraded
the dlls on the box (by running the msi file) but I still get the error.
Any ideas where else to look?
Sham. |
|
| Back to top |
|
 |
Remy Lebeau (TeamB) Guest
|
Posted: Thu Oct 05, 2006 11:11 pm Post subject: Re: XML document must have a top level element upgrade |
|
|
"sham" <shamresh (AT) inspirationmatters (DOT) com> wrote in message
news:45253bbe$1 (AT) newsgroups (DOT) borland.com...
| Quote: | We have an application that has been working fine for months. I believe
the
client has updated some of the software on the box and we are now getting
the error "XML document must have a top level element" in our application.
|
Then the XML is likely malformed. Please show the actual XML, and your code
that is loading it.
Gambit |
|
| Back to top |
|
 |
Don Siders Guest
|
Posted: Thu Oct 05, 2006 11:27 pm Post subject: Re: XML document must have a top level element upgrade |
|
|
| Quote: | We have an application that has been working fine for months. I believe
the
client has updated some of the software on the box and we are now getting
the error "XML document must have a top level element" in our application.
Any ideas where else to look?
|
Using what? MSXML? TXMLDocument?
If the document is really an XML fragment with no root node, you'll have to
set IXMLDOMDocument.validateOnParse to False. It will report well-formed
XML errors, but it will allow the document fragment.
If you're using TXMLDocument, make sure it *does not* include
poResolveExternals or poValidateOnParse in its' ParseOptions property.
My guess is that this is a symptom of something that has changed in the data
or the process.
hth... |
|
| Back to top |
|
 |
sham Guest
|
Posted: Fri Oct 06, 2006 12:10 am Post subject: Re: XML document must have a top level element upgrade |
|
|
Thanks guys for the replies.
I am using MSXML dom.
I can run the same exe on my machine and it works.
But on another machine it gives an error.
From that I would have assumed that it was an msxml dll version problem.
Could it be this?
Sham.
"Don Siders" <dsiders (AT) charter (DOT) net> wrote in message
news:45254e93 (AT) newsgroups (DOT) borland.com...
| Quote: |
We have an application that has been working fine for months. I believe
the
client has updated some of the software on the box and we are now getting
the error "XML document must have a top level element" in our
application.
Any ideas where else to look?
Using what? MSXML? TXMLDocument?
If the document is really an XML fragment with no root node, you'll have
to set IXMLDOMDocument.validateOnParse to False. It will report
well-formed XML errors, but it will allow the document fragment.
If you're using TXMLDocument, make sure it *does not* include
poResolveExternals or poValidateOnParse in its' ParseOptions property.
My guess is that this is a symptom of something that has changed in the
data or the process.
hth...
|
|
|
| Back to top |
|
 |
Remy Lebeau (TeamB) Guest
|
Posted: Fri Oct 06, 2006 12:17 am Post subject: Re: XML document must have a top level element upgrade |
|
|
"sham" <shamresh (AT) inspirationmatters (DOT) com> wrote in message
news:45255866$1 (AT) newsgroups (DOT) borland.com...
| Quote: | I am using MSXML dom.
I can run the same exe on my machine and it works.
But on another machine it gives an error.
|
Again, please show the actual XML that is causing the error.
Gambit |
|
| Back to top |
|
 |
sham Guest
|
Posted: Fri Oct 06, 2006 8:12 am Post subject: Re: XML document must have a top level element upgrade |
|
|
Hi,
The xml is :
<?xml version="1.0"?>
<RESULT><Playlist><PlaylistComposerID>92</PlaylistComposerID><Items><Item><ItemUniqueID>149DA02E-41F1-48C9-9F8B-2AED256DEE9F</ItemUniqueID><Properties><ItemStringProperty><Name>BodyText</Name><Value>Merseyside
Police spoke to City boss Stuart Pearce about BartonThe Football Association
has charged Manchester City midfielder Joey Barton after he bared his
backside at Everton fans during the 1-1 draw on
Saturday.</Value></ItemStringProperty><ItemStringProperty><Name>Headline</Name><Value>FA
hands Barton disrepute
charge</Value></ItemStringProperty></Properties></Item><Item><ItemUniqueID>B1CA8DB6-C79F-4A79-810A-F946894B52AC</ItemUniqueID><Properties><ItemStringProperty><Name>BodyText</Name><Value>Tottenham
Hotspur overcame a frustrating night to beat Slavia Prague 1-0 at White Hart
Lane to record a 2-0 aggregate triumph in the first round of the Uefa
Cup.</Value></ItemStringProperty><ItemStringProperty><Name>Headline</Name><Value>Keane
ends Spurs'
drought</Value></ItemStringProperty></Properties></Item><Item><ItemUniqueID>04E75D7F-291F-4679-B63C-FE83A284DC63</ItemUniqueID><Properties><ItemStringProperty><Name>BodyText</Name><Value>McBride
has featured in all seven of Fulham's league gamesFulham striker Brian
McBride has revealed his slow start to the season was caused by a
virus.</Value></ItemStringProperty><ItemStringProperty><Name>Headline</Name><Value>Struggling
McBride hit by
virus</Value></ItemStringProperty></Properties></Item><Item><ItemUniqueID>6A796BCC-DCC4-4809-8E81-2A8CA48379E9</ItemUniqueID><Properties><ItemStringProperty><Name>BodyText</Name><Value>Manchester
United's trio of French stars admit Sir Alex Ferguson's famous dressing room
rants have taken a lot of getting used to. The fiery Scot's 'hairdryer'
treatment has become a thing of legend over his 20-year stint at Old
Trafford.</Value></ItemStringProperty><ItemStringProperty><Name>Headline</Name><Value>Fergie's
fearful, insist
trio</Value></ItemStringProperty></Properties></Item><Item><ItemUniqueID>361F8F3E-5A68-43E4-BD6D-55BE13879093</ItemUniqueID><Properties><ItemStringProperty><Name>BodyText</Name><Value>Chelsea
are ready to run another check on rising Olympiakos star Nery Alberto
Castillo.</Value></ItemStringProperty><ItemStringProperty><Name>Headline</Name><Value>Chelsea
to check on
Castillo</Value></ItemStringProperty></Properties></Item></Items></Playlist></RESULT>
As I mentioned before, the app is working on all the other machines except
one.
Also, this xml is passed from one app to another via a web service call.
Could that have something to do with it? (i.e. could there be some web
service dll that is different on the machine that is causing the problem)
Sham.
"Remy Lebeau (TeamB)" <no.spam (AT) no (DOT) spam.com> wrote in message
news:45255acc$1 (AT) newsgroups (DOT) borland.com...
| Quote: |
"sham" <shamresh (AT) inspirationmatters (DOT) com> wrote in message
news:45255866$1 (AT) newsgroups (DOT) borland.com...
I am using MSXML dom.
I can run the same exe on my machine and it works.
But on another machine it gives an error.
Again, please show the actual XML that is causing the error.
Gambit
|
|
|
| Back to top |
|
 |
Remy Lebeau (TeamB) Guest
|
Posted: Fri Oct 06, 2006 1:33 pm Post subject: Re: XML document must have a top level element upgrade |
|
|
"sham" <shamresh (AT) inspirationmatters (DOT) com> wrote in message
news:4525f942 (AT) newsgroups (DOT) borland.com...
There is nothing wrong with that XML. You should not be having any problems
loading it.
| Quote: | Also, this xml is passed from one app to another via a web service
call. Could that have something to do with it? (i.e. could there be
some web service dll that is different on the machine that is causing
the problem)
|
Maybe the XML be getting corrupted during transmission? That is the only
thing I can think of right now.
Gambit |
|
| Back to top |
|
 |
matthias muntwiler Guest
|
Posted: Fri Oct 06, 2006 7:00 pm Post subject: Re: XML document must have a top level element upgrade |
|
|
sham wrote:
| Quote: |
The xml is :
?xml version="1.0"?
[...]
|
check whether the file has a wrong byte order mark [1]. some programs
that use msxml add a wrong BOM which they cannot read afterwards.
it might help to specify the encoding explicitly.
[1] http://en.wikipedia.org/wiki/Byte_Order_Mark
you need a binary editor to check this since most text editors strip off
or add the BOM silently.
-matthias |
|
| Back to top |
|
 |
|