[xsl] combining property lists with content

Subject: [xsl] combining property lists with content
From: saodl@xxxxxxxx
Date: Tue, 22 Jan 2002 07:25:58 -0800 (PST)
I'm rather new at declarative programming and through
I'm fumbling along okay, I feel there must be a better
way to do this; any help would be appreciated.

I am combining two XML files- one contains a series
of sentances for display one at a time, and the other
contains definitions with various properties which
are associated with the words of these sentances in
a table like so:

The quick         red                fox...
Root of 'quick'   Root               ...etc.
gramatical info   grammar   
pronunciation     pronunciation
...                         ...

The definitions are identified by a 4 digit number,
and associated through this to the words in the other
file.  (The files are seperated because the same definition
might be used many times.)  A sample of the XML from
both files:

-----Text-----
<chapter>
  <p>
    <text defid="4011" grammar="...">The quick</text>
    <text defid="4317" grammar="...">red</text>
    <text defid="2281" grammar="...">fox</text>
     ...
  </p>
   ...
</chapter>
---------------
---Lexicon---
<d_lst>
  <def id="4011" root="QUICK">
    <property1>text</property1>
    <property2>text</property2>
    <property3>text</property3>
    <property4>text</property4>
     ...
  </def>
  <def>...</def>
  ...
</d_lst>
--------------

At the moment I am using a series of for-each statements
to lay out first all the text, then all the roots,
etc. because I can't build the table column by column,
and if I use one cell with a new table inside for each
word I found that the rows don't line up evenly.  This
works, but I find using 8 consecutive for-each statements
with just the property name changed excessively crude.
 Can anyone suggest a more efficient and more elegant
way to go about this?

siri

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


Current Thread