Problem with editing xhtml,html files

Good-day!

I have recenlty installed IntelliJ on my computer and it seems to be really powerful IDE!  
I create my XHTML file in this way :
New -->HTML file --> in dialog I fiil "Name" text field and "Kind" is selected to "XHTML file". As a result I get this but with icon of html file.:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html
        PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  <head>
    <title></title>
  </head>
  <body>

  </body>
</html>


Main problem is that after creating xhtml file in this way I can't simply take new row pressing 'Enter' key. I can only change cdata in given elements but only in a single row because pressing 'Enter' doesn't work. Also code-completion doesn't work!!!  I want to have on my page element like <h:inputText>, <h:outputFormat>, <f:facet>,<h:dataTable>

If I create file this way: New --->JavaEE Web Page -->Facelets page I have these libraries declared but I am unable to move to new row. 'Enter' still doesn't work as well as code-completion!!!
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html">


If I create xhtml in this way : New -->File -->'myname' -->next in dialog "Register  New File Type Association" I select "XHTML files"
As a result I get completely empty file with no extension at all.
4 comments
Comment actions Permalink

Sounds like http://youtrack.jetbrains.com/issue/IDEA-80181.
Please try File -> Invalidate Caches. Does it help?

0
Comment actions Permalink

Hi volodia,

If I create xhtml in this way : New -->File -->'myname' -->next in dialog "Register  New File Type Association" I select "XHTML files"
As a result I get completely empty file with no extension at all.

When creating new file this way (New | File), you should type FULL file name including extension (e.g. myname.html). If you do not type any extension, IDE will ask you how to treat such extension-less file (the "Register New File Type Association" dialog).

I suggest go to "Settings | File Types" and check (better even delete) those newly created entries (e.g. "myname").


As for the actual problem -- cannot say for sure why Enter key does not work for you. The first thing I would check -- 3rd party (not-bundled) plugins -- please disable all of such plugins and try again. Restarting computer may also help (especially if you are on Windows :) ). Other things I would check -- 3) Check error.log (Help | Reveal log in ...); 4) "File | Invalidate caches..." and maybe even 5) delete ALL IDE-settings (back them up first, of course) to see if this may help (folder locations are described here: http://devnet.jetbrains.net/docs/DOC-181 )

0
Comment actions Permalink

Your answer is really helpful!!!

After I invalidated caches and disabled all plugings at  File -->Other Settings -->Configure Plugins my IntelliJ got like new. Now it opens for second.
I am able to see code-completion and take new row in pom.xml and create xhtml file with appropriate icon

Unfortunately there is still one problem. How to get html elements with prefix h
When I open existent xhtml file I see in red this string:

xmlns:h="http://java.sun.com/jsf/html"

Pointing mouse at error I read  "Resource registered by this uri is not recognized  (Settings|Progect Settings|Schemas and DTDs)"

In window external Shemas and DTDs I have this url included (false is because checkbox isn't selected)

http://java.sun.com/jsf/core false
http://java.sun.com/jsf/html false
http://relaxng.org/ns/compatibility/annotations/1.0 false
http://www.w3.org/1998/Math/MathML false
http://www.w3.org/2000/svg false


Maybe you now what to do?
Thank you!
0
Comment actions Permalink

Hi,

I'm not a Java guy so do not know for sure how it works in actual IntelliJ IDEA (I'm a PhpStorm user and have never dealt with xmlns:h="http://java.sun.com/jsf/html"). I would assume pressing Alt+Enter (while standing there, on error locations, in editor) and looking at the available options may have an answer (maybe "Fetch remote resource" will do the job, dunno).

0

Please sign in to leave a comment.