BCBuildingCode/
├── json-generation-pipeline/ # Complete transformation pipeline (primary working area)
│ ├── source/ # Source materials (NBC XML, amendments, revisions)
│ ├── transformation-xslt/ # XSLT transformation stylesheets
│ ├── tools/ # Saxon and Jing JAR files
│ ├── output/ # Generated XML and JSON files
│ └── docs/ # Pipeline documentation
├── docs/ # Repository-level documentation
├── bc-graphics/ # BC-specific graphics (EPS format)
├── graphics/ # NBC graphics (EPS/JPG/HTML)
├── NBC2020XML/ # NBC 2020 Arbortext source project (legacy)
├── Word-BCBC-mark-ups/ # BC Building Code Word documents (legacy)
└── proposed/ # Legacy XSLT and schemas (use json-generation-pipeline/ instead)
Complete transformation pipeline — the primary working area:
source/ - Source materials:
nbc-2020-xml/nbc2020.xml- NBC 2020 source XMLbc-amendments/xml/- BC overlay amendment files (structural changes)bc-amendments/word/- Original Word documents with BC amendmentsbc-amendments/amendment-list.xml- Registry of overlay amendment filesbc-revisions/xml/- BC revision amendment files (date-based versioning)bc-revisions/pdf/- Original Ministerial Order PDFsbc-revisions/revision-list.xml- Registry of revision amendment files
transformation-xslt/ - XSLT stylesheets:
nbc-to-canonical.xsl- Converts NBC vendor XML to canonical formatmerge-engine-v3.xsl- Applies BC amendments/revisions to canonical NBCcombine-amendments.xsl- Merges multiple amendment/revision filescanonical-to-json.xsl- Generates full JSON outputcanonical-to-json-minimal.xsl- Generates minimal JSON outputvalidate-amendments.xsl- Validates amendment/revision application
tools/ - Java libraries:
saxon.jar- Saxon HE 12.9+ XSLT processorjing.jar- RELAX NG validator
output/ - Generated files:
nbc-canonical.xml- NBC with canonical IDs (5.9 MB)bc-amendments-combined.xml- Combined BC overlay amendmentsbc-building-code.xml- BC Building Code after overlay amendments (5.9 MB)bc-revisions-combined.xml- Combined BC revision amendmentsbc-building-code-final.xml- Final BC Building Code with revisionsbc-building-code.json- Full AI-optimized JSON (6.9 MB)bc-building-code-minimal.json- Minimal JSON outputbc-building-code-schema.json- JSON Schemaschema/bc-overlay.rng- RELAX NG schema for BC overlay formatschema/canonical-nbc.rng- RELAX NG schema for canonical NBC formatamendment-validation-report.html- Overlay amendment validation resultsrevision-validation-report.html- Revision amendment validation results
docs/ - Documentation:
docs/project/- Comprehensive project documentation (system overview, guides, reference)commands.txt- Command reference for all transformations- Individual XSLT documentation files
Original NBC 2020 Arbortext project from National Research Council:
NBC_2020_p1_3.3/nbc2020_p1.xml- Main NBC XML (11.76 MB, 264k lines)NBC_2020_p1_3.3/nbc2020_p1-NO-DOCTYPE.xml- Version without DOCTYPE (for processing)NBC_2020_p1_3.3/graphic/- 593 EPS graphics organized by categoryAE_custom/doctypes/OBCode/- Arbortext DTD and configurationAE_custom/entities/- Entity definitions and FOSI formattingdocs/- Comprehensive Arbortext documentation
BC-specific graphics in EPS format (figures referenced in BC amendments)
NBC graphics organized by category (EPS, JPG, HTML, MMF formats)
- By part:
bc-part-1-amendments.xml - By date:
bc-amendments-2024-10-29.xml - By topic:
bc-fire-safety-amendments.xml - All in
json-generation-pipeline/source/bc-amendments/xml/directory
- By ministerial order:
Ministerial Order BA 2024 01.xml - By errata:
bc-errata-2025.xml - By policy:
bc-policy-updates-2025.xml - All in
json-generation-pipeline/source/bc-revisions/xml/directory
- Format:
nbc.divB.part3.sect7.subsect3.art1.sent1.clause1 - All content (NBC and BC) uses
nbc.prefix for unified namespace - BC-specific content identified by
source="bc"attribute - Divisions: divA (Division A), divB (Division B), divBV2 (Division B Volume 2), divC (Appendices)
Division Elements include the following attributes:
xml:id: Canonical ID (nbc.divA, nbc.divB, nbc.divBV2, nbc.divC)letter: Division letter (A, B, or C)volume: Physical publication volume (1 or 2)vendor-id: Original NBC vendor ID (optional)source: Source of division (nbc or bc) - optional
Volume Attribute:
volume="1": Division A, Division B (Parts 1-8), Division Cvolume="2": Division B Part 9 only (divBV2)
Example - Division BV2 (Volume 2):
<division xml:id="nbc.divBV2" letter="B" volume="2" vendor-id="nbc2020-b-v2">
<title>Acceptable Solutions</title>
<number>Division B</number>
<part xml:id="nbc.divBV2.part9" number="9">
<title>Housing and Small Buildings</title>
</part>
</division>- Articles:
eaprefix (e.g.,ea004586) - Sentences:
esprefix (e.g.,es007850) - Figures:
enprefix (e.g.,en000045f1) - Tables:
etprefix (e.g.,et000060) - Graphics:
EGorGGprefix (e.g.,EG01200A)
Each amendment file follows BC overlay format:
<bc-overlay version="1.0" nbc-target-version="2020">
<metadata>...</metadata>
<amendments>
<amendment id="bc-XXX" sequence="N">
<target type="canonical-id" id="nbc.divB..."/>
<replace|insert|modify|remove>
<new-content source="bc">...</new-content>
</replace|insert|modify|remove>
</amendment>
</amendments>
</bc-overlay>NBC follows strict hierarchy:
- Division → Part → Section → Subsection → Article → Sentence → Clause → Subclause
- Internal:
<ref type="internal" target="nbc.divB.part3.sect7..."/> - Terms:
<ref type="term" target="bldng">building</ref> - Standards:
<ref type="standard" target="csac22.2no.141" standardId="csac22.2no.141"/> - BC codes:
<ref type="bc-code" target="bcfc">BC Fire Code</ref>
docs/product-overview.md- Product overview and purposedocs/technology-stack.md- Technology stack, commands, performancedocs/project-structure.md- This filedocs/VALIDATION_PIPELINE.md- GitHub Actions JSON validation pipeline
01-system-overview.md- System overview and key concepts02-overlay-amendments-guide.md- Phase 1 amendment guide03-revision-amendments-guide.md- Phase 2 amendment guide04-merge-engine-reference.md- Technical merge engine reference05-validation-troubleshooting.md- Validation error troubleshooting06-quick-reference.md- Single-page quick reference07-examples-library.md- Curated working examples08-migration-guide.md- Migration guide (legacy to new pipeline)09-json-output-guide.md- JSON output structure and usage10-oxygen-xml-editor-guide.md- Visual editing guide for Oxygen XML11-global-text-replacements.md- Global text replacements (pre-processing)
- Individual documentation for each XSLT stylesheet