views:

83

answers:

2

Hello.

I've just installed and configured Netbeans to work with PHP (including xdebug), and almost everything is working as intended, except that I've been getting "errors" in the IDE after I edited the default webpage template to comply with xhtml 1.1. The template is this:

<?xml version="1.0" encoding="${project.encoding}" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"&gt;
<html xmlns="http://www.w3.org/1999/xhtml"&gt;
  <head>
    <title></title>
  </head>
  <body>
  </body>
</html>

These are the errors I receive (I can't post images yet).

Page is created OK, character encoding is inherited from project's settings as expected. It's probably something to do with the xml declaration on top of the document, but I don't really know how to "tune" Netbeans to ignore it and not show the 3 errors on every page I create.

The warning is there because NB does not recognize the xhtml 1.1 DTD, so it falls back to html 4.01, which does not support the xmlns attribute in the html tag - and that's the only thing I could find searching around. It will be fixed in the next version, so I'm not worried about it.

I know there's nothing wrong with the markup, but there's probably something I'm missing in NB configuration, and I would like to get rid of those messages because they pretty much take all the space I reserve for errors/warnings/tasks.

So is there any way I can either make NB recognize this xml declaration or make it ignore these specific "errors"?

Thanks.

A: 

On the left where the line numbers are, left click on the warning/error and see if netbeans allow you to ignore them for the current file.

zaf
It won't let me ignore the specific error, only change the scope or apply filters. Maybe there's a filter configuration that allows me to "filter out" these errors?I've never used Netbeans before - I come from editing in Notepad++. Thanks.
Mike Valeriano
I don't display my 'error/warning list window' but I remember you could filter, even by filename. Have a go.
zaf
I think there isn't a good way to deal with these errors but to report them as a bug, since they are not exactly errors in the PHP code. I'll just expand the task/error window for now, while I can't get rid of the messages. And I'll direct this to the netbeans.org folks. Thanks for the help.
Mike Valeriano
A: 

Turns out it's a IDE/debugger issue: while short_open_tag was set off in my configuration, the project settings in NB, by default, analyzes your code as if you had short_open_tag set to on.

After turning it off in project settings, the errors were gone. Got my answer at Netbeans mailing list. Maybe this is useful for someone out there.

Mike Valeriano