Import XML

Importing Taxonomy Tags in XML

How to import tags into a existing taxonomy document with am XML import file.

It is possible to import tags into existing taxonomy documents (nodetype = sophora-nt:enhancedTag). In order to achieve this, the root element of an import XML file has to be <sophora>. If you want to import taxonomy tags, you have to add a <taxonomyTagsDefinitions> element as a direct and first child element of <sophora>. Inside this wrapper element, you then place the <taxonomyTags> elements. Other elements to import nodetypes or documents might follow in the XML file.

It is possible to import into multiple taxonomy documents. Each taxonomy document is specified by its externalID using the attribute taxonomyExternalID on the respective <taxonomyTags> element.

The following XML shows all available properties for tags. As shown by the further down part for countries, only label must be given. All other elements are optional and can be omitted.

<?xml version="1.0" encoding="UTF-8"?> 
<sophora xmlns="http://www.sophoracms.com/import/6.0"> 	
  <taxonomyTagsDefinitions>
    <taxonomyTags taxonomyExternalID="taxonomy_cities">
      <taxonomyTag> 			
        <id>taxo_kopenhagen</id>
        <label>Kopenhagen</label>
        <blocked>false</blocked>
        <synonyms>
          <synonym>CPH</synonym>
          <synonym>Copenhagen</synonym>
          <synonym>København</synonym>
        </synonyms>
        <types>
          <type>city</type>
        </types>
      </taxonomyTag>
      <taxonomyTag>
        <id>taxo_stockholm</id>
        <label>Stockholm</label>
        <blocked>false</blocked>
        <synonyms>
          <synonym>STO</synonym>
        </synonyms>
        <types>
          <type>city</type>
        </types>
      </taxonomyTag>
      <taxonomyTag>
        <id>taxo_oslo</id>
        <label>Oslo</label>
        <blocked>false</blocked>
        <synonyms>
          <synonym>OSL</synonym>
        </synonyms>
        <types>
          <type>city</type>
        </types>
      </taxonomyTag>
    </taxonomyTags>
    <taxonomyTags taxonomyExternalID="taxonomy_countries">
      <taxonomyTag> 
        <label>Denmark</label>
      </taxonomyTag>
      <taxonomyTag>
        <label>Sweden</label>
      </taxonomyTag>
      <taxonomyTag>
        <label>Norway</label>
      </taxonomyTag>
    </taxonomyTags>
  </taxonomyTagsDefinitions>
</sophora>

Last modified on 6/16/26

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

Icon