diff --git a/README.md b/README.md index 408d19e..79e7b70 100644 --- a/README.md +++ b/README.md @@ -56,7 +56,7 @@ If you use DocLang in academic or technical work, please cite the specification: ## Development -To work on this repository — setup, tests, reference generation, releases — see [CONTRIBUTING.md](https://github.com/doclang-project/doclang/blob/main/doclang/CONTRIBUTING.md). +To work on this repository — setup, tests, reference generation, releases — see [CONTRIBUTING.md](https://github.com/doclang-project/doclang/blob/main/CONTRIBUTING.md). ## We ❤️ Open Source AI diff --git a/doclang/doclang.sch b/doclang/doclang.sch index 48ee982..13df3d5 100644 --- a/doclang/doclang.sch +++ b/doclang/doclang.sch @@ -332,19 +332,23 @@ - + - - Picture with class="undefined" (or no class) must not contain table in the element body. + + Element tabular is only allowed in picture with class="chart". - - Element table is only allowed as the first element of the body of picture with class="chart". + + Element src must be the first element of the picture body when present. + + + + Element tabular must immediately follow src when src is present, otherwise it may be the first body element. diff --git a/doclang/doclang.xsd b/doclang/doclang.xsd index 98ca2f7..ffa4efb 100644 --- a/doclang/doclang.xsd +++ b/doclang/doclang.xsd @@ -247,26 +247,27 @@ - + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + @@ -562,6 +563,18 @@ + + + + + + + + + + + + diff --git a/examples/form/form-examples.md b/examples/form/form-examples.md index 81f2196..af7a1c3 100644 --- a/examples/form/form-examples.md +++ b/examples/form/form-examples.md @@ -1,25 +1,27 @@ # Form Examples +These examples illustrate the [Fields](../../spec.md#fields) section of the DocLang specification, using `field_region`, `field_item`, and `field_heading` elements. + ## Simple key-values ![form-00](./form_00.png) ```xml -
- + + Firma: Holcim ... GmbH - - - Werk: - Scholkholz - - ... - + + + Datum: + 23.08.2019 + + + Petrograph. Typ: Quartiarer Sand + Kies - -
+ + ``` ## Nesting forms and using form headings @@ -27,34 +29,43 @@ ![form-01](./form_01.png) ```xml -
- - 14.Transport Information - - - Land transport ... (Germany) - + + + 14. + Transport Information + + + + Land transport ... (Germany) + + GGVS/GGVE class: 8 - - + + ADR/RID class: 8 - - ... -
- + + + + River transport ADN/ADNR not examined - -
- Sea transport IMDG - ... -
- ... - The transport ... considered. - THESE TRANSPORT ... PACK! - + + + + Sea transport IMDG + + + + + + The transport ... considered. + + + THESE TRANSPORT ... PACK! + + ``` ## Fillable form @@ -62,119 +73,123 @@ ![form-02](./form_02.png) ```xml -
- + + Description A.A. Cat - - + + Quant. - - + + Un - - + + Measure - - + + Price (in currency) - - + + Un - - + + Total - + - - + + Delivery Cost - - + + Maintenance - - ... - - - + + + + + Date and time of delivery: - - ... - + + + Guarantee - - Delivery Supplies ... Finance Department -
- ... - + + + Delivery Suppl...Finance Department + + + + ``` -## Example 3 +## Use of form headings ![form-03](./form_03.png) ```xml -
- Information about you - - *Family Name (Last Name) + + Information about you + + + *Family Name (Last Name) + staar - - + + *Given Name (First Name) peter - - + + *Middle Name (if applicable) WJ - - + + I am in the United States as a: - Visitor - Student - Permanent Resident - Other (Specify) + Visitor + Student + Permanent Resident + Other (Specify) - - + + Country of Citizenship - - + + *Date of Birth - - + + Alien Registration Number (A-Number) (if any) - - - Information About Your Address + A- + + Information About Your Address *Present Physical Address ()No Po Boxes - + *Street ... Name - - + + Apt. - - - + + + Ste. - - - ... + + + - + ``` ## High density form @@ -182,69 +197,68 @@ ![form-07](./form_07.png) ```xml -SEZIONE II A - REDDITI SOGGETTI A IMPOSTA SOSTITUTIVA -
- M31 - REDDITI DI CAPITALE SOGGETTI AD IMPOSIZIONE SOSTITUTIVA - - 1 + + M31 + REDDITI DI CAPITALE SOGGETTI AD IMPOSIZIONE SOSTITUTIVA + + 1 Tipo - - + + 2 Codice Stato estero - - + + 3 Ammontare reddito - - - + ,00 + + 4 Aliquota % - - + + 5 Credito IVCA - - - + ,00 + + 6 Proventi particolari - - + + 7 Opzione tassazione ordinaria - + - M32 - PROVENTI DELLE OBBLIGAZIONI NON ASSOGGETTATI A IMPOSTA SOSTITUTIVA - + M32 + PROVENTI DELLE OBBLIGAZIONI NON ASSOGGETTATI A IMPOSTA SOSTITUTIVA + 1 Ammontare reddito - - - + ,00 + + 2 Aliquota % - + - M33 - PROVENTI DERIVANTI DA DEPOSITI IN GARANZIA - + M33 + PROVENTI DERIVANTI DA DEPOSITI IN GARANZIA + 1 Ammontare reddito - - - ... + ,00 + + -
+ ``` ## Values without Keys @@ -252,272 +266,273 @@ ![form-08](./form_08.png) ```xml -QUADRO W - Investimenti e attività estere di natura finanziaria o patrimoniale -SEZIONE I - DATI RELATIVI AGLI INVESTIMENTI E ALLE ATTIVITA' -
- W1 - +QUADRO W - Investimenti e... +SEZIONE I - DATI RELATIVI... + + W1 + 1 CODICE TITOLO POSSESSO - - + + 2 TIPO CONTRIBUENTE - IVAFE - - ... + + - W2 - + W2 + 1 - - + + 2 - - + + 3 - - ... + + -
+ ``` -## See lower section of a form with fillable fields, markers, hints. +## Another complex form deconstructed into field items ![form-09](./form_09.png) + ```xml -QUADRO C - Redditi di lavoro dipendente e assimilati +QUADRO C - Redditi di lavoro... -
- SEZIONE I - REDDITI DI LAVORO DIPENDENTE E ASSIMILATI - + + SEZIONE I - RE... + Casi particolari - + + + Codice Stato estero - + - C1 - + C1 + 1 TIPO - - + + 2 INDETERMINATO/DETERMINATO - - - + + + 3 REDDITO (punti 1,2,3 CU 2025) ,00 - - + + 4 ALTRI DATI - - + + - C2 - + C2 + 1 TIPO - - + + 2 INDETERMINATO/DETERMINATO - - - + + + 3 REDDITO (punti 1,2,3 CU 2025) ,00 - - + + 4 ALTRI DATI - - + + - C3 - + C3 + 1 TIPO - - + + 2 INDETERMINATO/DETERMINATO - - - + + + 3 REDDITO (punti 1,2,3 CU 2025) ,00 - - + + 4 ALTRI DATI - - + + - - C4 - SOMME PER PREMI DI RISULTATO E WELFARE AZIENDALE - + C4 + SOMME PER PREMI... + + 1 TIPOLOGIA LIMITE - - - + + + 2 SOMME A TASSAZIONE ORDINARIA ,00 - - + + 3 SOMME A IMPOSTA SOSTITUTIVA ,00 - - ... + + - + ``` ## Middle section of a form with A and B choices ![form-19](./form_19_water_damage.png) + ```xml -... -
- COCHER LES CASES CONCERNEES - + + + COCHER LES CASES CONCERNEES + La cause du sinistre se situe-t-elle chez vous ? - Aoui - Anon - Boui - Bnon - - + Aoui + Anon + Boui + Bnon + + Êtes-vous assuré en dégâts des eaux ? - Aoui - Anon - Boui - Bnon - - + Aoui + Anon + Boui + Bnon + + Si vous êtes occupant et que vous allez déménager avez-vous donné ou reçu congé ? - Aavant le sinistre - Aaprès le sinistre - Bavant le sinistre - Baprès le sinistre - - NATURE DES DOMMAGES peinture et/ou papier peint - + Aavant le sinistre + Aaprès le sinistre + Bavant le sinistre + Baprès le sinistre + + NATURE DES DOMMAGES peinture et/ou papier peint + revêtements (sol, mur, plafond) - Acollés - Aagrafés ou cloués - Bcollés - Bagrafés ou cloués - - + Acollés + Aagrafés ou cloués + Bcollés + Bagrafés ou cloués + + Ces aménagements ont-ils été exécutés à vos frais ? - Aoui - Anon - Boui - Bnon - - + Aoui + Anon + Boui + Bnon + + Autres dommages immobiliers (carrelage, parquet, plâtrerie...) - A - B - - + A + B + + Objets mobiliers - A - B - - + A + B + + Matériels ou marchandises - A - B - - + A + B + + Autres dommages A(à préciser) B(à préciser) - -
-... + + + ``` ## Tabular form with strong 2D value relationship ![form-17](./form_17_tabular_form_with_many_elements.png) -Tabular part of the form: -```xml - -Beiträge zur Altersvorsorge52 - Steue...Ehemann / Person AEhefrau / Person B -Arbeitnehmeranteil laut ...***FORM1***,- ***FORM2***,- @ -Beiträge zur landwirtsc ...***FORM3***,- ***FORM4***,- -Beiträge zu gesetzliche ...***FORM5***,- ***FORM6***,- -Erstattete Beiträge und ...***FORM7***,- ***FORM8***,- @ -... - -... - -FORMS: -***FORM1***: 300EUR -***FORM2***: 400EUR -***FORM4***: 401 -***FORM5***: 302 -***FORM3***: 301 -***FORM6***: 402 -***FORM7***: 309 -***FORM8***: 409 +```xml + + + Beiträge zur Altersvorsorge 52 + Steuerpflichtige Person / Ehemann / Person A Ehefrau / Person B + Arbeitnehmeranteil laut Nr. 23 a / b der Lohnsteuerbescheinigung *FORM1*,- *FORM2*,- e + Beiträge zur landwirtschaftlichen Alterskasse; zu berufsständ... *FORM3*,- *FORM4*,- + Beiträge zu gesetzlichen Rentenversicherungen... *FORM5*,- *FORM6*,- + Erstattete Beiträge und / oder steuerfreie Zuschüsse zu den... *FORM7*,- *FORM8*,- e + +
+
+ ``` +*FORMS referred above: +*FORM1*: 300EUR +*FORM2*: 400EUR +*FORM4*: 401 +*FORM5*: 302 +*FORM3*: 301 +*FORM6*: 402 +*FORM7*: 309 +*FORM8*: 409 + ## Mix table and form elements ![form-15](./form_15_large_key.png) ```xml -... + Part III Figure Your Credit - 10 - - -If you checked (in Part l):Enter -Box 1, 2, 4, or 7$5,000 -Box 3, 5, or 6$7,500 -Box 8 or 9$3,750 - - -10 - + + If you checked (in Part l):Enter + Box 1, 2, 4, or 7$5,000 + Box 3, 5, or 6$7,500 + Box 8 or 9$3,750 +
+10 11 If you checked (in Part I): - Box 6, add $5,000 to the taxable disability income of the spouse who was under age 65. Enter the total. - Box 2, 4, or 9, enter your taxable disability income. - BBox 5, add your taxable disability income to your spouse's taxable disability income. Enter the total. + + Box 6, add $5,000 to the taxable... + + Box 2, 4, or 9, enter your taxable... + + BBox 5, add your taxable disabilit... - -11. - +11. -For more details on what to include on line 11, see Figure Your Credit in the instructions. - -12 If you completed line 11, enter the smaller of line 10 or line 11. All others, enter the amount from line 10 -1274,992 -... +For more details on what to include on line 11... +12 If you completed line 11, enter the smaller... +1274,992 + ``` diff --git a/exports/doclang-styled.docx b/exports/doclang-styled.docx index 496f67b..5951e87 100644 Binary files a/exports/doclang-styled.docx and b/exports/doclang-styled.docx differ diff --git a/exports/doclang.docx b/exports/doclang.docx index d2fabd8..0a243a5 100644 Binary files a/exports/doclang.docx and b/exports/doclang.docx differ diff --git a/reference/input/reference.xlsx b/reference/input/reference.xlsx index 437f187..427c646 100644 Binary files a/reference/input/reference.xlsx and b/reference/input/reference.xlsx differ diff --git a/spec.md b/spec.md index 710b8df..3331746 100644 --- a/spec.md +++ b/spec.md @@ -106,6 +106,8 @@ Adopted from XML: - **attribute**: An XML attribute. - **tag**: An XML tag: can be a start-tag, an end-tag, or an empty-element tag (a.k.a. self-closing tag). +When referring to an attribute in prose, this specification uses XPath-style notation: `element@attribute` (e.g. `label@value`, `location@resolution`). + Adopted from HTML: - **block-level element**: An element that is meant to be interpreted or displayed as a block, i.e. starting on a new line, occupying the full width of its container, and typically with increased margin to any other neighboring block-level elements; a typical HTML example is the `p` element (paragraph). @@ -135,7 +137,7 @@ As DocLang is XML, standard XML encoding rules apply — for example: - any provided XML prolog defines the encoding, otherwise UTF-8 is assumed - special characters reserved by XML, such as `<`, can be represented either by escaping with the respective XML entities (e.g. `<` becomes `<`) or by using CDATA section syntax (e.g. raw text `` can be represented as `]]>`.) -DocLang generally allows applications to decide how to handle XML whitespace (i.e implicit `xml:space="default"` behavior). To address cases where preservation is required, DocLang provides a dedicated element for whitespace preservation (i.e. `xml:space="preserve"` behavior). +DocLang generally allows applications to decide how to handle XML whitespace (i.e implicit `xml:space="default"` behavior). To address cases where preservation is required, DocLang provides [``](#content) for whitespace preservation (i.e. `xml:space="preserve"` behavior). ### Head and Body Areas @@ -209,7 +211,7 @@ In the example further below: ``` @@ -318,17 +320,17 @@ Picture by base64-encoded data: ``` -Bar chart using [recommended label](#appendix-b-recommendations) and [``](#table) for capturing chart data in OTSL format: +Bar chart using [recommended label](#appendix-b-recommendations) and [``](#tabular) for capturing structured chart data: ```xml
+ + CategoryValue A10 B20 -
- + ``` @@ -364,24 +366,21 @@ Code block with language classification and whitespace preservation: Grouped code with caption and coordinates: ```xml - + + + { + res.end('OK'); + }); + server.listen(3000);]]> + ``` Long code blocks can be split across pages using continuation elements; keep `