public class ToHtml extends Visitor
The text structure of lablog is imported from d2d_gp.basic
.
One central issue is the difference in content models for the xhtml containers
Element_p
, Element_li
, Element_td
, etc., and the
compositional modifiers Element_em
, Element_span
, etc.
E.g. a visited PCData on the input side will be translated into very different of these
target contexts, and thus wrapped into different
eu.bandm.tools.tdom.runtum.TypedContent
classes.
For this the ToHtml.DeliveryContext
is introduced.
A special problem is the "hierarchy rotation" between "p" on one side and "list" and "table" on the other. In d2d_gp.basic the "p" element is the central means for organizing text (e.g. the attributes "language", "style", "accessRights"), and all other elements containing text (even images) are subordinated. In xhtml its different and not so consistent:
d2d_gp.basic: xhtml: | |---------+--------+ p p list p |--------+-----+ | | PCData list PCData PCData PCDataThe xhtml Tdom defines some abstract classes which make this sorting easier:Element_body Element_p Element_li E_span Element_div Element_td E_em etc. _inline contains.. E_block_content E_p.Content E_li.Content E_span.Content wraps.. E_misc_inline|E_inline E_block_content|E_inline E_misc_inline|_inline which are.. |_a|_phrase |_fonstyle |_em|_kbd |_b|_big|_i|_tt which are.. E_form | E_form_content E_block | E_misc | E_misc_inline|_noscript | _del|_ins|_script E_div|_p|E_table E_heading|E_blocktext _h1|_h2..|hr pre addressElement_misc_inline (del, ins, script, noscript) is not in a full copositional way.
Modifier and Type | Class and Description |
---|---|
protected class |
ToHtml.Alt |
protected class |
ToHtml.DeliverBlockContent |
protected class |
ToHtml.DeliverInline |
protected class |
ToHtml.DeliverToListItem |
protected class |
ToHtml.DeliverToPre |
protected class |
ToHtml.DeliverToTd |
protected class |
ToHtml.DeliveryContext<T> |
Modifier and Type | Field and Description |
---|---|
static String |
CL_authors
Class name for the css style definitions.
|
static String |
CL_costs_N
Class name for the css style definitions.
|
static String |
CL_docmatHeader
Class name for the css style definitions.
|
static String |
CL_issue_header
Class name for the css style definitions.
|
static String |
CL_issue_prefix
Class name for the css style definitions.
|
static String |
CL_issueDate
Class name for the css style definitions.
|
static String |
CL_noteHeader
Class name for the css style definitions.
|
static String |
CL_package_header
Class name for the css style definitions.
|
static String |
CL_prior_N
Class name for the css style definitions.
|
static String |
CL_status_N
Class name for the css style definitions.
|
static String |
CL_survey_tab
Class name for the css style definitions.
|
static String |
CL_survey_tab_ACTIVE
Class name for the css style definitions.
|
static String |
CL_td_nodecor
Class name for the css style definitions.
|
static String |
CL_topHeadline
Class name for the css style definitions.
|
static Element_br |
EL_BR |
static Element_hr |
EL_HR |
protected Map<Element,File> |
elements2file
Input parameter, passed in from the file visitor in
Main ,
which collected the lablog tdom elements. |
static String |
href_bandm_online_docu
Put into the footer.
|
static String |
ISSUE_SEPARATOR
Separator between the names of package and issue.
|
static String |
LINK_DOCMAT
Stub of the name of the anchor where the docmat region of a package begins.
|
protected MessageReceiver<SimpleMessage<XMLDocumentIdentifier>> |
msg |
static String |
path_to_javascript
Value which will be encoded in the generated html to address the stylesheet.
|
static String |
path_to_stylesheet
Value which will be encoded in the generated html to address the stylesheet.
|
validating
Modifier and Type | Method and Description |
---|---|
protected String |
extractAuthors(Element el)
Visit an subtree of the d2d input and extract a list of author names.
|
Element_html |
makeHtml(SortedMap<String,List<Element_issue>> issuesByPackage,
SortedMap<String,List<Element_docmat>> docmatsByPackage,
Map<Element,File> elements2file,
Map<File,MessageStore<SimpleMessage<XMLDocumentIdentifier>>> files2error)
Make the complete html rendering.
|
protected void |
renderDocmat(String packageName,
String issueName,
Element_docmat data)
Make the xhtml rendering of a d2d "docMat" element, which appears independent
from an issue.
|
protected void |
renderIssue(String packageName,
String issueName,
Element_issue data)
Make the xhtml rendering of a d2d "issue" element.
|
protected void |
renderPackage(String packagename,
@Opt List<Element_issue> issues,
@Opt List<Element_docmat> docmats)
Make the xhtml rendering of a package header, i.e.
|
void |
visit(Element_a_emph el)
Construct an xhtml em from a d2d emph.
|
void |
visit(Element_a_link el)
Construct an xhtml link from a d2d link.
|
void |
visit(Element_a_list el)
Construct an xhtml list from a d2d list.
|
void |
visit(Element_a_listitem el)
Can be overridden by the user to define particular semantic operations.
|
void |
visit(Element_a_nl el)
Construct an xhtml br from a d2d nl.
|
void |
visit(Element_a_p el)
Construct an xhtml p from a d2d p.
|
void |
visit(Element_a_src el)
Construct an xhtml tt from a d2d scr.
|
void |
visit(Element_a_SRC el)
Construct an xhtml PRE from a d2d SRC.
|
void |
visit(Element_a_table el)
Construct an xhtml table from a d2d table.
|
void |
visit(Element_a_td el)
Construct an xhtml td from a d2d td.
|
void |
visit(Element_a_tr el)
Construct an xhtml tr from a d2d tr.
|
void |
visit(Element_desc el)
Make the xhtml rendering of a d2d "desc" element, which occurs is the main sub-element
of an issue.
|
void |
visit(Element_note el)
Make the xhtml rendering of a note = a text aappended to an Issue.
|
void |
visit(TypedPCData data) |
visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit
visit
public static final String path_to_stylesheet
public static final String path_to_javascript
public static final String ISSUE_SEPARATOR
public static final String href_bandm_online_docu
public static final String LINK_DOCMAT
public static final String CL_topHeadline
public static final String CL_survey_tab
public static final String CL_survey_tab_ACTIVE
public static final String CL_package_header
public static final String CL_issue_header
public static final String CL_issue_prefix
public static final String CL_td_nodecor
public static final String CL_prior_N
public static final String CL_costs_N
public static final String CL_issueDate
public static final String CL_status_N
public static final String CL_authors
public static final String CL_noteHeader
public static final String CL_docmatHeader
public static final Element_br EL_BR
public static final Element_hr EL_HR
protected MessageReceiver<SimpleMessage<XMLDocumentIdentifier>> msg
public void visit(TypedPCData data)
visit
in interface PCDataVisitor
visit
in class Visitor
public void visit(Element_a_list el)
public void visit(Element_a_listitem el)
Visitor
visit(..)
in turn for all PCData and all Elements in its contents.public void visit(Element_a_table el)
public void visit(Element_a_tr el)
public void visit(Element_a_td el)
public void visit(Element_a_p el)
public void visit(Element_a_SRC el)
public void visit(Element_a_nl el)
public void visit(Element_a_src el)
public void visit(Element_a_link el)
public void visit(Element_a_emph el)
protected String extractAuthors(Element el)
public void visit(Element_note el)
public void visit(Element_desc el)
flushP()
it on return, if necessary.
If the "p*" alternative is chosen, this first (empty) paragraph will be
flushed and the explicit/contained paragraph will also be flushed by its
visitor code (thus inP
==false).protected void renderDocmat(String packageName, String issueName, Element_docmat data)
protected void renderIssue(String packageName, String issueName, Element_issue data)
protected void renderPackage(String packagename, @Opt @Opt List<Element_issue> issues, @Opt @Opt List<Element_docmat> docmats)
public Element_html makeHtml(SortedMap<String,List<Element_issue>> issuesByPackage, SortedMap<String,List<Element_docmat>> docmatsByPackage, Map<Element,File> elements2file, Map<File,MessageStore<SimpleMessage<XMLDocumentIdentifier>>> files2error)
see also the complete user documentation .