XML & WSDL Viewer: Online Formatter and Validator

THEJORD Team9 min read
xmlwsdldevelopmenttoolssoap

Format, validate, and view XML and WSDL online. Advanced WSDL parser, XML ↔ JSON conversion, real-time validation. Free privacy-first tool for developers.

XML & WSDL Viewer: Online Formatter and Validator

What is XML and Why It Matters

XML (eXtensible Markup Language) is a standardized markup format for structuring data in a way that's readable by both humans and machines. Created by the W3C in 1998, XML has become the de facto standard for data exchange between heterogeneous systems, application configurations, structured documents, and web services.

Unlike HTML, which is designed to display data, XML is designed to transport and store data. It's self-descriptive, extensible, and platform-independent, making it ideal for:

  • Application configurations: Maven POM, Spring beans, Log4j config
  • SOAP web services: WSDL, request/response messages
  • Structured documents: RSS feeds, sitemaps, SVG, DocBook
  • B2B data exchange: EDI, electronic invoicing, HL7 healthcare
  • Office formats: .docx, .xlsx, .pptx (XML-based)

XML Formatter & Validator: Core Features

Our XML & WSDL Viewer offers a complete toolset for working efficiently with XML:

1. XML Validation (Syntax Validation)

XML validation checks that the document follows well-formed XML syntax rules:

  • Every opening tag must have a corresponding closing tag
  • Tags must be properly nested (no overlaps)
  • Only one root element allowed
  • Attributes must be enclosed in quotes
  • Special characters (< > &) must be escaped

Example of valid XML:

<?xml version="1.0" encoding="UTF-8"?>
<library>
  <book isbn="978-0-1234-5678-9">
    <title>Complete XML Guide</title>
    <author>John Smith</author>
    <price currency="USD">29.99</price>
    <year>2024</year>
  </book>
</library>

Example of invalid XML (error detected):

<book>
  <title>Wrong title</autor>    <!-- Wrong closing tag -->
  <price>19.99</title>          <!-- Wrong nesting -->
</book>

The validator will show exactly the line and column of the error, making debugging easier.

2. XML Formatting (Prettify & Minify)

Prettify formats XML with indentation for readability:

<!-- Before (minified) -->
<root><user><name>John</name><age>30</age></user></root>

<!-- After (prettified with 2-space indent) -->
<root>
  <user>
    <name>John</name>
    <age>30</age>
  </user>
</root>

Minify removes unnecessary whitespace to reduce file size:

  • Removes spaces and tabs between tags
  • Eliminates unnecessary newlines
  • Preserves only significant whitespace (inside text content)
  • File size reduction: typically 20-40%

3. XML to JSON Conversion (Bidirectional)

Convert XML to JSON for use in modern JavaScript/REST API applications:

<!-- XML Input -->
<person>
  <name>John Smith</name>
  <age>35</age>
  <skills>
    <item>JavaScript</item>
    <item>Python</item>
    <item>Java</item>
  </skills>
</person>

// JSON Output
{
  "person": {
    "name": "John Smith",
    "age": "35",
    "skills": {
      "item": [
        "JavaScript",
        "Python",
        "Java"
      ]
    }
  }
}

Reverse conversion JSON → XML:

// JSON Input
{
  "user": {
    "id": 12345,
    "active": true,
    "roles": ["admin", "editor"]
  }
}

<!-- XML Output -->
<?xml version="1.0" encoding="UTF-8"?>
<root>
  <user>
    <id>12345</id>
    <active>true</active>
    <roles>
      <item>admin</item>
      <item>editor</item>
    </roles>
  </user>
</root>

4. WSDL Parser & Viewer

WSDL (Web Services Description Language) describes SOAP web services. The parser automatically extracts:

  • Services & Endpoints: URLs of exposed SOAP services
  • Operations: Available methods with input/output message types
  • Types: Defined complex data types (ComplexType, SimpleType)
  • Bindings: Communication protocol (SOAP 1.1/1.2, HTTP)
  • Target Namespace: Service namespace

Example WSDL parsing output:

📋 Service: CalculatorService
   Port: CalculatorSoapPort
   Endpoint: http://example.com/calculator

