Import XML

Childnodes

How to import childnodes using Sophora's import XML.

The element <childNodes> comprises content that has not been modeled as a separate document and is therefore existence-dependend on the parent document.

An image object, for example, comprises the corresponding image data (childnode of type sophora-extension-nt:imagedata).

In addition to the node type the cildnode's name has to be provided (the name attribute of an <childNode> element) since it is possible to add childnodes, which have the same type but different names:

<?xml version="1.0" encoding="UTF-8"?>
<document nodeType="sophora-content-nt:imageobject"
          xmlns="http://www.sophoracms.com/import/2.8"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <properties>
    [...]
  </properties>
  <childNodes>
    <childNode nodeType="sophora-extension-nt:imagedata" name="sophora-extension:imagedata">
      <properties>
        <property name="sophora-extension:imagetype">
          <value>original</value>
        </property>
        <property name="sophora-extension:binarydata">
          <value>olympiapeking_menschenmenge.jpg</value>
        </property>
        <property name="sophora:mimetype">
          <value>image/jpeg</value>
        </property>
      </properties>
      <childNodes/>
      <resourceList/>
    </childNode>
  </childNodes>
  <resourceList>
  </resourceList>
  <fields>
    [...]
  </fields>
  <instructions>
    [...]
  </instructions>
</document>

Last modified on 10/2/20

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

Icon