Chapter 9. Tools

Table of Contents

XML Schema Validator
Uploading XML Schemas
Creating Schema Validation Scenarios
Performing Schema Validation
XPath Evaluator
XSL Transformer
Schema XML Generator
XML Generation Options
JSON-XML Converter
JSON to XML conversion
XML to JSON conversion
SAML 1.1 Token Generator
Configuring the SAML Subject
Specifying SAML Conditions
Adding SAML Advice
Adding SAML Statements
Signing and Generating the SAML Assertion
STS / WS-Trust Client
HTTP configuration
WS-Security configuration

Examine also provides the following helpful tools under the ‘Tools’ tab.

  XSD to XML generator JSON to XML converter XML to JSON converter SAML 2.0 Token generator

XML Schema Validator

This tool is useful when you have an XML schema available and would like to validate some XML content against the schema(s) to check if the contents comply with the specified XML constructs.

There are two ways to do XML Schema validation of input XML:  

  • Against a specifics XML Schema (XSD), or

  • Against a schema validation scenario

Uploading XML Schemas

The first step is to add any schemas that should be used to validate the input xml. This can be done by clicking on the ‘Schemas’ tab.

Figure 9.1. XML Schema Validator Schemas view

XML Schema Validator Schemas view


Clicking on ‘Add’ will open the schema upload dialog as shown below:

Figure 9.2. XML Schema Validator - Upload schema

XML Schema Validator - Upload schema


Click on Browse to select either a single schema file (.xsd) or a ZIP archive file that contains the main schema file and its related imports/includes as relative references from the main schema. If a ZIP file is uploaded, Examine automatically unzips it and displays the available schema files in the archive as shown below:

Figure 9.3. XML Schema Validator - ZIP archive schemas view

XML Schema Validator - ZIP archive schemas view


In the example above, a file called catalog.zip was uploaded and its contents are displayed. The main file catalog.xsd includes as relative reference two other files (pricing.xsd and sequence.xsd) which are co-located with it. Here it is expected that the user knows which schema is the main/root schema and which one are the imports/includes from it.

Clicking on the schema name displays the schema contents in the ‘Schema’ tab on the right.

Figure 9.4. XML Schema Validator - Edit Schema

XML Schema Validator - Edit Schema


It is possible to edit the displayed schema and save it using the ‘Save’ button. ‘Revert’ can be used to revert any changes made prior to clicking on Save. Since Examine does not keep track of revisions, it is not possible to revert once Save has been clicked

Creating Schema Validation Scenarios

Schema validation scenarios provide a convenient way to group multiple schemas to be used as source to validate some input XML. Sometimes the contents of an XML document will need to be validated against multiple distinct schema files. This option allows you to create a schema-grouping.

To create a new validation scenario, click on ‘Add’ to bring up the dialog as shown below:  

Figure 9.5. XML Schema Validator - New Scenario Dialog

XML Schema Validator - New Scenario Dialog


Specify a unique non-empty validation name and select from the displayed schema files. Note that only those schema files which have been uploaded to the Examine system as described earlier in the Uploading XML Schemaswill be displayed here. You can use Ctrl/Cmd-Click to select multiple files at once.  

The created scenario is displayed in a tabular form under the ‘Scenarios’ tab:

Figure 9.6. XML Schema Validator - Scenarios list

XML Schema Validator - Scenarios list


Performing Schema Validation

Once the schemas have been uploaded, it is now possible to validate any input XML against a specific schema / a validation scenario. To do this, first paste the XML content in the ‘Input XML’ text area under the ‘XML’ tab on the right side and then click on the ‘Validate’ button to bring up the Validate XML dialog as shown below:

Figure 9.7. XML Schema Validator - Validate XML dialog

XML Schema Validator - Validate XML dialog


Select either the ‘Schema’ or the ‘Validation Scenario’ option and the corresponding name of the schema or scenario.   Clicking on OK will initiate the schema validation process and the result is displayed as either a successful validation or in the case of a failure, the schema error message is displayed.