Forum Moderators: open

Message Too Old, No Replies

xml error

new window

         

adamnichols45

9:42 pm on Apr 20, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



i get this error can anybody help?

im trying to open up a new window using javascript!

The XML page cannot be displayed
Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later.

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

Only one top level element is allowed in an XML document. Error processing resource 'http://localhost/aa/gallery2/index.php'. Line 61, Position 4

<body onload="setImage(0);">
---^

choster

10:24 pm on Apr 20, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The error most likely generated by your browser, and simply indicates your document is not well-formed XML. It is not well-formed because of precisely the error indicated: only one top-level element is allowed. Your browser's XML parser assumed <body> is supposed to be the top-level element, but then it found a sibling element. Either remove the sibling(s) or wrap <body> and the siblings in another element.

illegal example
<?xml version="1.0" encoding="UTF-8"?>
<body>
<heading />
<subheading />
</body>
<footer>
<colophon />
</footer>

well-formed example
<?xml version="1.0" encoding="UTF-8"?>
<document>
<body>
<heading />
<subheading />
</body>
<footer>
<colophon />
</footer>
</document>

another well-formed example
<?xml version="1.0" encoding="UTF-8"?>
<document>
<body>
<heading />
<subheading />
<footer>
<colophon />
</footer>
</body>

choster

1:50 pm on Apr 21, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



It was pointed out my second example is missing a closing </document>. Mea culpa!