OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

dita-lightweight-dita message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: Template-based specialization thoughts/examples


Some thoughts/examples on template-based specialization using a data element:

I want a specialization that looks like this:

<mytopic id="x">
        <intro>This used to be a shortdesc</into>
        <main>
                <p>Always starts with a para</p>
                <ul>
                        <li>And then a list, unordered</li>
                        <li>or it could be ordered</li>
                </ul>
        </main>
</mytopic>


So I create a template that looks like this:

<topic id="x">
        <specdata name="mytopic"><title>I could provide a definition of the intro element here</title>
                        <specmodel value="sequence">
                                <specelem name="intro" value="onerequired">
                                <speceleml name="main" value="onerequired">
                        </specmodel>
        </specdata>
        <shortdesc>
                <specdata value="intro"><title>I could provide a definition of the intro element here</title></specdata>
                This used to be shortdesc
        </shortdesc>
        <body>
                <specdata name="main"><title>I could provide a definition of the main element here</title></specdata>
                        <specmodel value="sequence">
                                <specelem name="p" value="onerequired"/>
                                <specmodel name="choice" value="onerequired">
                                        <specelem name="ul"/>
                                        <specelem name="ol"/>
                                </specmodel>
                        </specmodel>
                </specdata>
                <p>Always starts with a para</p>
                <ul>
                        <li>And then a list, unordered</li>
                        <li>or it could be ordered</li>
                </ul>
                <ol>
                        <li>And then a list, ordered</li>
                        <li>or it could be unordered</li>
                </ul>
        </body>
</topic>

So I did that with 3 new elements:

<specdata> contains <title>, text, and <specmodel>
<specmodel> contains <specelem>/ <specmodel> - has the type of group it represents (choice, sequence) plus its optionality and number (onerequired)
        (I know this is awkward - it's just a first pass and I'm tired now)
<specelem> references an element (not with an href, though, at least not yet)

(Among the) open questions:
- do we need to make the specelem elements references to ids, so we can keep track of the associations between the content model and the elements it organizes?
- especially when we get to the ul vs ol content - we know it's a choice, do we want a special element or attribute in specmodel to identify stuff that should be hidden?
- or put that "hide" clue in the content itself? (ie in the <ol> outputclass attribute maybe?)
- what do we do about cases where data/specdata isn't allowed in the element we want to specialize? (I'm looking at you, ul/ol)
        (we could move the specdata into the prolog for that case and reference the element it specializes from there, but it's awkward and inconsistent)

One of the nice things about this model, as I think about it, is that you could potentially create new compound specializations simply by using conref. You want to borrow the <context> element from task? Just conref in the <context> element from a file that contains it. There are terrible depths of complexity screaming at me from the bottom of the can I just opened there, but if we can keep the implementation simple it would make specialization wonderfully intuitive for DITA authors.

Michael Priestley, Senior Technical Staff Member (STSM)
Enterprise Content Technology Strategist
mpriestl@ca.ibm.com
http://dita.xml.org/blog/michael-priestley

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]