This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 204163 - [71cat] wrong formatting
Summary: [71cat] wrong formatting
Status: RESOLVED FIXED
Alias: None
Product: web
Classification: Unclassified
Component: Editing infrastructure (show other bugs)
Version: 7.1
Hardware: PC Windows XP
: P3 normal (vote)
Assignee: Marek Fukala
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-24 14:28 UTC by muellermi
Modified: 2011-11-16 16:39 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description muellermi 2011-10-24 14:28:26 UTC
Product Version = NetBeans IDE Dev (Build 201110200600)
Operating System = Windows XP version 5.1 running on x86
Java; VM; Vendor = 1.7.0
Runtime = Java HotSpot(TM) Client VM 21.0-b17

given this page:

<?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">

<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:ui="http://java.sun.com/jsf/facelets">
    <p>
        <h:outputLabel styleClass="label" for="name" value="#{msg.lblAppellation}:"/>
        <h:message for="name" id="msgName" styleClass="errorMessage"/>
        <br/>
        <h:inputText styleClass="input" id="name" value="#{editRequest.request.name}"
                     required="true" requiredMessage="#{msg.msgValueNeeded}" maxlength="50">
            <f:ajax event="blur" render="@this msgName"/>
        </h:inputText>
    </p>
    <p>
        <h:outputLabel styleClass="label" for="email" value="#{msg.lblMail}:"/>
        <h:message for="email" id="msgEmail" styleClass="errorMessage"/>
        <br/>
        <h:inputText styleClass="input" id="email" value="#{editRequest.request.email}" required="true" requiredMessage="#{msg.msgValueNeeded}"
                     maxlength="50">
            <f:ajax event="blur" render="@this msgEmail"/>
            <f:validator validatorId="EmailValidator"/>
        </h:inputText>
    </p>

</ui:composition>

Pressing {Alt}+{Shift}+{f} will format this page as shown above.
But, this page does not contain a <html> tag. Its a pure xml file containing some well formed tags. Thus, I'd like to remove the DOCTYPE information.
Doing so and pressing {Alt}+{Shift}+{f} will destroy the formatting, even though the document is still well formed. Thi sis the result of formatting:

<?xml version='1.0' encoding='UTF-8' ?>

<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:ui="http://java.sun.com/jsf/facelets">
    <p>
    <h:outputLabel styleClass="label" for="name" value="#{msg.lblAppellation}:"/>
    <h:message for="name" id="msgName" styleClass="errorMessage"/>
    <br/>
    <h:inputText styleClass="input" id="name" value="#{editRequest.request.name}"
                 required="true" requiredMessage="#{msg.msgValueNeeded}" maxlength="50">
        <f:ajax event="blur" render="@this msgName"/>
    </h:inputText>
</p>
<p>
<h:outputLabel styleClass="label" for="email" value="#{msg.lblMail}:"/>
<h:message for="email" id="msgEmail" styleClass="errorMessage"/>
<br/>
<h:inputText styleClass="input" id="email" value="#{editRequest.request.email}" required="true" requiredMessage="#{msg.msgValueNeeded}"
             maxlength="50">
    <f:ajax event="blur" render="@this msgEmail"/>
    <f:validator validatorId="EmailValidator"/>
</h:inputText>
</p>

</ui:composition>

This is ugly for this _small_ page. Its non-usable for a _normal_ or _big_ page. :(
Comment 1 Marek Fukala 2011-10-26 13:53:25 UTC
reproducible - bug.

this happens if the doctype cannot be determined and a default is used. As a workaround use the hint at the very first line "change project default to xhtml1.0" for all xhtml files w/o doctype".
Comment 2 Marek Fukala 2011-10-28 08:22:46 UTC
fixed in web-main#db3f5338be8a