How to Create XML-Formatted Content
This article describes how to create Documoto content in the form of interactive pages (PLZs) as well as a Media XML (defining your book's TOC and metadata).
Please see the attachments on this article for more detailed information on the Documoto XML specification and Documoto source content formats.
Article Topics
- Source Content Required
- Page Parts List XML Specification and Example
- Page Hotpoints-to-Image-to-Parts List Mapping Specification and Example
- Media TOC XML Specification and Example
- Using Processing Instructions
- Additional Requirements
- Valid Documoto Language Locale Values
- Attachments
Source Content Required
Documoto requires two key elements to perform a content import:
- Book Table of Contents ("TOC"): the structure of the Table of Contents must enable determination of which pages belong to the Book Table of Contents and in what order and is comprised of the following element:
- Media TOC (XML file)
- Page Content: the page content is further comprised of the following elements:
- Page Parts List (XML file)
- Page Diagram Image (PNG file)
- Page Hotpoints-to-Image-to-Parts List Mapping (SVG file)
Page Parts List XML Specification and Example
A Documoto Page Parts List XML file should contain all of the page’s metadata and part information. The Page Parts List XML file should also contain a link to the page’s SVG file (via the pageFile attribute in the XML Page element):
<?xml version="1.0" encoding="UTF-8"?>
<Page xmlns="http://digabit.com/documoto/partslist/1.6" pageFile="917161J_1-1.svg" tenantKey="DOCUMOTO">
<Part item="1" partNumber="055648" quantity="2" supplierKey="DOCUMOTO1" unitOfMeasure="">
<Translation locale="" name="TIE/WIRE"></Translation>
</Part>
<Part item="2" partNumber="062023" quantity="1" supplierKey="DOCUMOTO1" unitOfMeasure="">
<Translation locale="" name="CLAMP/HOSE #M5"></Translation>
</Part>
<Part item="3" partNumber="064260" quantity="2" supplierKey="DOCUMOTO1" unitOfMeasure="">
<Translation locale="" name="NUT/HEX 5/16"></Translation>
</Part>
<Part item="4" partNumber="067847" quantity="1" supplierKey="DOCUMOTO1" unitOfMeasure="">
<Translation locale="" name="NUT/HEX 3/8"></Translation>
</Part>
<Tag name="SERIAL NUMBER" value="123456"/>
<Translation locale="en_US" name="TIRE ASSEMBLY"/>
</Page>
Page Hotpoints-to-Image-to-Parts List Mapping Specification and Example
An SVG file is used to define the hotpoint data for the page. The SVG filename is what Documoto will use in your Media XML to refer to your pages. Using the above Page Parts List XML, our SVG could look like this (notice the link to the pages PNG in the image element):
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:html="http://www.w3.org/TR/REC-html40">
<image id="snapshot" x="0" y="0" width="1620" height="1287" xlink:href="917161J_1-1.png"/>
<g>
<ellipse rx="15" ry="15" fill="#4A4A4A" fill-opacity="1.0" stroke="#FFFFFF" stroke-width="2" cx="93" cy="294"/>
<text x="93" y="294" fill="#FFFFFF" fill-opacity="1.0" text-anchor="middle">1</text>
</g>
<g>
<ellipse rx="15" ry="15" fill="#4A4A4A" fill-opacity="1.0" stroke="#FFFFFF" stroke-width="2" cx="1016" cy="148"/>
<text x="1016" y="148" fill="#FFFFFF" fill-opacity="1.0" text-anchor="middle">3</text>
</g>
<g>
<ellipse rx="15" ry="15" fill="#4A4A4A" fill-opacity="1.0" stroke="#FFFFFF" stroke-width="2" cx="889" cy="340"/>
<text x="889" y="340" fill="#FFFFFF" fill-opacity="1.0" text-anchor="middle">2</text>
</g>
<g>
<ellipse rx="15" ry="15" fill="#4A4A4A" fill-opacity="1.0" stroke="#FFFFFF" stroke-width="2" cx="777" cy="310"/>
<text x="777" y="310" fill="#FFFFFF" fill-opacity="1.0" text-anchor="middle">3</text>
</g>
<g>
<ellipse rx="15" ry="15" fill="#4A4A4A" fill-opacity="1.0" stroke="#FFFFFF" stroke-width="2" cx="1051" cy="301"/>
<text x="1051" y="301" fill="#FFFFFF" fill-opacity="1.0" text-anchor="middle">4</text>
</g>
<g>
<ellipse rx="15" ry="15" fill="#4A4A4A" fill-opacity="1.0" stroke="#FFFFFF" stroke-width="2" cx="1106" cy="248"/>
<text x="1106" y="248" fill="#FFFFFF" fill-opacity="1.0" text-anchor="middle">5</text>
</g>
</svg>
Using the example above, the following files should be provided:
- 917161J_1-1.xml
- 917161J_1-1.png
- 917161J_1-1.svg
Together, these files can be zipped and converted into the native Documoto (PLZ) format for importing into Documoto.
Media TOC XML Specification and Example
The Media TOC XML contains a book’s Table of Contents and metadata. To correctly reference a Page within the Table of Contents, you will need to know the Page’s pageFile name and the Documoto language translations to be associated with it (via the Translation attribute and locale property).
Tip: A list of valid language locale values is provided below
The below example will create a Media TOC XML file with one chapter that contains two pages (one of which was shown in the above example):
<?xml version="1.0" encoding="UTF-8"?>
<Media xmlns="http://digabit.com/documoto/book/1.2.1" identifier="ET17364A" tenantKey="DOCUMOTO">
<Translation description="Parts Catalog for ET17364A" locale="en_US" name="ET17364A - 10SC32 - - SHANXI DEYUAN FUGU ENERGY CO"/>
<Tag name="Model" value="10SC"/>
<Tag name="Mine Name" value="SHANXI DEYUAN FUGU ENERGY CO"/>
<Tag name="Equipment Type" value="Shuttle Car"/>
<Tag name="New Serial Number" value="ET17364A"/>
<Tag name="Country" value="China"/>
<Tag name="Region" value="China"/>
<Chapter>
<Translation description="" locale="en_US" name="GENERAL GROUP" />
<Translation description="" locale="ja_JA" name="总组" />
<Page pageFile="917161J_1-1.svg">
<Translation description="" locale="en_US" name="ARRANGEMENT, GENERAL, MACHINE CN-ET002927-0017" />
<Translation description="" locale="ja_JA" name="设备总装图 CN-ET002927-0017" />
</Page>
<Page pageFile="917161J_1-2.svg">
<Translation description="" locale="en_US" name="CAUTION STATEMENT CN-IL000046-0000" />
<Translation description="" locale="ja_JA" name="注意事项 CN-IL000046-0000" />
</Page>
</Chapter>
</Media>
Using Processing Instructions
-
Update Or Replace Part Tags (Default is UPDATE)
- When set to Replace, will remove ALL Part tags from the Parts within your PLZ or Media XML and replace with ONLY the ones in the PLZ or Media XML you publish.
- When set to Update, will add any new tags from your PLZ or Media XML to your parts.
-
Update Or Replace PageTags (Default is UPDATE)
- When set to Replace, will remove ALL Page tags from your PLZ or from ALL pages within your Media XML and replace with ONLY the ones in the PLZ or Media XML you publish.
- When set to Update, will add any new tags to your PLZ or Media XML.
-
Add Or Replace Attachments (Default is ADD)
- When set to Add, will add any new Attachments to your PLZ or Media XML.
- When set to Replace, will remove ALL Attachments tied to your PLZ or Media XML and replace with ONLY the ones in the PLZ or Media XML you publish.
-
Lock Part Translations (Default is UPDATE)
- When set to false, if a Part Translation differs from what is in Documoto, your Part Translation will be updated to match what is in your PLZ or Media XML.
- When set to true, if a Part already exists in Documoto and the Part Translation on your Page/Media XML differs from Documoto, your Part Translation will NOT be updated to match your PLZ or Media XML.
- Update Or Replace Hotpoint Links (Default is REPLACE for PLZs and UPDATE for Media XMLs)
- When set to Replace, All Hotpoint Links will be removed and replaced with what is in your PLZ or Media XML.
- When set to Update, any new Hotpoint Links will be added to your PLZ or Media XML.
Example XML:
<ProcessingInstructions updateOrReplacePartTags="UPDATE" updateOrReplacePageTags="UPDATE"
addOrReplaceAttachments="ADD" updateOrReplaceAssemblyParts="UPDATE" lockPartTranslations="true"
updateOrReplaceHotpointLinks="REPLACE" />
Additional Requirements
Documoto Auto-Hotpointing
The Documoto algorithm to automatically create diagram hotpoints is only as good as the source content provided and is not guaranteed at 100% accuracy. Additional information on how SVG auto-hotpointing can be achieved can be found in the Documoto Knowledge Base here.
Character Encoding
All data provided to Documoto for importing must be UTF-8 and XML encoded. Details on characters that must be XML encoded can be found here: https://webfocusinfocenter.informationbuilders.com/wfappent/TLs/TL_lang/source/xmlencod.htm
Valid Documoto Language Locale Values
Documoto now automatically maps older 2-character locale codes (e.g., en) to their extended equivalents (e.g., en-US) when importing or republishing XML content. This ensures seamless processing of legacy content and proper locale assignment upon publishing.
For a list of Valid Documoto Language Codes, please see this Knowledge Base Article: Documoto Language Support