|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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. |
|
#2
|
|||
|
|||
|
It means that you have more than one top-level element.
All well-formed XML files have a single top-level element. |
|
#3
|
|||
|
|||
|
Where would I check that I have a single top-level element?
|
|
#4
|
||||
|
||||
|
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> |
|
#5
|
|||
|
|||
|
I've attached the file. Thanks for your help.
|
|
#6
|
||||
|
||||
|
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> |
|
#7
|
|||
|
|||
|
Thank you.
I did what you said but still the same page I get... ![]() |
|
#8
|
||||
|
||||
|
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? |
|
#9
|
|||
|
|||
|
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 ![]() |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > XML Programming > Error with top level element... |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|