XML Tools

XML Well formedness checker

Description/Launch

Screenshots of the XML Well formedness checker

XML was designed to allow for easy transport and transformation of data. Another bonus of the XML format is that is is human readable - it is plain text when viewed in an editor, rather than indecypherable glyphs. This gives developers the wrong impression that XML is also human writable. XML written by people, or poor tools, will probably be malformed.

The XML Well Formedness Checker (XWF-C), is a sandboxed tool designed to check part of the validity of XML content, in checking that the XML content is well-formed. XML Well formedness checker

Help

The XML Well formedness checker will check that the content pasted into the text area, is well formed XML. Once the top text area contains the XML of interest, simply click 'Check' to get a report. If errors are detected, the description of the error appears in the text area below the content. When no errors are detected, the tool reports The XML content is well formed. ...

Some of the types of errors detected by well-formedness checking are:

  • Unclosed elements
    <icon href='icon.jpg' >

    The element type "icon" must be terminated by the matching end-tag "</icon>".
    <icon href='icon.jpg' />

    The XML content is well formed.
  • Non SGML content in attribute values and text elements.
    <vendor>Smith & Sons</vendor>

    The entity name must immediately follow the '&' in the entity reference.
    <vendor>Smith &amp; Sons</vendor>

    The XML content is well formed.
  • Mismatched quotes
    <icon href='icon.jpg" />

    The value of attribute "href" associated with an element type "null" must not contain the '<' character.
    <icon href='icon.jpg' />

    The XML content is well formed.
  • Other
    <offline allowed/>

    Attribute name "allowed" associated with an element type "offline" must be followed by the ' = ' character.
    <offline-allowed/>

    The XML content is well formed.

Note that the message The XML content is well formed does not mean the content of the file is valid. Only checking the XML against a DTD or (much better) XSD can have any hope of confirming that XML content is valid.

That being said, probably 90% of the errors introduced into XML, make the XML malformed.

(Yet Another) XML Validator

Description/Launch

Screenshots of (Yet Another) XML Validator
(Yet Another) XML Validator

As mentioned above, 90% of problems with XML can be detected using well-formedness checking. For the other 10%, validation is required.

Validation involves checking the XML against an XSD (XML Schema Definition) or DTD. These documents define things like the valid elements, the number of allowable occurences of those elements, the attributes, and possible values of the attributes. Since XSD is capable of detecting more errors than your average DTD, this validator concentrates on validating against XSD exclusively.

For validating XSD against an XSD, we offer YAX-V, (Yet Another) XML Validator.

Help

The validator allows you to load an XML document into the left hand text area by either loading it from file, or simply pasting it using the buttons immediately below.

The XSD can then be loaded into the right hand text area. It offers a 'drop down' of more common XSD files. Or at least, that is the ultimate intent of the list. At the moment, it includes just two possibilities.

The two listed are for the web start JNLP format, and the Saverbeans XML files which describe the screensaver configuration widgets of Java based Screensavers (the SaverBeans XSD is actually a cut-down version of the XScreenSaver version, since Saverbeans leverages the power of XSS on *nix type systems, but only implements a subset of the elements offered by XSS).

Perhaps unsurprisingly (to the fact those are the only two already listed) - both these XSDs were developed by the author. Suggestions for improvement of the existing XSD files, as well as suggestions for new listings, are welcome.

For any XSD not listed, simply download the schema to local disk, then load it using the File button.

Once the XML/XSD are loaded, it is simply a matter of activating the "Validate" button to get a report of any errors detected.

Problems are listed below the validate button, color coded as to whether they are a warning, error or fatal level.

Click on any error in the list to see full the details listed in the text area to the right. This document is not intended as an XML tutorial, but since the text of the error is exactly as reported by the underlying validation tool, doing a search on the text of the message should reveal how to correct the problem.

Fix the topmost errors in the XML content area and revalidate the XML, to check it is now valid.

When the XML validates against the schema definition, the list will be empty, and the message will be This document is valid according to the schema. The data might still be wrong, but at least it is valid!

© 2003-2011 by Andrew Thompson. All rights reserved.
Web hosting compliments of Java Web Hosting.
Java Web Hosting