Skip to main content

OOXML & Syncfusion SFDT Documentation

Comprehensive guide for understanding and working with Office Open XML (OOXML) and Syncfusion Document Format (SFDT) in the AppraiSys real estate appraisal system.


πŸ“š Documentation Overview​

This documentation provides everything you need to know about generating, manipulating, and debugging DOCX documents using OOXML and Syncfusion SFDT formats. Whether you're a QA tester or developer, this guide will help you avoid common pitfalls and master document generation.

What You'll Learn​

  • OOXML Fundamentals: How DOCX files work under the hood
  • Common Mistakes: The three fatal errors that corrupt documents
  • SFDT Format: Syncfusion's JSON-based document representation
  • Element Mapping: How OOXML structures translate to SFDT
  • Practical Patterns: Real code examples from the AppraiSys codebase
  • Debugging: Tools and techniques for diagnosing issues
  • Performance: Memory management and optimization strategies

πŸ—ΊοΈ Learning Paths​

Choose your path based on your role:

πŸ” For QA Team Members (Non-Technical Focus)​

Goal: Understand document structure to identify issues and test effectively

Estimated Time: 2-3 weeks

WeekTopicsFiles
1DOCX basics, common mistakes, hierarchyFundamentals 1-6
2Tables, SFDT format, testing workflowsIntermediate 2, 5, 6
3Reference materials, troubleshootingReference 1-7, Appendix 4

Key Skills:

  • Identify malformed OOXML structures
  • Use OpenXML SDK Productivity Tool
  • Create effective test checklists
  • Perform round-trip validation

Start Here: document-structure-basics.md


πŸ’» For Developers (All Levels)​

Goal: Master the complete document generation system from fundamentals through advanced architecture

Estimated Time: 4-5 weeks for comprehensive mastery

Phase 1: Foundations (Week 1)​

Topics: Core OOXML concepts and WordprocessingML Files: All Fundamentals 1-7

Learn how DOCX files work, the relationship system, and the three fatal mistakes that corrupt documents.

Key Skills:

  • Understand DOCX as ZIP structure
  • Navigate relationship files
  • Master WordprocessingML core elements (paragraphs, runs, text)
  • Recognize and avoid fatal structural errors

Phase 2: Practical Development (Week 2)​

Topics: Real-world document construction Files: All Intermediate 1-7

Build tables, work with content controls, understand Syncfusion SFDT format, and master the patterns used in AppraiSys.

Key Skills:

  • Generate valid OOXML programmatically
  • Work with content controls (SDT) for mail merge
  • Create complex table structures
  • Convert between DOCX and SFDT formats
  • Apply AppraiSys coding patterns correctly

Phase 3: Advanced Systems (Weeks 3-4)​

Topics: Document assembly, performance, and architecture Files: All Advanced 1-7

Deep dive into document merging, OOXML↔SFDT transformation, debugging complex issues, and understanding the saga architecture.

Key Skills:

  • Merge documents without ID conflicts
  • Master complete OOXML↔SFDT element mapping
  • Debug complex OOXML issues using diagnostic tools
  • Optimize memory usage and performance
  • Understand AppraiSys saga architecture
  • Create workarounds for Syncfusion bugs
  • Handle revisions, fields, and bookmarks

Phase 4: Mastery & Practice (Week 4-5)​

Topics: Code examples, exercises, and complete reference Files: All Code Examples, All Reference, All Appendices

Apply everything through practical coding exercises and build a complete mental model of the system.

Key Skills:

  • Write production-ready document generation code
  • Reference element catalogs quickly
  • Troubleshoot any document corruption issue
  • Perform unit conversions (twips, EMU, points)
  • Apply all AppraiSys patterns correctly

Suggested Learning Schedule​

WeekFocus AreaRequired ReadingPractice
1FundamentalsParts 1 (all)Basic exercises
2IntermediateParts 2 (all)Table creation, SDT
3Advanced IAdvanced 1-4Debugging exercises
4Advanced IIAdvanced 5-7Document merging
5IntegrationCode Examples, ReferenceBuild complete feature

Optional Deep Dives: For specific areas of focus, spend extra time on:

  • Document Assembly: Advanced 2, Code Examples 5
  • Performance Optimization: Advanced 6, Appendix 3
  • Syncfusion Internals: Advanced 5, Appendix 2
  • AppraiSys Architecture: Advanced 7, Appendix 3

Start Here: document-structure-basics.md


πŸ“– Documentation Structure​

Part 1: Fundamentals (Essential for Everyone)​

Core concepts you must know before working with OOXML:

  1. Document Structure Basics - DOCX as ZIP, file organization
  2. Relationship Files - How document parts connect
  3. WordprocessingML Core - Paragraphs, runs, text nodes
  4. Namespaces - Understanding w:, r:, wp:, and more
  5. Common Fatal Mistakes - ⚠️ THE BIG THREE errors
  6. Element Hierarchy Rules - Valid nesting and structure
  7. Practice Exercises - Hands-on learning

Part 2: Intermediate (Real-World Development)​

Practical knowledge for building documents:

  1. Content Controls (SDT) - Mail merge fields
  2. Tables in OOXML - Structure, merging, AppraiSys patterns
  3. Numbering and Lists - Why lists break and how to fix
  4. Styles and Formatting - Your system's style catalog
  5. Syncfusion SFDT Format - JSON document representation
  6. QA Testing Workflow - Tools and checklists

Part 3: Advanced (Complete System Mastery)​

Deep technical knowledge and system architecture:

  1. Advanced OOXML Internals - Revisions, fields, bookmarks
  2. Document Assembly - Merging without conflicts
  3. OOXML ↔ SFDT Element Mapping - πŸ”₯ Complete transformation guide
  4. Diagnostics & Debugging - Tools and techniques
  5. Advanced Syncfusion - SFDT schema, bug workarounds
  6. Performance & Stability - Memory management
  7. AppraiSys Specific Patterns - Saga architecture
  8. Practice Exercises - Advanced challenges

