Re: More XSL Discussion

Subject: Re: More XSL Discussion
From: "Michael Kay" <M.H.Kay@xxxxxxxxxxxxx>
Date: Wed, 25 Feb 1998 12:51:22 -0000
>Michael Kay wrote:
>> You're right, it doesn't make sense to create half an HTML element. It
does make sense, however, to generate one "output" HTML element as a result
of encountering a fairly complex input XML pattern.
>
Paul Prescod replied:
>This is a hard problem, but matching larger patterns may well be the
>best way to attack this. Still, one must weigh the cost of complicating
>the language with a new construct vs. using ad hoc coding tricks in the
>rare case that it comes up.

I think in fact there is one kind of "complex pattern" that would meet 80%
of the requirement and would SIMPLIFY the language: namely "a group of
consecutive elements of the same type". Currently there are three patterns
for "first of type", "last of type" and "only of type", and if any of these
is matched, then the default rule for the element is not matched. If you get
rid of these, and have a rule that matches a sequence of one or more
elements of a type, and that does not inhibit the matching of the individual
elements by a separate rule, then you can generate matching HTML start and
end tags at the start and end of the sequence without any problems.

Extend this to a sequence of elements of one or more named types (replacing
the "first of any", "last of any", and "only of any" qualifiers), and you
now meet 90% of the requirement, again without complicating the language.

Mike Kay


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread