# ==============================================================================
# Precision Technical Press — Kestrel KP-200 Read/Write Rules File
# Application: Kestrel-FSM
# Standard: DITA/OASIS XML Translation Specification
# ==============================================================================

# ------------------------------------------------------------------------------
# 1. High-Level Document Containers
# ------------------------------------------------------------------------------
element "manual" is fm element "Manual";
element "frontmatter" is fm element "FrontMatter";
element "chapter" is fm element "Chapter";
element "section" is fm element "Section";

# ------------------------------------------------------------------------------
# 2. Block Containers and Typographic Elements
# ------------------------------------------------------------------------------
element "title" is fm element "Title";
element "para" is fm element "Para";
element "procedure" is fm element "Procedure";
element "step" is fm element "Step";

element "warning" {
  is fm element "SafetyWarning";
  attribute "severity" is fm attribute "Severity";
}

# ------------------------------------------------------------------------------
# 3. Object Mappings: Tables
# ------------------------------------------------------------------------------
element "partstable" {
  is fm table element "PartsTable";
  table parts {
    cals blk;
    element "title" is fm element "TableTitle";
    element "tgroup" unwrap;
    element "thead" is fm element "THead";
    element "tbody" is fm element "TBody";
    element "row" is fm element "Row";
    element "entry" is fm element "Cell";
  }
}

# ------------------------------------------------------------------------------
# 4. Object Mappings: Markers & Cross-References
# ------------------------------------------------------------------------------
element "indexterm" {
  is fm marker element "IndexMarker";
  marker text is content;
}

element "xref" {
  is fm cross-reference element "XRef";
  attribute "href" is fm property cross-reference id;
}

# ------------------------------------------------------------------------------
# 5. Editorial Dropping & Unwrapping
# ------------------------------------------------------------------------------
element "draftcomment" drop;
element "contentwrapper" unwrap;

# ------------------------------------------------------------------------------
# 6. Condition & Attribute Profiling Mapping
# ------------------------------------------------------------------------------
reader conditional text {
  fm condition "PrintOnly" is attribute "audience" value "print";
  fm condition "WebOnly" is attribute "audience" value "web";
  fm condition "Model_KP200" is attribute "product" value "KP200";
  fm condition "Model_KP250" is attribute "product" value "KP250";
}

writer conditional text {
  attribute "audience" value "print" is fm condition "PrintOnly";
  attribute "audience" value "web" is fm condition "WebOnly";
  attribute "product" value "KP200" is fm condition "Model_KP200";
  attribute "product" value "KP250" is fm condition "Model_KP250";
}
