title: Referencing Kaitai Struct file (ksy) in external ksy file in Kaitai Struct
body: <p>I am trying to achieve files structuring in Kaitai Struct, means that I need to create ksy file can be referenced by another ksy file, so when i compile to my target language (java in my case) the java code will be optimized and reusing the commonly created ksy files and not redundant the generated java code.</p>
  
  <p>I have tried to mimic "Referencing enums in external file in Kaitai Struct" but it did not work.</p>
  
  <p>I started to look at "imports", which means importing a ksy file in an extrenal ksy file, i will explain broadly what i have tried to do and achieve:</p>
  
  <ol>
  <li>I created a ksy for data_types (customized data types ), it does not reference anything, just meta section with id and then types and i started to list all my customized data types (datatypeone, datatypetwo...)</li>
  <li>I created a ksy for machine types, each type does have "seq" of fields each field refer to one of the above mentioned data types, the challenge here is in the machineType.ksy , i add dataType.ksy as imports , I am not quite sure what is the syntax to do that, Kaitai struct compiler in Webide keeps telling me customized data types not defined e.g. datatypeone is not defined.</li>
  </ol>
  
  <p>Is there any restrictions on the number of files to be referenced, e.g. i can reference file a from file b and reference file b from file c and reference file c from file d, means file d has "imports of c" and file c have "imports of b " and so forth.</p>