Skip to content

Conversation

sandersk
Copy link
Contributor

This pull request overhauls the handling of text nodes and hrefs in <a> elements as follows:

  • I've eliminated the xref-placeholder-overwrite-contents parameter.
  • Moving forward, if an <a> element has data-type="xref" on it, then its text node will be updated. If an <a> element has another data-type (data-type="link") or no data-type, then the text node will not be updated. There is one exception, however. If an <a> element doesn't have data-type="xref" on it, but does not have data-type="link", and does have an empty text node, and does have an href that is not a Web URL, then the stylesheets will go ahead and try to add gentext.
  • If an XREF has a Web URL as its href (e.g., href="http://oreilly.com"). This should never really happen (as data-type="xref" is intended for internal XREFs only), but if it does, the text node will be left untouched.
  • As before, if the XREF href can't be resolved, the gentext will be 3 question marks, and an error will be thrown in the log output.
  • The href attributes on <a> elements (aside from indexterms and footnoterefs, which are handled separately) will always be updated if they are internal cross-references. This ensures the href is accurate when HTMLBook files are consolidated for PDF or consolidated/rechunked for EPUB/Mobi.

Also fixed a bug related to XSLT 1.0 processor compatibility that I inadvertently introduced for XSLT 2.0 compatibility. Stylesheets are not currently forward-compatible with XSLT 2.0, but will be addressing that in a future PR.

Sanders Kleinfeld added 21 commits March 18, 2014 16:38
…ogic around determining whether XREFs get generated.
…s the function-xslt2.xsl template, so further tweaks will be needed to overall XSLT 2.0 processor logic.
sandersk pushed a commit that referenced this pull request Mar 27, 2014
@sandersk sandersk merged commit b1b767a into master Mar 27, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant