Home
TeamSite
XML Parse Error
cliffhanger
Hello,
I am getting "xml not well-formed error" when I don't see any reason for it. Can somebody please help?
Thanks
-cliffhanger
This is how the Presentation template looks like:
<?xml version="1.0" encoding="UTF-8"?>
<iw_pt name="Media Library Home">
<HTML>
<BODY>
<table>
<tr>
<td width="10"></td>
<td class="default" vAlign="top" width="596">
<table width="596" cellpadding="0" cellspacing="0" border="0">
<tr>
<td width="200" valign="top" class="default">
<iw_value name = 'dcr.Introduction.PageIntroduction'/>
</td>
<td width="396" valign="top" align="middle">
<img src="<iw_value name='dcr.Introduction.ImageFile'/>">
</td>
</tr>
</table>
</td>
</tr>
</table>
</BODY>
</HTML>
</iw_pt>
the error it gives is such:
XML parse error:
not well-formed (invalid token) at line 18, column 17, byte 515 at F:\Apps\iw-home\iw-perl\vendor\lib/XML/Parser.pm line 187
Find more posts tagged with
Comments
herald10
Replace the line:
<iw_pt name="Media Library Home">
with
<iw_pt name="Media Library Home"
/
>
cliffhanger
tried that, but didn't help
It says the error is with the line "img src....."
herald10
Ok then did you try the following:
<iw_pt name="Media Library Home">
<![CDATA[
<HTML>
<BODY>
...
]]>
herald10
Better yet try:
<img src="{iw_value name='dcr.Introduction.ImageFile'/}">
or
<img src='{iw_value name="dcr.Introduction.ImageFile"/}'>
cliffhanger
Hi,
Thanks! Putting the CDATA tag did it...wonder why! In a very similar template I did without CDATA tag and it didn't complain at that time....
Thanks again,
Cliffhanger
Migrateduser
Check the other template - you probably used proper empty tag syntax for the <IMG /> tag in that one. What you have in the above:
<img src="<iw_value name='dcr.Introduction.ImageFile'/>">
has no closing tag for <img>.
Adam Stoller
To summarize what a few others have already said:
If you don't want to use CDATA tags - use an empty element for the iw_pt tag rather than maing it a container tag.
Use curly-brace notation for iw-tags that are embedded within other tag specifications
Try to use XHTML-compliant coding - specifically with elements like
br
,
hr
,
img
, and
link
<?xml version="1.0" encoding="UTF-8"?>
<iw_pt name="Media Library Home"
/
>
<HTML>
<BODY>
<table>
<tr>
<td width="10"></td>
<td class="default" vAlign="top" width="596">
<table width="596" cellpadding="0" cellspacing="0" border="0">
<tr>
<td width="200" valign="top" class="default">
<iw_value name = 'dcr.Introduction.PageIntroduction'/>
</td>
<td width="396" valign="top" align="middle">
<img src="
{
iw_value name='dcr.Introduction.ImageFile'/
}
"
/
>
</td>
</tr>
</table>
</td>
</tr>
</table>
</BODY>
</HTML>
<!-- Remove: </iw_pt> -->
You also should probably use "html" and "body" rather than "HTML" and "BODY" - but that's more stylistic than required.
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com