Open xatapult opened 3 years ago
<dir>
can be mapped to Unicode's directional override characters, so <title>
is effectively text with syntactic sugar for directionality overrides (except that the syntactic sugar allows foreign elements).
A HTML <title>
can also contain only text.
I'm not advocating either way, but an argument for a simple <title>
is that a styled title might lose meaning or be confusing if it ends up somewhere where only text is allowed, such as the banner of a window or the metadata of a PDF report.
an argument for a simple
is that a styled title might lose meaning or be confusing if it ends up somewhere where only text is allowed, such as the banner of a window or the metadata of a PDF report.
True. However, other text standards, such as DocBook, simply allow mixed text, with all its markup elements, everywhere where text can be, so also in <title>
elements. I think this consistency is preferable above deciding upfront what content developers should or should not do.
Are titles different from paragraphs and divs? Definitely yes!
We should consider the Gherkin BDD language, which is used to generate stubs for the popular Cucumber BDD Unit Test runner (for Ruby, JavaScript, Java, etc). It is VERY commonly used and highly regarded. It is entirely based on automatically converting titles into programming language identifiers (e.g. function names).
Gherkin's design has evolved to have many of the same language features as Schematron: a separation between expression of scenario in native language and implementation in code (e.g. as sch:assert/@test does), relatively flat simple structure (Feature/Rule/Scenario/Step is akin to schema/pattern/rule/assert), variables, macros, a way to avoid context recomputation (in Schematron this is the sch:rule chain, in Gherkin it is the Background feature), and so on.
And guess what?, those top three levels (Feature, Rule, Scenario) all require a title (which they munge into a name token by substituting " " with "_" for example) and allow free-text comments as paragraphs after the title, to explain things. (And which are distinct from stripped #comments that are ephemeral.) Just like Scematron.
So we can imagine an application that takes a Schematron schema and transforms it into, say, idomatic JUnit Unit Tests for Java: and uses the (munged) titles as function names for literate code (or ids otherwise). It would be good if this were just a matter of taking the simple value of the sch:title/sch:p.
But if the foreign element had text, is is supposed to be displayed as part of the title or not? For example
The (not often used)
<title>
and<p>
Schematron elements have different models for no apparent reason.<p>
element follows the usual rules for mixed text in Schematron. It allows foreign attributes/elements and<dir>
,<span>
and<emph>
<title>
element only allows<dir>
and does not allow foreign attributes/elements.I suggest we align both definitions and allow the same kinds of mixed contents in both of them. Best probably to define
<title>
the same as<p>
.