The general structure of a Sophora import XML file looks like the following:
<?xml version="1.0" encoding="UTF-8"?>
<document nodeType="NODETYPE"
xmlns="http://www.sophoracms.com/import/4.2"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<properties>
[...]
</properties>
<childNodes>
<childNode nodeType="NODETYPE" name="CHILDNODE-NAME">
[...]
</childNode>
</childNodes>
<resourceList>
<document nodeType="NODETYPE" externalID="EXTERNAL-ID">
[...]
</document>
</resourceList>
<fields>
[...]
</fields>
<instructions>
[...]
</instructions>
</document>
The root element is <document>
. Its attribute nodeType
specifies the node type this document shall be assigned to. This property is required for new documents and all child nodes. Such a document comprises its properties (<properties>
element), the entailed childnodes (<childNodes>
element) and assigned documents (<resourceList>
element). Furthermore, the <fields>
element contains the document's metadata.
<major>.<minor>
. For testing it might be necessary to declare the location of the schema explicitly for validating the XML in your development environment. In that case you declare the full file name including the bugfix version and the file extension in the root element, like the following example:<?xml version="1.0" encoding="UTF-8"?>
<document nodeType="sophora-content:story"
xmlns="http://www.sophoracms.com/import/4.2"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.sophoracms.com/import/4.2 http://www.sophoracms.com/import/4.2/sophora-import-4.2.0.xsd">