Search

 

Module: Editor

Version: 18.01 +

Type: Boolean

Category: Text

 

Description

The formula ‘IsValidXml’ checks whether an xml string is valid according to an xsd schema.

Parameters

Xsd file:

The full path to an Xsd file that is used to validate the xml string.

Xml string:

The Xml string to be validated

Namespace:

The namespace of the Xml. If omitted (that is, an empty string is defined), the (default) target namespace of the Xsd file is used. This behavior is often sufficient.

Example

Description

Suppose you want to validate this xml string:


	8

against this Xsd file, which is located in 'C:\temp\check.xsd':



	
		
			
				 
			
		
	
	
		
			
				
			
		
	

Values parameters

Xsd file:

C:\temp\check.xsd

Xml string:


	8

Namespace:

http://www.ActuIT.nl/Futurama/WebService/Faculteit or empty string

Result

Result: true

Remarks

This formula will return an exception if:

  • The defined xsd file does not exist or is not accessible
  • The namespace as defined in the 3rd parameter of the formula does not exist in the defined Xsd file

This formula will return false if:

  • the Xml string is not properly-structured xml (for example, closing tag is missing)
  • the Xml string is properly-structured, but the structure does not meet the requirements as defined in the Xsd file and namespace in the formula (or the default namespace of Xsd file if an empty namespace is defined).

This formula will return true if:

  • the Xml string is properly-structured, and meets the requirements as defined in the Xsd file.
  • the Xml string is properly-structured, the defined namespace is equal to the namespace in the Xsd file, but the namespace is NOT equal to the namespace in the Xml string. In that case, the Xml string is valid according to the Xsd definition. This is because in fact no real check is performed: in the Xsd file the specifications of the XmlString are not defined, so by definition the Xml string meets the requirements.

Related Topics

- Creating XSD files and using them in combination with Futurama: Xsd support in Futurama.

External Links

- W3Schools: XML Schema Tutorial

Feedback

If you have any questions about this subject or if you want to provide us feedback please send us an e-mail.

Updated: 2018-01-02