⚙️ Operations:
   - add(int a, int b) → int result
   - subtract(int a, int b) → int result
   - multiply(int a, int b) → int result
   - divide(int a, int b) → float result

📦 Types: AddRequest, AddResponse, DivideRequest, DivideResponse

Real-World Use Cases

1. Debug Spring/Maven Configurations

Backend developers working with Spring Boot or Maven often deal with complex XML configurations. The formatter helps to:

  • Validate pom.xml syntax before building
  • Format applicationContext.xml for readability
  • Compare configuration versions (with Diff Checker)
<!-- Spring beans configuration -->
<beans xmlns="http://www.springframework.org/schema/beans">
  <bean id="dataSource" class="org.apache.commons.dbcp2.BasicDataSource">
    <property name="driverClassName" value="com.mysql.cj.jdbc.Driver"/>
    <property name="url" value="jdbc:mysql://localhost:3306/mydb"/>
    <property name="username" value="root"/>
    <property name="password" value="password"/>
  </bean>
</beans>

2. SOAP Web Services Integration

When integrating with legacy SOAP services (banking, ERP, public services), the WSDL parser allows you to:

  • Visualize all available operations
  • Understand request/response message structure
  • Identify endpoints and bindings to configure
  • Generate client code based on extracted types

3. RSS Feed and Sitemap Analysis

RSS feeds and XML sitemaps can be validated and formatted:

<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  <url>
    <loc>https://thejord.it/</loc>
    <lastmod>2024-12-01</lastmod>
    <changefreq>weekly</changefreq>
    <priority>1.0</priority>
  </url>
  <url>
    <loc>https://thejord.it/xml-wsdl-viewer</loc>
    <lastmod>2024-12-03</lastmod>
    <changefreq>monthly</changefreq>
    <priority>0.8</priority>
  </url>
</urlset>

4. Electronic Invoice XML Processing

Many countries require electronic invoices in XML format. The validator helps to:

  • Verify XML syntax before submission to tax authorities
  • Format for readability during manual checks
  • Convert to JSON for automated processing

5. SOAP to REST Migration

Teams migrating from SOAP to REST architectures can:

  • Parse WSDL to extract all operations
  • Map SOAP operations to equivalent REST endpoints
  • Convert XML message types to JSON schemas
  • Document REST API based on WSDL documentation

Code Examples

JavaScript: Parse XML with DOMParser

// Browser-based XML parsing
const xmlString = '<books><book id="1"><title>XML Guide</title></book></books>';

const parser = new DOMParser();
const xmlDoc = parser.parseFromString(xmlString, 'application/xml');

// Check for parsing errors
const parserError = xmlDoc.querySelector('parsererror');
if (parserError) {
  console.error('XML Parsing Error:', parserError.textContent);
} else {
  const books = xmlDoc.getElementsByTagName('book');
  console.log(`Found ${books.length} books`);

  const title = xmlDoc.querySelector('title').textContent;
  console.log(`First book title: ${title}`);
}

Python: XML Processing with lxml

from lxml import etree

# Parse XML
xml_string = '''<?xml version="1.0"?>
<catalog>
  <product id="101">
    <name>Laptop</name>
    <price currency="USD">899.99</price>
  </product>
</catalog>'''

root = etree.fromstring(xml_string.encode('utf-8'))

# Extract data
product = root.find('.//product')
name = product.find('name').text
price = product.find('price').text
currency = product.find('price').get('currency')

print(f"Product: {name} - {price} {currency}")

# Validate with XSD schema
schema = etree.XMLSchema(etree.parse('schema.xsd'))
is_valid = schema.validate(root)
print(f"Valid XML: {is_valid}")

Java: JAXB for XML Binding

import javax.xml.bind.*;
import java.io.StringReader;

@XmlRootElement
class Person {
    @XmlElement
    private String name;

    @XmlElement
    private int age;

    // Getters/Setters omitted
}

public class XmlExample {
    public static void main(String[] args) throws JAXBException {
        String xml = "<person><name>John</name><age>35</age></person>";

        JAXBContext context = JAXBContext.newInstance(Person.class);
        Unmarshaller unmarshaller = context.createUnmarshaller();

        Person person = (Person) unmarshaller.unmarshal(
            new StringReader(xml)
        );

        System.out.println("Name: " + person.getName());
        System.out.println("Age: " + person.getAge());
    }
}

