# Schema validation scope The XSD checks XML elements, attributes, and nesting. When converting to Wiki JSON, `@eihrteam/xml` also checks rules that depend on the chapter mode, element placement, or field contents. After editing an entry, validate its structure against the XSD and run the converter to check whether it can produce Wiki JSON. ## Additional rules the converter checks The root element's children can appear in any order, and `` can appear more than once. The XSD declares the structure of each child, and the converter checks that ``, ``, and `` are present. The converter also checks the following rules. - A chapter with `table="true"` must contain a direct `` child. A chapter with `audio="true"` uses a direct `` child or audio tabs, each of which must contain exactly one `` element. A chapter with `dialog="true"` must contain at least one dialog entry and cannot enable another mode. - The first message in a dialog branch must have `side="me"` and the last must have `side="other"`. The first message cannot contain an `` element. - For complex tables, the converter checks header positions, cell coordinates, row and column spans, grid coverage, and column widths. If `widths` is omitted, the converter calculates default column widths from the supported chapter size and the number of logical columns. - If an image's `` or `` is omitted, the converter tries to infer the missing fields from the file name in ``. - The `` element can be empty. If it has content, that content must be a JSON object. ## Structures the converter accepts In some positions, the converter ignores unrecognized empty elements, such as `` in the body. If `` appears more than once in ``, the converter reads the first one. The XSD reports both structures as errors. When editing an entry, remove unknown elements and keep one element for each field that takes a single value. ## Examples Save each example separately as `item.xml` and validate it with the command on the [XSD Schema page](../). Then run v1.0.0 of the converter to compare the results. ```sh npx --yes --package=@eihrteam/xml@1.0.0 xml convert --from xml --to json --input item.xml ``` ### Missing a required entry ID This entry has metadata and a description, but omits ``. ```xml invalid Sample entry ``` The entry passes XSD validation. The converter reports that `` is missing. Add the actual entry ID as a child of the root element and run the conversion command again. ### Unknown empty element in the description The `` element in this entry contains an empty element that the converter ignores. ```xml xsd-invalid 1 Sample entry Sample text ``` The XSD reports `` as a disallowed child element. The converter ignores the element and keeps the description text. Remove `` to pass both checks. ## See also - [XSD Schema](../) - [Online playground](../../guides/playground/)