Logical Cross-References for TeX4ht

<..non-html TeX4ht divs..>+
 \def\TagCh#1{\Tag{#1<.Ch tag.>}{\theChapterCounter}}
 \def\RefCh#1{Chapter\ \Ref{#1<.Ch tag.>}}
 \def\TagApp#1{\Tag{#1<.Ap tag.>}{\theChapterCounter}}
 \def\RefApp#1{Appendix\ \Ref{#1<.Ap tag.>}}
 \def\TagSec#1{\Tag{#1<.Sec tag.>}{\theSectionCounter}}
 \def\RefSec#1{Section\ \Ref{#1<.Sec tag.>}}
 -_-_-

<..html TeX4ht divs..>+
 \def\TagCh#1{\Tag{#1<.Ch tag.>}{\theChapterCounter}\Tag
                                                {#1<.hCh tag.>}{\:curch}}
 \def\RefCh#1{\Link{\LikeRef{#1<.hCh tag.>}}{}Chapter\ \Ref
                                                {#1<.Ch tag.>}\EndLink}
 \def\TagApp#1{\Tag{#1<.Ap tag.>}{\theChapterCounter}\Tag
                                                {#1<.hAp tag.>}{\:curch}}
 \def\RefApp#1{\Link{\LikeRef{#1<.hAp tag.>}}{}Appendix\ \Ref
                                                {#1<.Ap tag.>}\EndLink}
 \def\TagSec#1{\Tag{#1<.Sec tag.>}{\theSectionCounter}\Tag
                                                {#1<.hSec tag.>}{\:cursec}}
 \def\RefSec#1{\Link{\LikeRef{#1<.hSec tag.>}}{}Section\ \Ref
                                                {#1<.Sec tag.>}\EndLink}
 -_-_-

<..addr for Tag and Ref of Ch and App..>
 \xdef\:curch{<.section html addr.>}%
 -_-_-

<..html TeX4ht divs..>+
 \def\TagPage#1{%
    \Link{}{page#1}\EndLink\Tag{#1}{}}
 \def\RefPage#1{\Link{page#1}{}\Ref{#1}\EndLink}
 -_-_-

<..non-html TeX4ht divs..>+
 \def\TagPage#1{\Tag{#1}{}}
 \def\RefPage{\Ref}
 -_-_-

<..Ch tag..>
 (C -_-_-

<..Ap tag..>
 (A -_-_-

<..Sec tag..>
 (S -_-_-

<..hAp tag..>
 (a -_-_-

<..hCh tag..>
 (c -_-_-

<..hSec tag..>
 (s -_-_-