Skip to content
| Marketplace
Sign in
Visual Studio Code>Formatters>AEM Dialog Formatter for VSCodeNew to Visual Studio Code? Get it now.
AEM Dialog Formatter for VSCode

AEM Dialog Formatter for VSCode

Chiru Sandeep Paleti

|
3 installs
| (0) | Free
Formats Adobe Experience Manager (AEM) dialog .content.xml files with one attribute per line. Designed for AEM 6.5 developers — press Shift+Alt+F on any .content.xml to expand all XML attributes to one-per-line format.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

AEM Dialog XML Formatter

Format Adobe Experience Manager dialog .content.xml files with one attribute per line — instantly.

AEM Dialog XML Formatter Icon


Features

One Attribute Per Line

Expands every XML element with 2 or more attributes into the canonical AEM dialog format — each attribute on its own indented line, closing /> appended to the last attribute.

Before:

<videoId jcr:primaryType="nt:unstructured" sling:resourceType="granite/ui/components/coral/foundation/form/textfield" fieldLabel="YouTube Video ID" name="./videoId"/>

After:

<videoId
    jcr:primaryType="nt:unstructured"
    sling:resourceType="granite/ui/components/coral/foundation/form/textfield"
    fieldLabel="YouTube Video ID"
    name="./videoId"/>

Root Element Namespace Handling

Keeps all xmlns:* declarations on the opening tag line — consistent with AEM FileVault conventions.

<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0"
    jcr:primaryType="nt:unstructured"
    jcr:title="My Component"
    sling:resourceType="cq/gui/components/authoring/dialog"
    maximize="{Boolean}true">

Smart Single-Attribute Preservation

Structural nodes with only one attribute stay compact — no unnecessary noise.

<items jcr:primaryType="nt:unstructured">

Comment Preservation

Inline comments are preserved at their correct indentation depth.

<!-- ══════════ TAB 1: CONTENT ══════════ -->

Error Notification

Invalid XML shows a clear error message in the VSCode notification area — document is left unchanged.


Usage

  1. Open any .content.xml file in VSCode
  2. Press Shift+Alt+F (Format Document)
  3. If prompted to select a formatter, choose AEM Dialog XML Formatter

Scope: Only activates for files named .content.xml. Other XML files are unaffected.


Requirements

  • VSCode ^1.60.0
  • No external tools or runtimes required — fully self-contained

Extension Settings

No configuration needed. Works out of the box.

To set as default formatter for .content.xml files, add to your VSCode settings.json:

"[xml]": {
    "editor.defaultFormatter": "ChiruSandeepPaleti.aem-dialog-formatter"
}

Supported AEM Versions

  • AEM 6.5 (FileVault / JCR content packages)
  • AEM as a Cloud Service
  • Any AEM project using standard .content.xml dialog structure

Known Limitations

  • CDATA sections: preserved but not specially formatted
  • Attribute ordering: preserved as-is from source (not alphabetized)

Release Notes

1.0.0

  • Initial release
  • One-attribute-per-line formatting via @xmldom/xmldom
  • Root element namespace handling
  • Comment preservation
  • Error notification for invalid XML

Contributing

Bug reports and feature requests welcome at GitHub Issues.


License

MIT


Developed by Chiru Sandeep Paleti

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft