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
| Week | Topics | Files |
|---|---|---|
| 1 | DOCX basics, common mistakes, hierarchy | Fundamentals 1-6 |
| 2 | Tables, SFDT format, testing workflows | Intermediate 2, 5, 6 |
| 3 | Reference materials, troubleshooting | Reference 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β
| Week | Focus Area | Required Reading | Practice |
|---|---|---|---|
| 1 | Fundamentals | Parts 1 (all) | Basic exercises |
| 2 | Intermediate | Parts 2 (all) | Table creation, SDT |
| 3 | Advanced I | Advanced 1-4 | Debugging exercises |
| 4 | Advanced II | Advanced 5-7 | Document merging |
| 5 | Integration | Code Examples, Reference | Build 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:
- Document Structure Basics - DOCX as ZIP, file organization
- Relationship Files - How document parts connect
- WordprocessingML Core - Paragraphs, runs, text nodes
- Namespaces - Understanding w:, r:, wp:, and more
- Common Fatal Mistakes - β οΈ THE BIG THREE errors
- Element Hierarchy Rules - Valid nesting and structure
- Practice Exercises - Hands-on learning
Part 2: Intermediate (Real-World Development)β
Practical knowledge for building documents:
- Content Controls (SDT) - Mail merge fields
- Tables in OOXML - Structure, merging, AppraiSys patterns
- Numbering and Lists - Why lists break and how to fix
- Styles and Formatting - Your system's style catalog
- Syncfusion SFDT Format - JSON document representation
- QA Testing Workflow - Tools and checklists
Part 3: Advanced (Complete System Mastery)β
Deep technical knowledge and system architecture:
- Advanced OOXML Internals - Revisions, fields, bookmarks
- Document Assembly - Merging without conflicts
- OOXML β SFDT Element Mapping - π₯ Complete transformation guide
- Diagnostics & Debugging - Tools and techniques
- Advanced Syncfusion - SFDT schema, bug workarounds
- Performance & Stability - Memory management
- AppraiSys Specific Patterns - Saga architecture
- Practice Exercises - Advanced challenges
Part 4: Reference Materials (Quick Lookup)β
Comprehensive reference tables and quick guides:
- OOXML Element Reference - Complete element catalog
- Property Elements - Paragraph, run, table properties
- Units Conversion - Twips, EMU, points
- Syncfusion-OOXML Mapping - Quick reference table
- Error Codes - Common validation errors
- System Styles Reference - DefaultDocument.cs catalog
- Debugging Workflows - Decision trees
- Quick Reference Cheatsheet - Essential quick reference
Part 5: Code Examples (Copy-Paste Ready)β
Working code from the AppraiSys codebase:
- Creating Documents - Create documents from scratch
- Table Creation - Build tables with borders
- Content Controls - SDT and mail merge
- Image Handling - Embed and size images
- Document Merging - Safe merge patterns
- Syncfusion Patterns - DOCXβSFDT conversion
Part 6: Appendices (Deep Reference)β
Complete technical specifications:
- Namespace Reference - All OOXML namespaces
- SFDT JSON Schema - Complete schema
- Architecture Diagrams - System pipelines
- Troubleshooting Guide - Common issues
- Glossary - All technical terms
π― Quick Start Guidesβ
"I need to fix a broken document NOW!"β
- Open document in OpenXML SDK Productivity Tool
- Run validator to see errors
- Check Common Fatal Mistakes
- Review Error Codes
- 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:
| Tool | Purpose | Required For |
|---|---|---|
| Open XML SDK Productivity Tool | Visual OOXML inspector | QA, Developers |
| 7-Zip or WinRAR | Explore DOCX as ZIP | Everyone |
| Microsoft Word (Developer Tab enabled) | Test documents, inspect SDT | Everyone |
| Visual Studio / VS Code | Write code | Developers |
| Oxygen XML Editor (optional) | Advanced XML editing | Developers (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β
| OOXML | SFDT | Purpose |
|---|---|---|
w:p | block (paragraph) | Paragraph |
w:r + w:t | inline (text) | Text run |
w:tbl | block (table) | Table |
w:drawing | inline (image) | Image |
w:pPr | paragraphFormat | Paragraph formatting |
w:rPr | characterFormat | Character 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β
- Choose your learning path above
- Read sections in order
- Try practice exercises
- 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:
- QA Team: Document Structure Basics
- Developers: Document Structure Basics
Remember: Understanding the fundamentals prevents 90% of document corruption issues!