Import XML | Version 4

Multiple Documents in XML

How to import multiple documents within one XML import file.

In some cases it might be handy to provide multiple documents within one XML import file. To do so, you have to encapsulate the <document> elements in the parent element <documents>:

<?xml version="1.0" encoding="UTF-8"?>
<documents xmlns="http://www.sophoracms.com/import/4.2"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <document nodeType="sophora-content:story">
    <properties>
      [...]
    </properties>
    <childNodes>
      [...]
    </childNodes>
    <resourceList>
      [...]
    </resourceList>
    <fields>
      [...]
    </fields>
    <instructions>
      [...]
    </instructions>
  </document>
  [...]
  <document nodeType="sophora-content:video">
    [...]
  </document>
  [...]
  <document nodeType="sophora-content:image">
    <properties>
      [...]
    </properties>
    <childNodes>
      [...]
    </childNodes>
    <resourceList>
      [...]
    </resourceList>
    <fields>
      [...]
    </fields>
    <instructions>
      [...]
    </instructions>
  </document>
</documents>

Last modified on 10/16/20

The content of this page is licensed under the CC BY 4.0 License. Code samples are licensed under the MIT License.

Icon