/
Inserting new top-level resources

Information Classification: External Restricted.
See https://www.chili-publish.com/security

Inserting new top-level resources

If you check out ?Document XML structure overview, you'll notice a series of top-level resources, such as:

  • fonts
  • colors
  • paragraphStyles
  • characterStyles
  • variables
  • ...

Adding series of these resources from scratch (or by duplicating from an existing document), is usually relatively easy. Especially if the new resources are being created for the end-users ease of use (and not being used immediately in other generated content).

The only consideration is that certain other top-level resources might be referenced within the resource you're inserting/copying.

Fonts are easy: they don't contain any references to other CHILI Objects. So their XML can simply be inserted (either from scratch, or by duplicating from another CHILI document), as long as they follow the rules in ?Fonts XML

Variables: very much likewise (although there is a potential reference to another variable in the imagePulldownDirectoryVariable property).

But colors, paragraphStyles and characterStyles contain some more references (mostly to colors, in various properties). When inserting/duplicating such content, you should device a mechanism to also insert the referenced resources (and, if applicable, updating the new IDs).

?Copying XML content between documents

Related content

Document Object Model - Page
Document Object Model - Page
Read with this
Copying XML content between documents
Copying XML content between documents
More like this
External Snippets XML
External Snippets XML
Read with this
General XML Concepts
General XML Concepts
More like this
Finding object properties and functions
Finding object properties and functions
Read with this
Creating documents using the API
Creating documents using the API
More like this

All information on this page must be treated as External Restricted, or more strict. https://www.chili-publish.com/security