)load 1 xml DUMPED 2020-02-03 12:50:43 (GMT-5) DUMPED 2020-02-25 17:48:42 (GMT-5) DUMPED 2020-12-31 10:59:46 (GMT-5) 'utl∆split' ⎕stop 2 utl∆crWithLineNo 'xml∆parseStylesheet' ∇lex←xml∆parseStylesheet txts;a;lb;i [001] ⍝ Function to parse a cascading stylesheet and return a nested lexicon [002] txts←utl∆clean txts [003] lex←lex∆init [004] →(0=⍴⍴a←'{' utl∆split ¨ ¯1↓ '}' utl∆split txts)/0 [005] lb←((⍴a)⍴st),0 [006] i←1 [007] st: [008] lex←lex lex∆assign (⊂utl∆clean ⊃(⊃a[i])[1]),⊂xml∆parseRule ⊃(⊃a[i])[2] [009] →lb[i←i+1] utl∆crWithLineNo 'utl∆split' ∇v←delim utl∆split string;b [001] ⍝ Split a string at delim. No recursive algorithm [002] b←(string∊delim)/⍳⍴string←,string [003] b←(0,b),[1.1]-/(b,1+⍴string),[1.1] 1,b+1 [004] v←,(⊂string) utl∆sph ¨ ⊂[2]b t1←xml∆parseStylesheet 'body { background-color: blue; }' utl∆split[2] ⍝ First call to utl∆split string body { background-color: blue; } ≡string 1 →⎕lc utl∆split[2] ⍝ Second call to utl∆split string body { background-color: blue; ≡string 2 →⎕lc t1