|
Posted by tintagel on 03/14/06 15:43
Hi everyone, I've just joined your group!
I'm pretty new to HTML etc. Here's my problem:
I'm attached to the idea of keeping content separate from formatting
information, so I like putting content in a .xml document and then
making a stylesheet for it.
At the moment I'm working on a lot of prose-style text, and having to
enclose everything in double-sided <xyz></xyz> tags in order to get any
kind of indentation between blocks is not so convenient. This is
especially true when formatting dialogue in fiction, where you need
line breaks and indentation for lots of very short, consecutive lines
of text.
The approach I'm currently pursuing is to put an emtpy node called <br
/> in the .xml source where I need a line break, and then use .xsl and
..css stylesheets to instuct the browser to interpret this as "do a line
break, but indent the first character of the next line".
The only way to do this that I've currently found is a rather inelegant
'cheat' using the zero width non-joiner ‌ (‌), thus
(extracting from the stylesheet):
<xsl:template match="br">
<br />
<span id="indent">‌</span>
</xsl:template>
where "indent" pads on the left by 1em.
(De-confuser: the matched "br" is the empty node that lives in the .xml
source.)
This works o.k., and doesn't upset the "text-align: justify" which is
in effect throughout the document (and which for example, if I
substitute the <span></span> expression with &emsp, leaves the indented
text misaligned as the space character is factored into the
justification). I guess it's an o.k. work-around, but it's still a
misuse of an entity (‌), which can't be good practice and leaves a
bitter taste in the mouth.
Is there a way of achieving the same result in a more concrete manner
using CSS? Or is there a safer 'placeholder entity' I can use instead
of ‌ to put inside the <span> so it actually indents the following
character? A crucial consideration here seems to be the justified text,
and how to avoid mucking it up.
I'd really appreciate any advice on this!
Best wishes,
T.
Navigation:
[Reply to this message]
|