XML Utils

About XML Utils?

XML Utils is for users who works with XML/SOAP (Simple object access protocol) based APIs. When the data is received from middleware/backend API calls. It is hard for developers to perceive information due to line breaks (this can be due to reducing network cost of send huge payloads). Such payloads may bring tears in engineer’s eyes. We believe engineers are artists they need healthy environment to focus more on complex problems to solve challenging issues. Moreover, API contracts exchange over emails or attachments reduces correctness of the source payload. XML Utils contribute helping hands to solve such problems by parsing and formatting messy XML payloads.

What Is XML?

XML stands for eXtensible Markup Language. It is a format which uses markup tags and capable of being extended. Two obvious questions here, what does the markup and extensible refers to? Markup represents sequence of characters or symbols (e.g. <, >, ^, /, ? etc.) that can be inserted at certain places in a file to indicate how file data should look when it is printed or displayed. Whereas, Extensible as name suggest refers to a data design which can expand or evolve time to time based on given requirements. Even though JSON (JavaScript Object Notation) is popular and widely used format across the internet for APIs and configurations. XML is still heavily used in old legacy and SOAP based APIs. Which is why almost every major language has some form of library(ies) or natively build-in functionality which can parse and convert XML payloads into objects or classes in that language. This makes working with XML data extremely easy inside the programing language.

Want to know more about XML? Checkout some of the links given below:

1. Introduction to XML

2. Extensible Markup Language (XML) 1.0 (Fifth Edition)

3. XML - Overview

4. Wikipedia - XML

Why XML Utils?

Creating scalable APIs is not an easy task. It requires ample amount of time and focus to understand the business requirements. Once the engineers are ready to code, they often encounter technical challenges, either related to 3rd party API responses, legacy APIs, or configurations etc. Dealing all such challenges results fragile products. XML Utils help engineers to stay focus and not to worry about at least issues related to XML.

1. Validation

This feature help engineers to find and fix XML validation errors. If you are trying to validate XML and getting error like, “Error parsing attribute name…” It means you are possibly trying to parse something that isn’t XML, or it is XML having errors. XML Utils detects position of error (line# and column#) which help engineers to correct errors without spending precious time on finding missing closing tag somewhere in the payload.

2. Formatting / Beautify

Many sites or middleware offers response payloads in XML format. Usually, such payloads are hard to read due to the absence of white spaces and new lines characters (generally, this is due to reducing network cost by sending compressed version of XML string). This feature helps engineers to format those XML payloads and get sense out of it. By default, it uses two spaces for indentation to beautify payload.

3. Compression / Minify

Efficient network utilization is always important, specifically when dealing with huge XML payloads. This is helpful for clients who are consuming XML payloads from remote locations i.e., where internet speed is not decent enough to handle heavy payloads. In contrast with Formatting/Beautify, XML compression tool help engineers to avoid putting additional overhead on network resources through compact XML payloads.

4. JSON Conversion

Working with SOAP based APIs or XML based configurations are still common. When integrating external systems/APIs, engineers often get requirements where they get XML payload. However, there existing codebase may supports only JSON format (or vice versa). To make engineers life easier, this feature provides quick conversion of XML payloads into JSON format.

5. YML / YAML Conversion

YML/YAML (Yet Another Markup Language) is widely used format for writing configurations for most DevOps tools and applications (e.g., Kubernetes, Ansible, Prometheus etc.). In the process of migrating old legacy stuff over modern DevOps tools and technology. It is often required to support both old and new infrastructures in parallel. To help engineers this feature provides quick conversion of XML payloads into YML/YAML format.

© Copyright 2021 CodeofEverything - All Rights Reserved