Formatting XML and JSON using Sublime Text

Formatting XML and JSON using Sublime Text

Last week I was trying to make some changes to my WCF service and had to deal with some XML data. The problem was the XML was not nicely formatted and I had to highlight couple of missing pieces of information. Normally I would use Notepad++ but I though let‘s try doing it in?"Sublime Text".

If you are new to this editor you can read my?this?post which describes the basic steps to get started with Sublime Text. As a web developer we often have to deal with non formatted XML and JSON data. Sublime Text has a plugin?Indext XML?that you can use to format XML and JSON data. The plug-in is available in both ST2 & ST3.

Installing Plug-in

Open the editor and hit?Ctrl+Shift+P?to open?Command Palette.

Type"Install Package" and hit?Enter. Type?Indent XML.

Select the highlighted plug-in and click Enter. You should see the message that saying the plug-in has been installed successfully.

Restart the editor. At least I had to.

Formatting XML

Copy the non formatted XML

Hit?Ctrl + K + F.

You can also do it from the Menu option.

Formatting JSON

Hit?Ctrl + K + F.

You can also do it from the Menu option.

That‘s it for today. Happy Formatting !

时间: 2024-12-15 06:27:32

Formatting XML and JSON using Sublime Text的相关文章

直接使用Sublime Text实现:HTTP访问URL+格式化返回的JSON字符串

背景:作为一个Android app开发者,经常遇到如下场景:后台服务端给了一个接口URL,返回的数据类型是JSON,而我们要预先看一下这个接口返回的JSON数据.常规的查看方式则是,通过浏览器打开URL,然后借助一些Json查看工具,例如Chrome+JSONView.而这种方式总是有点low,现在我们可以仅仅通过一个文本编辑起来实现这个过程:Sublime Text.该文章仅在Windows中测试,Mac和Linux用户请自行根据系统进行微调. 首先,我们需要在Sublime Text上安装

Sublime Text 套件介紹(四):Pretty JSON

JSON,一個輕量級的資料交換語言,目前許多網站AJAX request的回應結果都是JSON格式 以下是一個標準的JSON格式 { "firstName": "John", "lastName": "Smith", "male": true, "age": 25, "address": { "streetAddress": "21 2n

Sublime Text插件:HTML+CSS+JAVASCRIPT+JSON快速格式化[转]

今天在github上乱逛,无意间找到victorporof分享的htmlpretty插件,特做推荐: 先看看他是怎么描述htmlpretty的: This is a Sublime Text 2 and 3 plugin allowing you to format your HTML, CSS, JavaScript and JSON code. It uses a set of nice beautifier scripts made by Einar Lielmanis. The form

Sublime Text插件:HTML+CSS+JAVASCRIPT+JSON快速格式化

htmlpretty插件 经过安装后测试,效果很棒,安装过程简要说明如下: 在Sublime Text中,按下Ctrl+Shift+P调出命令面板; 输入install 调出 Install Package 选项并回车; 输入pretty,并在列表中选择HTML-CSS-JS Prettify后回车即可安装 快捷使用方法: 举例:打开一个压缩的jquery.min.js文件,按下Ctrl+Shift+H

Sublime Text 全程指南

安装(Installation) Sublime Text 官方网站 提供了Sublime Text各系统各版本的下载,目前Sublime Text的最新版本是 Sublime Text 3 .这里以Windows版本的Sublime Text安装为例. 注意在安装时勾选 Add to explorer context menu ,这样在右键单击文件时就可以直接使用Sublime Text打开. 添加Sublime Text到环境变量 使用 Win + R 运行 sysdm.cpl 打开"系统属

最好的Sublime Text插件集合

阅读目录 WebInspector Emmet Git GitGutter & Modific Sublimall AllAutocomplete SublimeREPL DocBlockr Floobits AutoFileName ColorPicker PlainTasks MarkdownEditing Finally WebInspector Amazing tool for debagging JavaScript, the full-fledged inspector of a c

自己编写的sublime text 3 插件

下载链接 import sublime, sublime_plugin, datetime import webbrowser import re import urllib.request,os import threading import json import sublime_api import sys # D:\Program Files\Sublime Text 3\Data\Packages\User\testone_config.sublime-settings # my_pa

Sublime Text 有哪些使用技巧

1. 更改变量名的几种方法<img src="https://pic4.zhimg.com/d93cf0e8987e0117f3a3187cfe8e53fb_b.jpg" data-rawwidth="153" data-rawheight="46" class="content_image" width="153">这种情况下该如何快速选中正确的内容?第一种方法:让 Cmd-D

推荐!Sublime Text 最佳插件列表

推荐!Sublime Text 最佳插件列表 朋友们你们好!我尝试着收集了最佳的ST插件,这些插件真的会改善你的工作流程.我搜索了很多网站,下面是我的成果. 原文链接:http://blog.jobbole.com/79326/ WebInspector 在 JavaScript调试方面,这是一个令人惊讶的工具,Sublime上的完整的代码检查工具.功能:使用绝对路径储存在用户设置中的项目断点,控制台,分步和断点调试器,栈追踪.这些都能够很棒的工作!而且Mozilla还提供了一个插件Firepl