At 06:26 AM 5/9/2006, Marcello wrote:
>Sebastian Rahtz wrote:
> > sounds like cheating, to use Perl :-}
>XSLT is sooo verbose and hopelessly underpowered.
Except when it's not.
The problem being described, raising an in-paragraph list to the same
level of the hierarchy as the paragraph and splitting, when
necessary, the paragraph on both sides (along with any other nested
container elements), is hard in XSLT because it's a special instance
of a kind of transformation for which XSLT, and indeed XML document
modeling altogether, is ill-suited.
Yes: can anyone say "multiple concurrent hierarchies"?
If you treat XML as if it were just-plain-milestones, like COCOA,
then the problem goes away, along with most of the advantages of
using XML to begin with. This can even be a reasonable thing to do.
The problem is also relieved somewhat by schema constraints such as
"please don't start a list in the middle of a <seg>", but these are
only stopgaps. Yet as we have seen, such rules do allow us to write
ad-hoc code to deal with it, even in XSLT.
There are also other ways of skinning this cat. You can decide that,
XHTML being a "terminal format" not suitable for input to any process
other than certain specified target applications (a known set of
browsers), formal validation of XHTML doesn't matter as long as the
browser does "the right thing" with ul/ol inside p. (Most browsers
do.) While this might be controversial -- it is almost certainly too
hopeful and a potential cause for regret -- it may be warranted by
XHTML's own modeling here. "A chunk of text presented discretely,
generally delimited in presentation by vertical whitespace or an
analogous pause, whose content can be displayed entirely as a
line-wrapped sequence of characters", if it's a fair description of
the HTML "p", implies that XHTML has no meaningful semantics (which
is a long way of saying "no semantics") beyond the presentational.
But this is manifestly what TEI does *not* mean by "p".
Wendell Piez mailto:[log in to unmask]
Mulberry Technologies, Inc. http://www.mulberrytech.com
17 West Jefferson Street Direct Phone: 301/315-9635
Suite 207 Phone: 301/315-9631
Rockville, MD 20850 Fax: 301/315-8285
Mulberry Technologies: A Consultancy Specializing in SGML and XML