Skip to content

XML Beautify not work #2651

@Aiome

Description

@Aiome

Description

The results of beautification are not what I expect.

Input Before Beautification

This is what the code looked like before:

<Object target="consignee" source="$" clazz="com.jdwl.wms.shipment.interact.domain.order.entity.domain.InteractConsignee"><Field target="consigneeNo" source=".memberId"/><Field target="consigneeName" source=".customerName"/><Field target="consigneeNameEnc" source=".nameENC"/><Field target="recipientNo" source=".storeNumber"/><Object target="address" source="$" clazz="com.jdwl.wms.shipment.interact.domain.order.entity.domain.InteractAddress"><Field target="address" source="..address"/><Field target="addressEnc" source="..whereENC"/><Field target="enAddress" source="..enAddress"/></Object><Object target="communication" source="$" clazz="com.jdwl.wms.shipment.interact.domain.order.entity.domain.InteractCommunication"><Field target="email" source="..email"/><Field target="emailEnc" source="..emailENC"/><Field target="mobileEnc" source="..mobileENC"/><Field target="mobile" source="..mobile"/><Field target="telephone" source="..phone"/><Field target="telephoneEnc" source="..phoneENC"/><Field target="postalCode" source="..zip"/></Object></Object>

Expected Output

The beautified code should have looked like this:

<Object target="consignee" source="$" clazz="com.jdwl.wms.shipment.interact.domain.order.entity.domain.InteractConsignee">
  <Field target="consigneeNo" source=".memberId"/>
  <Field target="consigneeName" source=".customerName"/>
  <Field target="consigneeNameEnc" source=".nameENC"/>
  <Field target="recipientNo" source=".storeNumber"/>
  <Object target="address" source="$" clazz="com.jdwl.wms.shipment.interact.domain.order.entity.domain.InteractAddress">
    <Field target="address" source="..address"/>
    <Field target="addressEnc" source="..whereENC"/>
    <Field target="enAddress" source="..enAddress"/>
  </Object>
  <Object target="communication" source="$" clazz="com.jdwl.wms.shipment.interact.domain.order.entity.domain.InteractCommunication">
    <Field target="email" source="..email"/>
    <Field target="emailEnc" source="..emailENC"/>
    <Field target="mobileEnc" source="..mobileENC"/>
    <Field target="mobile" source="..mobile"/>
    <Field target="telephone" source="..phone"/>
    <Field target="telephoneEnc" source="..phoneENC"/>
    <Field target="postalCode" source="..zip"/>
  </Object>
</Object>

Actual Output

The beautified code actually looked like this:

<Object target="consignee" source="$" clazz="com.jdwl.wms.shipment.interact.domain.order.entity.domain.InteractConsignee"><Field target="consigneeNo" source=".memberId"/><Field target="consigneeName" source=".customerName"/><Field target="consigneeNameEnc" source=".nameENC"/><Field target="recipientNo" source=".storeNumber"/>
  <Object target="address" source="$" clazz="com.jdwl.wms.shipment.interact.domain.order.entity.domain.InteractAddress"><Field target="address" source="..address"/><Field target="addressEnc" source="..whereENC"/><Field target="enAddress" source="..enAddress"/></Object>
  <Object target="communication" source="$" clazz="com.jdwl.wms.shipment.interact.domain.order.entity.domain.InteractCommunication"><Field target="email" source="..email"/><Field target="emailEnc" source="..emailENC"/><Field target="mobileEnc" source="..mobileENC"/><Field target="mobile" source="..mobile"/><Field target="telephone" source="..phone"/><Field target="telephoneEnc" source="..phoneENC"/><Field target="postalCode" source="..zip"/></Object>
</Object>

Steps to Reproduce

  1. Add code to Atom editor
  2. Run command Atom Beautify: Beautify Editor
  3. This beautified code does not look right!

Debug

Here is a link to the debug.md Gist: debug.md

Checklist

I have:

  • Tried uninstalling and reinstalling Atom Beautify to ensure it installed properly
  • Reloaded (or restarted) Atom to ensure it is not a caching issue
  • Searched through existing Atom Beautify Issues at https://github.com/Glavin001/atom-beautify/issues
    so I know this is not a duplicate issue
  • Filled out the Input, Expected, and Actual sections above or have edited/removed them in a way that fully describes the issue.
  • Generated debugging information by executing Atom Beautify: Help Debug Editor command in Atom and added link for debug.md Gist to this issue

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions