;---------------------------------------------------------------------- ; makeskel.xom ;----------------------------------------------------------------------- GLOBAL COUNTER d1 GLOBAL STREAM CurrentFile GLOBAL COUNTER df1 variable INITIAL-SIZE 0 GLOBAL COUNTER df2 variable INITIAL-SIZE 0 GLOBAL STREAM day GLOBAL STREAM month GLOBAL STREAM year GLOBAL SWITCH light process-start submit file #command-line-names set CurrentFile to #command-line-names set year to DATE "=xY" set month to DATE "=M" set day to DATE "=D" output "; this Omnimark script was generated: " || "%g(day)-%g(month)-%g(year)%n; by makeskel.xom%n%n" || "down-translate with xml%n" ; handle comments find "") any)* "-->" ; process empty elements find "<" white-space* "!" white-space* ul "element" white-space* ul (letter ((lookahead not ul white-space) any)+) => dgn1 white-space+ ul ("E" white-space* "M" white-space* "P" white-space* "T" white-space* "Y") do when df2 has key "%x(dgn1)" increment df2 key "%x(dgn1)" else set new df2 key "%x(dgn1)" to 1 done ;handle elements that have content find "<" white-space* "!" white-space* ul "element" white-space* ul (letter ((lookahead not ul white-space) any)+) => dgn1 white-space+ do when df1 has key "%x(dgn1)" increment df1 key "%x(dgn1)" else set new df1 key "%x(dgn1)" to 1 done find any process-end repeat over df1 do when df1 > 0 local stream narf set narf to key of df1 output "%nelement %g(narf)%n" || " output %"%%c%"%n%n" done again repeat over df2 do when df2 > 0 local stream narf set narf to key of df2 output "%nelement %g(narf)%n" || " output %"%%c%"%n%n" done again output "element %#implied%n suppress%n"