Skip to content
| Marketplace
Sign in
Visual Studio Code>Formatters>XYJsonNew to Visual Studio Code? Get it now.
XYJson

XYJson

Ryo Hasegawa

|
1 install
| (0) | Free
Mutual conversion between XML, JSON, and YAML formats
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

XYJson

A VS Code extension for mutual conversion between XML, JSON, and YAML formats.

Features

  • Convert to JSON: Transform XML or YAML content to JSON format
  • Convert to YAML: Transform JSON or XML content to YAML format
  • Convert to XML: Transform JSON or YAML content to XML format
  • Auto-detection: Automatically detects the input format based on content
  • Error highlighting: Shows error location when conversion fails

Usage

Via Context Menu

  1. Open a file containing JSON, XML, or YAML content
  2. Right-click in the editor
  3. Select one of the conversion options:
    • "XYJson: Convert to JSON"
    • "XYJson: Convert to YAML"
    • "XYJson: Convert to XML"

Via Command Palette

  1. Open a file containing JSON, XML, or YAML content
  2. Press Ctrl+Shift+P (Windows/Linux) or Cmd+Shift+P (macOS)
  3. Type "XYJson" and select the desired conversion command

Format Detection

The extension automatically detects the input format:

  • JSON: Content starting with { or [
  • XML: Content starting with <
  • YAML: All other content (YAML is the most permissive format)

XML Handling

When working with XML:

  • Attributes are prefixed with @_ (e.g., @_id, @_class)
  • Text nodes are represented as #text
  • Output is formatted with 2-space indentation

Development

Prerequisites

  • Node.js 18+
  • npm

Setup

npm install
npm run compile

Running the Extension

  1. Open this project in VS Code
  2. Press F5 to launch the Extension Development Host
  3. Open a JSON, XML, or YAML file and test the conversion commands

Packaging

npx vsce package

This creates a .vsix file that can be installed in VS Code.

License

MIT

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