I added match patterns at http://ditax.ml/hd/ to cover Carlos's
additional custom tags. His new example pasted there will now
produce a conventional task. There is no difference in transform
time because it is just another match pattern, and because his
custom tags follow the HTML5 convention, they are interpreted as
article and section when displayed as HTML--fall-back for HTML5.
If anything, the well-formed approach is faster than validating
and normalizing to get the match targets. This won't matter for
direct display of HTML5, and maybe doesn't matter for normal
ops--it is no more logic heavy than Jarno's MD to throw-away
topics for publishing.
Here's one such template that triggers only on the specialization
markup:
<xsl:template match='section[@data-hd-class =
"task/context"] | section-context'>
<context>
<xsl:apply-templates/>
</context>
</xsl:template>
To make the match patterns fallback-enabled, we need to parse the
two sides around the '-', using the left as the root match (all
'section-' elements match to one fallback rule) and the right part
as the specialized name for extended behaviors, such as 'example'
or 'context' in his example. This would replicate the standard
'contains' substring match. I haven't thought about the most
efficient "substring of name()" pattern yet, but several solutions
seem possible.
As we discussed, the sense of "classing by specialization
hierarchy" is lost when the content is parsed as Well Formed, but
nothing prohibits injecting the class value mapped to its DITA
topic type hierarchy when processing efficiency is less of a
concern (in managed content for example).
--
Don
On 5/10/2016 2:47 PM, Michael Priestley
wrote:
How much freight does
custom tags add to
a displayable HTML page? Is there any impact on performance?
Michael Priestley, Senior Technical Staff Member (STSM)
Enterprise Content Technology Strategist
mpriestl@ca.ibm.com
http://dita.xml.org/blog/michael-priestley
From:
Carlos Evia
<cevia@vt.edu>
To:
dita-lightweight-dita@lists.oasis-open.org
Date:
05/10/2016 02:46 PM
Subject:
[dita-lightweight-dita]
Refactoring HDITA with custom tags
Sent by:
<dita-lightweight-dita@lists.oasis-open.org>
Apologies (in advance) but I won't make it to the
05/16
call. Continuing the conversation about refactoring HDITA, I
wonder how
much mixing of HTML5 custom tags (Don's proposal) and custom
data attributes
(Michael's original approach) we should keep. I have been
experimenting
with Don's approach to extend HTML5's native elements to mimic
XDITA/DITA
tags, and I really think we should explore that as HDITA's
evolution path.
It makes authoring much easier than having to remember the data
attributes.
I compare here both approaches with the
proto-example
included in the Technical Communication paper I wrote with
Michael:
Current HDITA model (based on Michael's 2014 idea)
<article data-hd-class="task">
<h1>How to do something</h1>
<p>Introduction to this specific
task</p>
<section data-hd-class="task/context">
<p>Use only when ready</p>
</section>
<section data-hd-class="task/steps-informal">
<ol>
<li><p>Plan
something</p></li>
<li><p>Do
something</p></li>
<li><p>Evaluate
something</p></li>
</ol>
</section>
<section data-hd-class="topic/example">
<p>Like this</p>
</section>
</article>
My aberrant take on Don's proposed use of custom
tags:
<article-task>
<h1>How to do something</h1>
<p>Introduction to this specific
task</p>
<section-context>
<p>Use only when ready</p>
</section-context>
<section-steps>
<ol>
<li><p>Plan
something</p></li>
<li><p>Do
something</p></li>
<li><p>Evaluate
something</p></li>
</ol>
</section-steps>
<section-example>
<p>Like this</p>
</section-example>
</article-task>
Is there a third way that combines both approaches?
What
would we gain? Right now, moving to custom tags will only break
a) my former
students' projects, and b) Jarno's HDITA plug-in (which was
pretty much
his experimental contribution to our DITA NA presentation this
year).
If this is a good idea, we (I) can work on
re-mapping
HDITA and new examples.... and then we can move on to the
headache of MarkDITA,
MDITA or however we want to call the Markdown flavor of
Lightweight DITA.
Comments?
---
Carlos Evia, Ph.D.
Director of
Professional and
Technical Writing
Associate Professor of
Technical
Communication
Department of English
Center for
Human-Computer Interaction
Virginia Tech
Blacksburg, VA
24061-0112
(540)200-8201
--
"Where is the wisdom we have lost in knowledge?
Where is the knowledge we have lost in information?"
--T.S. Eliot