Could Author mode find and use CSS in an attribute?
Posted: Tue Oct 23, 2018 9:28 pm
Hi there,
Would it be possible to have a configuration in Author Mode whereby, in addition to the supplied CSS stylesheet, the renderer looked for CSS rules in an attribute on XML elements? I'm thinking particularly of the TEI @style attribute, whose contents are CSS. It would be nice if this:
showed up as centred in Author Mode because the document type configuration allowed us to specify that @style is a source for CSS rules. It's possible to do this to a certain extent with e.g.:
in the stylesheet, but obviously this gets messy and complicated when multiple rules appear in a single attribute, as is commonly the case.
I'm imagining a configuration in the Document Type dialog box where an XPath selecting one or more attributes could be specified (//*/@style, or */@style if modelled on an xsl:templates/@match attribute). The renderer would then apply rules found in these contexts after applying the general stylesheet rules.
Cheers,
Martin
Would it be possible to have a configuration in Author Mode whereby, in addition to the supplied CSS stylesheet, the renderer looked for CSS rules in an attribute on XML elements? I'm thinking particularly of the TEI @style attribute, whose contents are CSS. It would be nice if this:
Code: Select all
<p style="text-align: center;">...</p>
Code: Select all
*[style='text-align: center;']{text-align: center;}
I'm imagining a configuration in the Document Type dialog box where an XPath selecting one or more attributes could be specified (//*/@style, or */@style if modelled on an xsl:templates/@match attribute). The renderer would then apply rules found in these contexts after applying the general stylesheet rules.
Cheers,
Martin