在eclipse中格式化XML文件

在eclipse中格式化XML文件,eclipse,hibernate,xml-parsing,Eclipse,Hibernate,Xml Parsing,当我尝试在eclipse中格式化xml文件时,它会将每个字段放在新行上。相反,我希望每个属性都在一条线上。例如,现在当我按下CTRL+SHFT+F时,eclipse将其格式化如下 <hibernate-mapping package="com.server.entities"> <class name="Branch" table="Branch" > <meta attribute="sync-DAO">false</meta&

当我尝试在eclipse中格式化xml文件时,它会将每个字段放在新行上。相反,我希望每个属性都在一条线上。例如,现在当我按下CTRL+SHFT+F时,eclipse将其格式化如下

<hibernate-mapping package="com.server.entities">
<class
    name="Branch"
    table="Branch"
>
    <meta attribute="sync-DAO">false</meta>
    <id name="Id"
        type="java.lang.Long"
        column="id"
    >
        <generator class="native"/>
    </id>

    <property
        name="Created"
        column="created"
        type="timestamp"
        not-null="false"
        length="23"
    />
    <property
        name="LastUpdated"
        column="lastUpdated"
        type="timestamp"
        not-null="false"
        length="23"
    />
    <property
        name="CreatedBy"
        column="createdBy"
        type="java.lang.Long"
        not-null="false"
        length="19"
    />

假的
但我想要的是

<hibernate-mapping package="com.kaizen.report.server.entities">
<class name="Branch" table="Branch">
    <meta attribute="sync-DAO">false</meta>
    <id name="Id" type="java.lang.Long" column="id">
        <generator class="native"/>
    </id>

<property name="Created" column="created" type="timestamp" not-null="false" length="23"/>

假的

如果您使用的是eclipse.org上的XML编辑器,请转到XML编辑器首选项页面,更改选项以允许更长的行,并且不将多个属性拆分为新行