Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents

Scope

  • The XML Editor can be used to validate XML documents against an XSD schema.
  • Additional functionality is available with XSD schemas that stick to the following prerequisites.

Capabilities

Root element detection

In order to make the XML Editor detect the root element of a schema add a the comment  <!-- root element --> just before the root element of the XSD schema.

Code Block
languagexml
titleSample root element hint
collapsetrue
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
           elementFormDefault="qualified"
           version="1.0">
	<!-- root element -->
	<xs:element name="Configurations">
		...
	</xs:element>
</xs:schema>

Annotations for documentation

  • XSD schema files can include the documentation of their elements that is displayed by the XML Editor. 
  • Provide <xs:annotation> elements for documentation.
    • Use a namespace that allows XHTML elements.
    • Restrict the use of XHTML elements to a small subset such as <p>, <br>, <ul>, <li>, <strong> etc. 

...

Code Block
languagexml
titleSample annotation element
collapsetrue
<xs:annotation>
	<xs:documentation>
		<div xmlns="http://www.w3.org/1999/xhtml">
			<strong>Notes</strong>
			<p>
				Account for authentication at one of the systems involved in file transfer, e.g. an FTP or SFTP server.
				Usually the account corresponds to a user name.
			</p>
        </div>
    </xs:documentation>
</xs:annotation>

Reference handling

  • References of elements of an XML document to other elements in the same document are supported by the XML Editor in a way that such references can be displayed as lists from which the user selects the reference entry.
  • The referenced element contains an <xs:key> element with a selector and a field reference to an element or attribute. The value of this element or attribute will be displayed as a list by the XML Editor.
  • The referencing element contains an <xs:keyref> element with a refer attribute that points to the <xs:key name="..."> attribute of the referenced element.

...