CREATE jenx.txt \ Leo Wong 30 March 02003 fyj + \ -cbuff -tbuff IN @ - >R PARSE DUP R> = ROT ROT ; macro NEXTLINE " WHILE REFILL 0= IF EXIT THEN REPEAT " \ INCLUDEing an xml file will execute this word : till tBuff $+! nextline doTag BEGIN [CHAR] < till cBuff $+! nextline doContent AGAIN ; : get-element-name ( -- ) skip-white 2DUP scan-white NIP - ; \ Execute if tag is defined. : Xtag ( -- ) tBuff @+ get-element-name get-current search-wordlist IF EXECUTE THEN ; : scan-quote ( ca u -- ca' u' ) BEGIN DUP WHILE OVER C@ DUP [CHAR] ' <> SWAP [CHAR] " <> AND WHILE 1 /STRING REPEAT THEN ; : AttValue ( -- ) 2>R skip-white scan-white 2R> SEARCH IF scan-quote OVER C@ >R 1 /STRING skip-white 2DUP R> scan 1 /STRING NIP 1+ - -trailing-white ELSE DROP 0 THEN ; ' xTag IS doTag ' noop IS doContent \ Make a new wordlist the compilation wordlist and 1st in search order : JenX ( -- ) WORDLIST DUP SET-CURRENT >R GET-ORDER R> SWAP 1+ SET-ORDER ; JenX