Please use the Apache issue tracking system for new NetBeans issues (https://issues.apache.org/jira/projects/NETBEANS0/issues) !!
Bug 204163 - [71cat] wrong formatting
[71cat] wrong formatting
Status: RESOLVED FIXED
Product: web
Classification: Unclassified
Component: Editing infrastructure
7.1
PC Windows XP
: P3 (vote)
: 7.1
Assigned To: Marek Fukala
issues@web
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-10-24 14:28 UTC by muellermi
Modified: 2011-11-16 16:39 UTC (History)
0 users

See Also:
Issue Type: DEFECT
:


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


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo