Skip to main content
This guide covers the essential operations for working with Kodexa Documents: creating, loading, manipulating, and saving documents.

Installation

Initialization

Creating Documents

Empty Document

Create a new document and build its structure:

From Text

Automatically parse text into paragraphs:

With Metadata

Initialize documents with metadata:

Loading Documents

From KDDB File / Blob

From JSON

Working with Content Nodes

Traverse the document tree:

Content Access

Read and modify node content:

Querying with Selectors

Use XPath-like selectors to find nodes:

Common Selector Patterns

Adding Features

Attach metadata to nodes:

Adding Tags

Annotate nodes with tags:

Saving Documents

To KDDB File / Blob

To JSON

Memory Management

Both SDKs use native code (Go via CFFI for Python, WebAssembly for TypeScript). Proper cleanup prevents memory leaks.

Complete Example

A full invoice processing workflow:

Next Steps

As you become more familiar with the SDK, explore:
  • Advanced XPath selectors for complex queries
  • Processing steps for workflow tracking
  • Integration with Kodexa Platform for cloud processing