Node.js: XML to JSON with xml2js

const xml2js = require('xml2js');

const xmlString = `
  <config>
    <database>
      <host>localhost</host>
      <port>5432</port>
      <name>mydb</name>
    </database>
  </config>
`;

xml2js.parseString(xmlString, (err, result) => {
  if (err) {
    console.error('Parse error:', err);
    return;
  }

  const dbConfig = result.config.database[0];
  console.log(`DB: ${dbConfig.host}:${dbConfig.port}/${dbConfig.name}`);

  // Convert back to XML
  const builder = new xml2js.Builder();
  const xml = builder.buildObject(result);
  console.log(xml);
});

XML vs JSON: When to Use XML

Feature XML JSON
Readability Verbose, heavier Concise, lighter
Parsing Slower (DOM/SAX) Faster (native JS)
Validation XSD Schema, DTD JSON Schema
Attribute Support ✅ Yes ❌ No (key-value only)
Namespaces ✅ Yes ❌ No
Comments ✅ Yes (<!-- -->) ❌ No (standard)
Typical Use Config, SOAP, Documents REST API, NoSQL, Web

Use XML when:

  • You need strict validation with XML Schema
  • Working with SOAP services or legacy systems
  • Metadata needed (attributes, namespaces)
  • Complex documents with mixed structure (text + markup)
  • Industry standards require XML (healthcare HL7, finance FpML)

Use JSON when:

  • Developing modern REST APIs
  • Prioritizing performance and payload size
  • Integrating with JavaScript/frontend
  • Working with NoSQL databases (MongoDB, Couchbase)

FAQ

How can I validate XML against an XML Schema (XSD)?

Our tool validates XML syntax (well-formedness). To validate against XSD, use specialized libraries:

  • Online: XMLValidation.com, FreeFormatter.com
  • JavaScript: libxmljs, xsd-schema-validator
  • Python: lxml with XMLSchema
  • Java: javax.xml.validation.SchemaFactory

Does the tool support XML namespaces?

Yes, the validator and formatter correctly handle XML namespaces, including prefixes (xmlns:ns) and default namespaces. The WSDL parser automatically recognizes SOAP, WSDL, and XSD namespaces.

Can I convert XML to CSV or Excel?

Not directly, but you can follow this workflow:

  1. XML → JSON (with our tool)
  2. JSON → CSV (with our JSON Formatter)
  3. Import CSV into Excel

How do I handle very large XML files (>10MB)?

The browser-based tool has memory limits. For large files use:

  • Command line: xmllint --format large.xml (Linux/Mac)
  • Python SAX parser: Incremental parsing without loading everything in memory
  • Java StAX: Streaming API for XML

Does the WSDL parser support WSDL 2.0?

We currently support WSDL 1.1 (most widely used). WSDL 2.0 has limited adoption. If you have specific needs, contact us.

How to minify XML while preserving CDATA formatting?

<![CDATA[...]]> sections are preserved exactly as they are, including internal whitespace. Minify only removes spaces between XML tags.

What's the difference between well-formed and valid XML?

Well-formed XML follows basic syntax rules (closed tags, proper nesting). Valid XML also conforms to a specific schema (DTD or XSD) defining allowed structure and types.

Can I use the tool offline?

Yes! All processing happens in the browser (client-side). You can save the HTML page and use it offline. No data is sent to external servers.

Resources and Related Tools

Other Useful THEJORD Tools

External Documentation

Conclusion

THEJORD's XML & WSDL Viewer is a comprehensive tool for developers working with XML: real-time validation, professional formatting, advanced WSDL parsing, and bidirectional XML ↔ JSON conversion.

Key advantages:

  • ✅ 100% free and privacy-first (no server uploads)
  • ⚡ Fast: instant client-side processing
  • 🛡️ Secure: no data leaves your browser
  • 🔧 Complete: validator, formatter, WSDL parser, converter
  • 💻 Always available: works offline too

Try the tool now and simplify your XML workflow!