;-----------------------------------------------------------------------------
; sgml2html.xom
;-----------------------------------------------------------------------------
; (c) Copyright 1996 Novell, Inc.
; All rights reserved.
;
; This program is an unpublished copyrighted work which is proprietary
; to Novell, Inc. and contains confidential information that is not to
; be reproduced or disclosed to any other person or entity without
; prior written consent from Novell, Inc. in each and every instance.
;
; No part of this file may be duplicated, revised, translated,
; localized or modified in any manner or compiled, linked or uploaded
; or downloaded to or from any computer system without prior written
; consent of Novell, Inc.
;
; WARNING: Unauthorized reproduction of this program as well as
; unauthorized preparation of derivative works based upon the program
; or distribution of copies by sale, rental, lease or lending are
; violations of federal copyright laws and state trade secret laws,
; punishable by civil and criminal penalties.
;-----------------------------------------------------------------------------
down-translate
;*** macros
macro passthru is output "%c" macro-end
macro childof is when parent is macro-end
macro grandchildof is parent of parent is macro-end
macro chtitle is
output "
%g(NUMBUF) %c
%n"
macro-end
macro title1 is
output "%c
%n"
macro-end
macro title2 is
output "%c
%n"
macro-end
macro title3 is
output "%c
%n"
macro-end
macro title4 is
output "%c
%n"
macro-end
macro title5 is
output "%c
%n"
macro-end
macro tagB is
output "%c%n"
macro-end
macro refname is
output "%g(NAMEWD)-"
tagB
macro-end
macro graf is
output "
%c%n"
macro-end
;no way to distinguish igraf in html
macro igraf is
output "
%c%n"
macro-end
macro lowtitle is
output "
%c"
macro-end
macro address is
output "
%c%n"
macro-end
macro b is
output "%c%n"
macro-end
macro blockquote is
output "%c
%n"
macro-end
macro br is
output "
%c%n"
macro-end
macro cite is
output "%c%n"
macro-end
macro code is
output "%c
%n"
macro-end
macro dd is
output "%c%n"
macro-end
macro dir is
output "%c%n"
macro-end
macro dl is
output "%c
%n"
macro-end
macro dt is
output "%c%n"
macro-end
macro em is
output "%c"
macro-end
macro h1 is
output "%c
%n"
macro-end
macro h2 is
output "%c
%n"
macro-end
macro h3 is
output "%c
%n"
macro-end
macro h4 is
output "%c
%n"
macro-end
macro h5 is
output "%c
%n"
macro-end
macro h6 is
output "%c
%n"
macro-end
macro hr is
output "
%c%n"
macro-end
macro i is
output "%c%n"
macro-end
macro kbd is
output "%c%n"
macro-end
macro li is
output "%c%n"
macro-end
macro menu is
output "%n"
macro-end
macro ol is
output "%c
%n"
macro-end
macro p is
output "%c%n"
macro-end
macro pre is
output "
%c
%n"
macro-end
macro samp is
output "%c%n"
macro-end
macro strong is
output "%c"
macro-end
macro tt is
output "%c"
macro-end
macro ul is
output ""
macro-end
macro var is
output "%c"
macro-end
macro computertype is
output "%c"
macro-end
macro italcomputertype is
output "%c"
macro-end
macro codetype is
output "%c"
macro-end
macro boldcodetype is
output "%c"
macro-end
macro italpara is
output "%c%n"
macro-end
macro ital is
output "%c"
macro-end
macro boldpara is
output "
%c%n"
macro-end
macro bolditalpara is
output "
%c%n"
macro-end
macro sub is
output "%c%n"
macro-end
macro sup is
output "%c%n"
macro-end
macro vpad is
output "
%c
%n"
macro-end
macro alltable is
output "
"
macro-end
macro emph is output "%c" macro-end
macro tblrow is
output "%n
%c"
macro-end
macro cverbatim is ;can't do justification=verbatim
output "%c
"
macro-end
macro gpnchap is
do when counter CHAPNUM is greater-than 1
reset COUNTA to counter CHAPNUM
decrement COUNTA by 1
put CHAPCONTENT ''
done
do when counter CHAPNUM is less-than counter CHAPCT
reset COUNTA to counter CHAPNUM
increment COUNTA by 1
put CHAPCONTENT '%n'
done
macro-end
macro gpnsect is
do when counter SECT1NUM is greater-than 1
reset COUNTA to counter SECT1NUM
decrement COUNTA by 1
put SECTCONTENT '%n'
done
do when counter SECT1NUM is less-than counter SECTCT ;when not the last
reset COUNTA to counter SECT1NUM
increment COUNTA by 1
put SECTCONTENT '%n'
done
macro-end
macro gpnappx is
do when counter APPXNUM is greater-than 1
reset COUNTA to counter APPXNUM
decrement COUNTA by 1
put CHAPCONTENT ''
done
do when counter APPXNUM is less-than counter APPXCT
reset COUNTA to counter APPXNUM
increment COUNTA by 1
put CHAPCONTENT '%n'
done
macro-end
macro gpnpref is
do when counter PREFNUM is greater-than 1
reset COUNTA to counter PREFNUM
decrement COUNTA by 1
put CHAPCONTENT ''
done
do when counter PREFNUM is less-than counter PREFCT
reset COUNTA to counter PREFNUM
increment COUNTA by 1
put CHAPCONTENT '%n'
done
macro-end
macro gpnappxsect is
do when counter SECT1NUM is greater-than 1
reset COUNTA to counter SECT1NUM
decrement COUNTA by 1
put SECTCONTENT '%n'
done
do when counter SECT1NUM is less-than counter SECTCT ;when not the last
reset COUNTA to counter SECT1NUM
increment COUNTA by 1
put SECTCONTENT '%n'
done
macro-end
macro gpnprefacesect is
do when counter SECT1NUM is greater-than 1
reset COUNTA to counter SECT1NUM
decrement COUNTA by 1
put SECTCONTENT '%n'
done
do when counter SECT1NUM is less-than counter SECTCT ;when not the last
reset COUNTA to counter SECT1NUM
increment COUNTA by 1
put SECTCONTENT '%n'
done
macro-end
macro emittoc is
reopen TOC as "./%g(BKNAME)/toc.htm"
put TOC '%g(TOCTEMP1)'
put TOC '%g(TOCTEMP3)'
close TOC
macro-end
macro emittoc1 is
reopen TOC as "./%g(BKNAME)/toc.htm"
put TOC '%n%g(IMGSMMANUAL)'
put TOC '%g(TOCTEMP3)'
close TOC
macro-end
macro emittocchap is
open TOCSECT1 as "./%g(BKNAME)/tocch%d(CHAPNUM).htm"
put TOCSECT1 file "./%g(BKNAME)/toc.htm"
put TOCSECT1 '%g(TOCTEMP2)'
put TOCSECT1 '%g(TOCTEMP3)'
put TOCSECT1 "%n%n"
close TOCSECT1
macro-end
macro emittocpref is
open TOCPREFACE as "./%g(BKNAME)/tocpref%d(PREFNUM).htm"
put TOCPREFACE file "./%g(BKNAME)/toc.htm"
put TOCPREFACE '%g(TOCTEMP2)'
put TOCPREFACE '%g(TOCTEMP3)'
put TOCPREFACE "%n%n"
macro-end
macro emittocappx is
open TOCAPPX as "./%g(BKNAME)/tocappx%d(APPXNUM).htm"
put TOCAPPX file "./%g(BKNAME)/toc.htm"
put TOCAPPX '%g(TOCTEMP2)'
put TOCAPPX '%g(TOCTEMP3)'
put TOCAPPX "%n%n"
macro-end
macro emitxmark is
output "%g(XMARKK)"
macro-end
macro emptyxmark is
set buffer XMARKK to ""
macro-end
macro hidden is
suppress
macro-end
;*** globals
global stream BKNAME ;passed in by start script
global stream COLL ;passed in by start script
global counter PARTNUM ;part # counter
global counter CHAPNUM ;chapter # counter
global counter APPXNUM ;appendix # counter
global counter PREFNUM ;preface # counter
global stream NUMBUF ;temp # buffer
global counter PSTEP ;step # in PROCEDURE
global counter PSSSTEP ;step # in SUBSTEP in STEP in PROCEDURE
global stream CTITLE ;content of TITLE in MSGEXPLAN
global counter INTERFACENUM ;interface #
global counter LSTNUM ;list #
global stream DOCTYPE
global stream CHAPBUF
global stream TEMP
global counter SECT1NUM
global counter SECT2NUM
global counter COUNTA
global stream TOP
global counter CHSECNUM ;number of sections of current chapter
global counter FIRSTSECT
global stream TOCTEMP1
global stream TOCTEMP2
global stream TOCTEMP3
global stream GLYTEMP
global stream REFID
global stream IMGFOLDERPL
global stream IMGFOLDERMN
global stream IMGSMMANUAL
global counter SECTCT
global stream XMARKK
global counter PREFCT
global counter CHAPCT
global counter APPXCT
;*** output files
global stream STARTCOLL
global stream STARTFRM
global stream CHAPCONTENT
global stream SECTCONTENT
global stream TOC
global stream TOCPREFACE
global stream TOCAPPX
global stream CURCHAPTOC
global stream TOCSECT1
global stream TOCREST
global stream GLRY
global stream NAMEWD
global stream IMPWD
global stream NOTEWD
global stream TIPWD
global stream WARNWD
global stream CTNWD
global stream SEEWD
global stream ALSOWD
global stream LOCWD
global stream REMWD
global stream CLASSWD
global stream GG
;*** Term information
element BOOK
set buffer NAMEWD to "NAME"
set buffer IMPWD to "IMPORTANT: "
set buffer NOTEWD to "NOTE: "
set buffer TIPWD to "SUGGESTION: "
set buffer WARNWD to "WARNING: "
set buffer CTNWD to "CAUTION: "
set buffer SEEWD to "See "
set buffer ALSOWD to "See Also "
set buffer LOCWD to "Local Server : "
set buffer REMWD to "Remote Server : "
set buffer CLASSWD to "Classification: "
set buffer IMGFOLDERPL to ''
set buffer IMGFOLDERMN to ''
set buffer IMGSMMANUAL to ''
reset PARTNUM to 0
reset CHAPNUM to 0
reset APPXNUM to 0
reset PREFNUM to 0
set buffer NUMBUF to ""
set buffer CURCHAPTOC to ""
set buffer DOCTYPE to '%n'
open TOC as "./%g(BKNAME)/toc.htm"
open STARTFRM as "./%g(BKNAME)/start.htm"
put (TOC and STARTFRM) "%g(DOCTYPE)"
put STARTFRM "%n"
put STARTFRM '%n"
put STARTFRM "%n"
close STARTFRM
put TOC '%n%n'
put TOC '%n'
; put TOC '%n- %g(IMGSMMANUAL) Disclaimer
%n'
close TOC
output '%g(DOCTYPE)'
output '%n%n'
output "%c%n"
output "%n%n%n"
reopen TOC as "./%g(BKNAME)/toc.htm"
put TOC "
%n%n%n"
close TOC
do when file "./%g(BKNAME)/tocpref.htm" exists
reset COUNTA to 1
repeat
exit when counter COUNTA is greater-than counter PREFNUM
reopen TOCPREFACE as "./%g(BKNAME)/tocpref%d(COUNTA).htm"
put TOCPREFACE "