XML Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreXML Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old February 14th, 2004, 09:44 PM
ramillica ramillica is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Posts: 13 ramillica User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Error with top level element...

I'm getting this error whenever I open buildCommon.xml file:


Only one top level element is allowed in an XML document. Error processing resource 'file:///C:/buildCommon.xml'. Line 4, Position 4

<property name="antRoot" value="${toolDir}/Ant"/>
---^


Thank you.

Reply With Quote
  #2  
Old February 15th, 2004, 06:53 AM
fpmurphy fpmurphy is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Location: USA
Posts: 282 fpmurphy User rank is Corporal (100 - 500 Reputation Level)fpmurphy User rank is Corporal (100 - 500 Reputation Level)fpmurphy User rank is Corporal (100 - 500 Reputation Level)fpmurphy User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 1 Day 2 h 30 m 42 sec
Reputation Power: 6
It means that you have more than one top-level element.
All well-formed XML files have a single top-level element.

Reply With Quote
  #3  
Old February 15th, 2004, 07:07 AM
ramillica ramillica is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Posts: 13 ramillica User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Where would I check that I have a single top-level element?

Reply With Quote
  #4  
Old February 15th, 2004, 09:20 AM
MattSidesinger's Avatar
MattSidesinger MattSidesinger is offline
Java PHP Oracle Developer
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Location: C-Bus OH-IO
Posts: 204 MattSidesinger User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 15 m 26 sec
Reputation Power: 5
Send a message via AIM to MattSidesinger
I guess just send us buildCommon.xml and we can point it out.

or here is an illegal example:
Code:
<?xml version="1.0"?>
<topLevelElement1>
</topLevelElement1>
<topLevelElement2>
</topLevelElement2>

Reply With Quote
  #5  
Old February 15th, 2004, 09:34 AM
ramillica ramillica is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Posts: 13 ramillica User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I've attached the file. Thanks for your help.
Attached Files
File Type: txt buildCommon.txt (5.2 KB, 293 views)

Reply With Quote
  #6  
Old February 15th, 2004, 10:25 AM
MattSidesinger's Avatar
MattSidesinger MattSidesinger is offline
Java PHP Oracle Developer
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Location: C-Bus OH-IO
Posts: 204 MattSidesinger User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 15 m 26 sec
Reputation Power: 5
Send a message via AIM to MattSidesinger
You need to wrap all of that XML in a top-level element:

<buildCommon>
... the document as it is right now can go here ...
</buildCommon>

Reply With Quote
  #7  
Old February 15th, 2004, 11:42 AM
ramillica ramillica is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Posts: 13 ramillica User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thank you.

I did what you said but still the same page I get...

Reply With Quote
  #8  
Old February 16th, 2004, 07:19 AM
MattSidesinger's Avatar
MattSidesinger MattSidesinger is offline
Java PHP Oracle Developer
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Location: C-Bus OH-IO
Posts: 204 MattSidesinger User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 15 m 26 sec
Reputation Power: 5
Send a message via AIM to MattSidesinger
In my Komodo editor, it complains about the same like by underlining it with a red sauigly line. I add top level element placing everything inside it, including the comment, and I made sure that the top level element was also closed at the bottom of the document.

This took care of the problem.

If it doesn't do it for you I would try added a <?xml version="1.0"?> to the top of the document. You say that you are opening the XML file ... with what are you opening it with, including version?

Reply With Quote
  #9  
Old February 19th, 2004, 12:52 PM
ramillica ramillica is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Posts: 13 ramillica User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I put this:

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

<buildCommon>

...
..
...

</buildCommon>

I simply double clicked on the buildCommon.xml and this time a bunch of code appeared which is the actual code in the file but coloured. Is this correct now?

Thank you

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreXML Programming > Error with top level element...


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway
Stay green...Green IT