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

Making sure table rows are filled?

Subject: Making sure table rows are filled?
From: "Vic Gar" <vlg8693@xxxxxxxxxxx>
Date: Fri, 18 Oct 2002 12:13:54 -0400
filled a table in access
Hello all,
With flat-ish xml (below), I need to
1) select the elements from a predetermined position (e.g, elems d1-d9)
<xsl:variable name="table_nodes" select="/a/b/c/*[position() &lt; 10]"/>
2) take those that have text node children
...and normalize-space{.}
3) make a table with rows of two name/value pairs (e.g., <tr><td>#9</td><td>foo</td><td>#10</td><td>bar</td></tr> )
for-each select="$table_nodes[position() mod 2 = 1]
<tr>
<xsl:apply-templates select=". | ...
4) if there are an odd number of elements, only the last row of the table can be missing a <td> - all the preceding rows should have the requisite 2 name/value pairs.



I tried:
<xsl:apply-templates select=". | $table_nodes[position() &gt; $here and position() &lt; $here+2]" mode="td"/>
The nodes that made it into $table_nodes, in doc order, are
d1 & d4-9.
but for some reason it created:
d1 (d1 value} d4 (d4 value}
d5 (d5 value}
d6 (d6 value} d7 (d7 value)
d7 (d7 value} d9 (d9 value}


My understanding of what's going on here is a long way from where it should be. I get why d7 was selected twice, but as for the rest (why no d8, why single <td> at d5, how to do this properly) can anyone explain it to me?

xml:
<a>
  <b>
     <c>
        <d1>one</d1>
        <d2></d2>
        <d3></d3>
        <d4>four</d4>
        <d5>five</d5>
        <d6>six</d6>
        <d7>seven</d7>
        <d8>eight</d8>
        <d9>nine</d9>
        <d10>ten</d10>
     </c>
  </b>
</a>

Many thanks!

_________________________________________________________________
Choose an Internet access plan right for you -- try MSN! http://resourcecenter.msn.com/access/plans/default.asp



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.