0

I'm getting unnecessary space in my source code when executing the main page. No clue from where this space is coming from. It was coded using TYPO3 Flow (formerly Flow3) concepts. I need to call one XML file - but because of the blank spaces it doesn't satisfy the xml rules

It showing 27 blank lines, and in the 27th line it starts to display the markup, just like this layout:

 ...
 ...
 24
 25
 26
 27 <!DOCTYPE html>
 28   <head>
 29      <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
 30      <title>REST Test</title>
 ...
 ...
Richard J. Ross III
  • 55,009
  • 24
  • 135
  • 201
sherin
  • 1,091
  • 2
  • 17
  • 27

3 Answers3

1

Use a plugin (like TS Tidy) or similar.

Any similar plugin will format your HTML when its rendered by the server and before it is sent to the browser. Remove blank lines, indent tags, etc. Most of these plugins, in any engine or language, are based on the venerable HTMLTidy/XMLTidy.

Freiheit
  • 8,408
  • 6
  • 59
  • 101
  • Readers, please note that this is not a TYPO3 CMS installation, but an independent application based on Flow3 / TYPO3 Flow. Extensions might therefore not be suitable. However, using *Tidy* is a valuable suggestion. – Mateng Nov 19 '12 at 18:44
  • 1
    In that case there are several more options. Most application servers have a module/plugin that supports tidy. Apache has mod_tidy, http://mod-tidy.sourceforge.net/ , I'm sure other web servers have similar modules as well. I think its even possible to do this directly in PHP. Can you update your question to clarify where you would like this tidying to occur? – Freiheit Nov 19 '12 at 20:11
  • Thank you mr.freiheit.It solve my half of the problem.And there is some(XML,HTML header) issue in my one custom package thats why it reflect to the all the package's includes. – sherin Nov 20 '12 at 04:51
1

This problem is caused by Fluid, the template engine, you just need to take care of your namespace declaration in your Layouts, replace this:

<!DOCTYPE html>
{namespace foo=My\Package\ViewHelpers}
{namespace world=My\Package\ViewHelpers}
<html>

by this

<!DOCTYPE html>{namespace foo=My\Package\ViewHelpers}{namespace world=My\Package\ViewHelpers}
<html>

And no more unneeded line break

dfeyer
  • 53
  • 5
0

In flow3 if there is any error/warring in any of the packages that which we created it will reflect to the active one.This cause blank line in my case.when i remove that package it solve the issue(blank lines)

sherin
  • 1,091
  • 2
  • 17
  • 27