[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Recognizing Sequences (was More XSL Discussion)

Subject: Recognizing Sequences (was More XSL Discussion)
From: Jonathan Marsh <jmarsh@xxxxxxxxxxxxx>
Date: Thu, 26 Feb 1998 09:49:11 -0800
recognizing sequences
| -----Original Message-----
| From: Paul Prescod [mailto:papresco@xxxxxxxxxxxxxxxx]
| Sent: Thursday, February 26, 1998 7:03 AM| Consider:
| 
| <A><B><A><A><B><A><A><A><B>
| 
| Now I want to wrap sequences of more than one A in a paragraph flow
| object. The problem is that by the time the first A's construction rule
| is triggered, it is essentially too late to make the wrapping paragraph,
| unless you use one of the hacks that have been already suggested (e.g.
| manually trigger the processing of the other A's and surpress their
| output elsewhere).

I just wanted to break this part of the discussion onto its own thread
(since all discussions seem to be occurring on a single thread :-) and to
take a shot at presenting the problem a little more concretely.  I
personally think this is a vital feature.

Scenario 1 (modelled after HTML's <DL>):
<definition-list>
  <term>X</term>
  <definition>1</definition>
  <term>Y</term>
  <definition>2</definition>
</definition-list>

Desired output (HTML):
<TABLE>
  <TR>
    <TD>X</TD>
    <TD>1</TD>
  </TR>
  <TR>
    <TD>X</TD>
    <TD>1</TD>
  </TR>
</TABLE>

In this transformation, a simplistic mapping is possible between
<definition-list> and <TABLE>, <term> and <TD>, and <definition> and <TD>.
There is no simple mapping that results in <TR>.  In an ideal world we would
go back to our source DTD and group each <term>/<definition> pair in an
<item> element.  In the real world, this is not possible.  Specifying an
element sequence that could be mapped into the <TR> is a plausible solution
that the XSL WG should explore.

Scenario 2 (Paul's scenario above):
<farm>
  <cow>Bessy</cow>
  <pig>Porky</pig>
  <pig>Wilbur</pig>
  <pig>Piglet</pig>
</farm>

Desired output (HTML):
<P>cows: Bessy</P>
<P>pigs: Porky Wilbur Piglet</P>

This requires a similar mapping of the "sequence" of <pig> elements into a
single <P>.  This differs from the above example only in that (1) it
contains a sequence of identical element types instead of a pattern of
different element types, (2) the number of elements in the sequence is not
known.

Jonathan Marsh
phone   425.703.4591
jmarsh@xxxxxxxxxxxxx


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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.