SShortSingh.
Back to feed

How to Format XML in Notepad++, VS Code, xmllint and Python

0
·1 views

Notepad++ and VS Code do not format XML natively, so each requires a free extension, after which a single shortcut applies the formatting. Command-line users can use xmllint, while Python scripts can handle many files using minidom, ElementTree.indent() or lxml. All these tools require well-formed XML, and if a tag is unclosed they report the line number where the problem lies. Formatting only adds line breaks and indentation, leaving the underlying data unchanged. For simple reading, browsers such as Chrome display XML as an indented tree without any formatting step.

Read the full story at DEV Community

This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)

Log in to join the discussion and vote.

Log in

Related stories

0
ProgrammingDEV Community ·

SafePay Campaign Pressures Critical Infrastructure; 30-Day Exposure Reduction Plan Outlined

A SafePay advisory reports that the threat actors have affected at least 600 organizations since August 2024, typically using valid accounts and exposed remote access. The campaign exploits five named CVEs and may delete or reset backup and recovery systems. The guidance proposes a 30-day plan for operators to build an asset inventory, tier systems by exposure, and patch affected Cisco, Veeam and SonicWall products. It also recommends tightening remote administration accounts, enforcing MFA, segmenting backup management, and testing restores. The plan notes that it cannot remove every risk but can establish a defensible baseline for future review.

0
ProgrammingDEV Community ·

Haunted 1998-style terminal runs a local Gemma 3 model for its ghostly replies

Ghost in the Machine is an open-source terminal styled like a 1998 shell, built for Hacktoberfest's Week 4 AI challenge. Users type commands such as cat or cd into a simulated filesystem, and a 'tenant' presence answers each one with a single whispered line. Those replies are generated live by Gemma 3 4B running locally through Ollama, so no data leaves the user's machine. The project is a single HTML file with no build step or dependencies, released under the MIT license. It is designed to be run locally with two commands, and it entered the challenge in the Best Use of Gemma category.

0
ProgrammingDEV Community ·

Ada: A Local Terminal Tool That Diagnoses Command Failures in Lovelace's Voice

A developer built Ada, an open-source terminal utility that stays silent when commands succeed but intervenes when they fail with a non-zero exit code. It scrubs sensitive data such as access keys, tokens, and personal file paths before any analysis. The diagnosis is generated locally by Google's Gemma 2 (2B) model, so no data leaves the machine. The tool presents its explanation in a stylized 1840s voice inspired by Ada Lovelace, and suggests a copyable fix. The project was created for the Hacktoberfest Open-Source AI Challenge and is published on GitHub.

0
ProgrammingDEV Community ·

Dead Air: a fictional shortwave app that runs a small AI model on your own CPU

Dead Air is an open-source fictional shortwave radio that generates short transmissions from a place, an unsettling detail, and a mood the user supplies. The app runs SmolLM2-1.7B-Instruct, an Apache-2.0 open-weight model, locally in the browser-facing setup via Transformers.js and ONNX Runtime on the CPU, with no cloud fallback. Its server listens only on loopback, validates inputs, and limits each response to 140 tokens with one generation at a time. The author found the 1.7B model followed prompts more closely than the 360M version, though generation on their machine took about 28 seconds including model loading. The project is MIT-licensed and documents its limitations, including the model's tendency to repeat or cut off mid-sentence.

How to Format XML in Notepad++, VS Code, xmllint and Python · ShortSingh