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 |
---|
language | xml |
---|
title | Sample root element hint |
---|
collapse | true |
---|
|
<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 documents files can contain include the documentation of its their elements that is displayed by the XML Editor.
- Provide
<xs:annotation>
elements for documentation.- Use a namespace that allows xhtml XHTML elements.
- Restrict the use of xhtml XHTML elements to a small subset such as
<p>, <br>, <ul>, <li>, <strong>
etc.
...
Code Block |
---|
language | xml |
---|
title | Sample annotation element |
---|
collapse | true |
---|
|
<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.
...
Code Block |
---|
language | xml |
---|
title | Sample XML document with reference handling |
---|
collapse | true |
---|
|
<Configurations xsi:noNamespaceSchemaLocation="http://www.sos-berlin.com/schema/jade/JADE_configuration_v1.0.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Fragments>
<ProtocolFragments>
<SFTPFragment name="sftpFrag">
...
</SFTPFragment>
</ProtocolFragments>
</Fragments>
...
<Profile>
<CopySourceFragmentRef>
<SFTPFragmentRef ref="sftpFrag"/>
</CopySourceFragmentRef>
</Profile>
</Configurations> |
Limitations
tbd
- xs:includes?
- knownn limitations?
...