[rt-users] Blank line in output affecting XML

Peterson, Erik epeterson at edc.org
Fri Jan 5 09:59:31 EST 2007


I have seen this before, but can't trace where it's coming from and I
searched high and low.  When I try to output an XML file (like
/Search/Results.rdf), I am getting an error:

>XML Parsing Error: xml declaration not at start of external entity
>Location: http://rtdev/Search/test.xml
>Line Number 2, Column 1:
><?xml version="1.0" encoding="UTF-8"?>
>^

Because no matter what I output, the declaration is starting on line 2 of
the output.  Then I noticed that this happens on all pages, but HTML doesn't
care as much that the doctype declaration or html element are on the very
first line...  However, XML does.  If I save the file, kill the first line
and reload it, it's fine.

I made the following completely simple file to output which has no RT calls
at all (except that it's in the RT root, so handled by webmux.pl and
RT::Mason).  I stuck it in local/html/Search/test.xml and it returns the
above error.

#--begin code snippet --
<%INIT>
  $r->content_type('application/xml');

  print <<EOF;
<?xml version="1.0" encoding="UTF-8"?>
<test>
  <element>simple test</element>
</test>
EOF

  $m->abort();
</%INIT>
#--end code snippet --

This must not be a problem for all since RSS has been around in RT for a
couple of versions, so I'm assuming that I have some module that is above
the "required" version, but is still causing this problem.  Can anyone point
me to the right place to figure this out?

RT 3.6.3rc4
Perl 5.8.8
Mod_perl 2.0.2
HTML::Mason 1.3.5
(I can list others if anyone can tell me which ones to be looking at).

Thanks
Erik

--
Erik Peterson
Education Development Center, Inc.
 




More information about the rt-users mailing list