Part 4: Reference Materials (Quick Lookup)​

Comprehensive reference tables and quick guides:

  1. OOXML Element Reference - Complete element catalog
  2. Property Elements - Paragraph, run, table properties
  3. Units Conversion - Twips, EMU, points
  4. Syncfusion-OOXML Mapping - Quick reference table
  5. Error Codes - Common validation errors
  6. System Styles Reference - DefaultDocument.cs catalog
  7. Debugging Workflows - Decision trees
  8. Quick Reference Cheatsheet - Essential quick reference

Part 5: Code Examples (Copy-Paste Ready)​

Working code from the AppraiSys codebase:

  1. Creating Documents - Create documents from scratch
  2. Table Creation - Build tables with borders
  3. Content Controls - SDT and mail merge
  4. Image Handling - Embed and size images
  5. Document Merging - Safe merge patterns
  6. Syncfusion Patterns - DOCX↔SFDT conversion

Part 6: Appendices (Deep Reference)​

Complete technical specifications:

  1. Namespace Reference - All OOXML namespaces
  2. SFDT JSON Schema - Complete schema
  3. Architecture Diagrams - System pipelines
  4. Troubleshooting Guide - Common issues
  5. Glossary - All technical terms

🎯 Quick Start Guides​

"I need to fix a broken document NOW!"​

  1. Open document in OpenXML SDK Productivity Tool
  2. Run validator to see errors
  3. Check Common Fatal Mistakes
  4. Review Error Codes
  5. Follow Troubleshooting Guide

"Images aren't showing up!"​

β†’ Troubleshooting: Missing Images

"Word shows 'repair' dialog!"​

β†’ Common Fatal Mistakes + Debugging Workflows

"How do I create a table?"​

β†’ Tables in OOXML + [Table Creation Code](05-Code examples/02-table-creation.md)

"What's the difference between OOXML and SFDT?"​

β†’ OOXML ↔ SFDT Element Mapping


πŸ”§ Essential Tools​

Before you start, install these tools:

ToolPurposeRequired For
Open XML SDK Productivity ToolVisual OOXML inspectorQA, Developers
7-Zip or WinRARExplore DOCX as ZIPEveryone
Microsoft Word (Developer Tab enabled)Test documents, inspect SDTEveryone
Visual Studio / VS CodeWrite codeDevelopers
Oxygen XML Editor (optional)Advanced XML editingDevelopers (advanced debugging)

Download links in QA Testing Workflow.


⚠️ The Three Fatal Mistakes​

Before reading anything else, memorize these three errors that corrupt documents:

❌ Mistake #1: SDT inside Run​

<!-- WRONG -->
<w:r>
<w:sdt>...</w:sdt>
</w:r>

❌ Mistake #2: Table inside Run​

<!-- WRONG -->
<w:r>
<w:tbl>...</w:tbl>
</w:r>

❌ Mistake #3: Text without Run or Paragraph​

<!-- WRONG -->
<w:body>
<w:t>Text</w:t>
</w:body>

Full explanation: Common Fatal Mistakes


πŸ“Š Document Generation Overview​

High-level view of how AppraiSys generates appraisal reports:

Detailed explanation: AppraiSys Specific Patterns


πŸ’‘ Key Concepts at a Glance​

Document Hierarchy​

document
└─ body
β”œβ”€ p (paragraph)
β”‚ └─ r (run)
β”‚ └─ t (text)
β”œβ”€ tbl (table)
β”‚ └─ tr (row)
β”‚ └─ tc (cell)
β”‚ └─ p (required!)
└─ sdt (content control)

OOXML β†’ SFDT Mapping​

OOXMLSFDTPurpose
w:pblock (paragraph)Paragraph
w:r + w:tinline (text)Text run
w:tblblock (table)Table
w:drawinginline (image)Image
w:pPrparagraphFormatParagraph formatting
w:rPrcharacterFormatCharacter formatting

Complete mapping: OOXML ↔ SFDT Element Mapping


πŸ“ž Getting Help​

Documentation Issues​

If you find errors or have suggestions, contact the documentation maintainer.

Code Issues​

For AppraiSys codebase questions, refer to your team's standard channels.

Syncfusion Issues​

Check Advanced Syncfusion for known bugs and workarounds.


πŸ—‚οΈ AppraiSys System Context​

This documentation focuses on document generation within the AppraiSys real estate appraisal system. Key components referenced:

  • DefaultDocument.cs - Custom style definitions
  • DocumentAssembler - Template-based generation
  • SyncfusionFieldsPipelineStep - Mail merge processing
  • MergeReportSectionsConsumer - Multi-section assembly
  • ReportGenerationSaga - Orchestration architecture

See AppraiSys Specific Patterns for complete system overview.


πŸ“ How to Use This Documentation​

First Time Reading​

  1. Choose your learning path above
  2. Read sections in order
  3. Try practice exercises
  4. Reference back as needed

As Reference​

  • Use table of contents to jump to topics
  • Check Quick Start Guides for common tasks
  • Bookmark Reference section for frequent lookups

For Code Reviews​

  • Share relevant sections with team members
  • Reference specific mistakes in PR comments
  • Use as training material for new developers

πŸ“… Last Updated​

This documentation is maintained by the AppraiSys development team.

Version: 1.1
Last Update: November 2025
Changelog: Merged backend and senior developer paths into unified developer path


πŸš€ Ready to Start?​

Pick your path and dive in:

Remember: Understanding the fundamentals prevents 90% of document corruption issues!