XML Validation with Notepad++ / A short introduction with an XidML example

XML Validation with Notepad++ / A short introduction with an XidML example

Working with text based files has the big advantage - despite binary files - that they are human readable. The content of such files can be displayed with common text editors which are available for any OS in many variants.

In one of the last articles of European Society of Telemetry (EST) here on LinkedIn, the XidML standard was introduced, which utilizes a XML-based language. XidML is a specific way to describe a Flight Test Instrumentation (FTI) configuration. One of the advantages of XML is, that such files can be validated. Because it's one thing to define and understand the rules and specifications of the XidML standard. You need also to apply those rules and work with XidML files. To help the user applying the rules and creating well formed and valid XidML files, a schema is available as "*.xsd" files which contains the rules for XidML files and its elements. XidML provides the schema along with sample XidML files at www.xidml.org.

To create, modify, debug AND validate XidML files, you might use the free editor Notepad++ with the XML tools Plugin. The following steps should give a short introduction of using Notepad++, XML tools plugin and the XidML schema to validate XidML files. For the screenshots, Notepad++ v8.1.9.2 and XidML 3.0.0 was used. As the title implies, this procedure can be applied to any XML file, for which there's a schema available.

Notepad++

When installing Notepad++, ensure that the XML tools Plugin is installed. It can be checked in the Plugins menu:

Es wurde kein Alt-Text für dieses Bild angegeben.

XidML Schema

To get the XidML schema (v3.0), go to www.xidml.org and download it:

Es wurde kein Alt-Text für dieses Bild angegeben.

Unzip the archive to a destination of your choice (I use here: C:\Users\Florian\Documents\XidML)

Es wurde kein Alt-Text für dieses Bild angegeben.

XidML Samples

If you do not have already some XidML files, you can download some examples:

Es wurde kein Alt-Text für dieses Bild angegeben.

Unzip the archive to a destination of your choice (I use here: C:\Users\Florian\Documents\XidML\XidMLSamples)

Es wurde kein Alt-Text für dieses Bild angegeben.

If you open e. g. "Arinc429Sample.xidml" with Notepad++, the application will automatically recognize the XML structure and applies the different color coding and indention rules.

Es wurde kein Alt-Text für dieses Bild angegeben.

But that does not give any information if this opened file is a valid XidML file. Valid means: valid according the selected XidML schema (described in the *.xsd files)

Validate

To validate your XidML file, you need to tell Notepad++ where this specific validation schema can be found. This is done in "XML Tools" menu - "Validate Now":

Es wurde kein Alt-Text für dieses Bild angegeben.

In the "Select file..." dialogue, select the path to the schema:

Es wurde kein Alt-Text für dieses Bild angegeben.

Select "XidML-3.0.0.xsd" in the "X-Essential" directory:

Es wurde kein Alt-Text für dieses Bild angegeben.

Click on OK:

Es wurde kein Alt-Text für dieses Bild angegeben.

If your file is a valid XidML file, it is shown (quite unpretentious) in the result display:

Es wurde kein Alt-Text für dieses Bild angegeben.

You can play by editing the XidML sample to check how the validation works and how validation error messages will look like.

Conclusion

Notepad++ in combination with the XML Tools Plugin and the XidML schema is a smart way to validate XidML files (basically any XML file where you have a schema). As it comes with no cost, you might accept for example the drawback that the in the error messages, you'll have no information in which line of the file the validation error was detected or located. If you need to dig deeper in this domain you might consider commercial tools which provides additional useful features. As some of them might not be free, you need to weigh up the pros and cons.

For me, Notepad++ is one of my core tools to use in daily work. It has a powerful compare function, it provides a very good search/replace/counting interface and one of my favorite is the block selection mode (using Alt-Key while selecting).

You'll find the links in the comments. Let me know, if you have other ways to validate XML based files. What are your experiences with such tools? What other formats do you have mind to describe a FTI configuration? Any comments or complementary feedback/correction is highly appreciated!

To view or add a comment, sign in

More articles by Florian M.

Others also viewed

Explore content categories