[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: More XSL Discussion
Why not generalize the idea to express the number of target elements using BNF ?, + and * operators, for example: <rule> <target-element type="LIST"/> <target-element type="ITEM"+/> ... action part </rule> Matti Katajamaki -----Original Message----- From: Michael Kay [SMTP:M.H.Kay@xxxxxxxxxxxxx] Sent: Wednesday, February 25, 1998 4:51 AM To: xsl-list@xxxxxxxxxxxxxxxx Subject: Re: More XSL Discussion >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 XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|