ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

XML return error

September 09, 2010 7:34pm

Subscribe [5]
  • #1 / Sep 09, 2010 7:34pm

    Lachlan Munday

    29 posts

    I am creating a simple XML file but it keeps giving me an error message when i try and view the xml file in a browser. When i look at the source it adds 3 blank lines before the xml code.

    This is the code i have in the XML EE code i am using int he XML template

    <?xml version="1.0" encoding="UTF-8" ?>
    <status>
    {exp:weblog:entries weblog="test_status" limit="1" dynamic_start="on" disable="member_data|trackbacks" status="open"}
    {test_status}
    <setvar name="{event_name}" value="{status}" >
    {/test_status}
      {/exp:weblog:entries}
    </status>

    and this is what gets rendered out in the browser

    - blank line - 
    - blank line -
    - blank line -
    <status> 
      <setvar name="reef_hawaiian_pro" value="Over" ><setvar name="cholos_hawaiian_pro" value="On Hold" ><setvar name="oneill_worldcup" value="Up Coming" ><setvar name="gidget_pro" value="Up Coming" ><setvar name="bilabong_pipemasters" value="Up Coming" > 
      </status>

    Note “- blank line -” does not appear on the page

    You can preview the xml file here - http://bit.ly/aw1rzF

    I have even tried adding clean XML from a file i know that works but i still get the same problem.

    Any ideas would be much appreciated.

  • #2 / Sep 10, 2010 4:50am

    John Henry Donovan

    12339 posts

    Lachlan Munday,

    Can I confirm you have the template type set to XML and not the default ‘Web Page’?

  • #3 / Sep 10, 2010 6:37pm

    Lachlan Munday

    29 posts

    yep, 100% sure it is an XML type template

  • #4 / Sep 11, 2010 3:34pm

    Greg Salt

    3988 posts

    Hi Lachlan,

    Are you editing this template within the CP or as an external file?

    Cheers

    Greg

  • #5 / Sep 12, 2010 3:18am

    Lachlan Munday

    29 posts

    Hi Greg,

    I have tried both. I have downloaded it and edited it, and also tried using the in built template editor.

    Any ideas?

    Thanks,

    Lachlan

  • #6 / Sep 12, 2010 5:24pm

    Greg Salt

    3988 posts

    Hi Lachlan,

    Does your editor have the ability to show hidden (invisible) characters? If so, have you made sure that there aren’t any unusual characters at the beginning of the file? Please also confirm which version and build you are using.

    Cheers

    Greg

  • #7 / Sep 13, 2010 6:44pm

    Lachlan Munday

    29 posts

    Hi Greg,

    I have used Dreamweaver and also TextEdit and tried clearing all white space so the file only has the xml code i want but it still ends up with 3 blank lines.

    I have attached the file if that helps.

    Thanks,

    Lachlan

  • #8 / Sep 14, 2010 3:34pm

    Ingmar

    29245 posts

    Can you try with a new template? Put nothing but “test” in there, in the first line. When you view that via your browser, are you getting leading white space again?

  • #9 / Sep 14, 2010 7:05pm

    Lachlan Munday

    29 posts

    Yep, still get the 3 blank lines - http://bit.ly/bph4qS

    Sorry I forgot to mention i am using install v1.6.9

    thanks

  • #10 / Sep 15, 2010 8:38am

    Sue Crocker

    26054 posts

    Which version/build of EE1.x are you using? Any sort of extensions?

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases