Subject: RE: [xsl] A tricky problem From: "Carlos M. S. Bento Nogueira" <cmsbn@xxxxxxxxxxxxxxxxx> Date: Sun, 19 Jun 2005 00:59:49 +0100 (WEST) |
<xsl:template match="fi:item"> <td> <input type="radio" id="{generate-id()}" name="{$id}" value="{@value}"> (...) </xsl:template>
<td> <input> </td> <td> <input> </td> <tr> <!--I can only have (($number_of_lines) - 1) tr tags --> <td> <input> </td> <td> <input> </td> </tr>
TIA, TG(thanks again), CarlosN.
Carlos, I somewhat lost track of what you're trying to do, in the long-winded explanation -- what works for me is seeing input, required output, then any explanation of what changes may/not be made. Anyway, see this thread: http://www.biglist.com/lists/xsl-list/archives/200506/msg00517.html
Regards,
--A
From: "Carlos M. S. Bento Nogueira" <cmsbn@xxxxxxxxxxxxxxxxx> Reply-To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx Subject: [xsl] A tricky problem Date: Sat, 18 Jun 2005 17:32:12 +0100 (WEST)
Hello!
I'm trying to create a piece of xsl code that dinamicaly displays items on a table.This seems a basic problem at first glance, but if you're curious(and a bit pacient) please continue reading :)
This is my item list:(temp.xml) <fd:selection-list> <fd:item value="Dcor"/> <fd:item value="DAo"/> <fd:item value="InsAo"/> <fd:item value="EstAo"/> </fd:selection-list>
Note that i cannot change the item properties, e.g. , to add another attribute like position="row" to fd:item nor
can i add description tags between item lists e.g. :
<fd:item value="Dcor"/> <row></row> <fd:item value="DAo"/>
The description of this item lists is passed to the xsl by snippet:(temp_action.xml)
<table border="0">
<tr>
(...)
<td>
<ft:widget id="diagnostico_opcoes">
<fi:styling list-type="radio" list-orientation="horizontal" line="2" column="2"/>
</ft:widget>
</td>
(...)
</tr>
where we describe the list orientation layout and number of columns and rows we want on a table.
The piece of xsl code which iterates through the items on this list is given by this snippet:
<xsl:for-each select="descendant-or-self::fi:item">
(..)
</xsl:for-each>
although the following piece of code also produces the same results:
<xsl:for-each select="fi:selection-list/fi:item">
(...)
</xsl:for-each>
Inside the iteration code snippet, i should build a set of instructions that could produce an HTML output like
<td>
<input name="Dcor" .../>
<td/>
<td>
<input name="Dao" .../>
<td/>
<tr>
<td>
<input name="InsAo" .../>
<td/>
<td>
<input name="EstAo" .../>
<td/>
<tr/>
My last attemp to produce this, was the following piece of code:
<xsl:variable name="elements" select="count(descendant-or-self::fi:item)"/> <xsl:for-each select="descendant-or-self::fi:item">
<!-- Counts the iteration number temp= 1,2,3,4 ... -->
<xsl:variable name="temp" select="($elements)-(count(following-sibling::*))"/>
<xsl:if test="$temp<$line"> <tr> <xsl:if test="temp<$column"> <td> <input type="radio" ..../> </td> </xsl:if> </tr> </xsl:if> (...)
This would work great if instead of if test="..." i had a
for-each select="(1 to $line)"
for-each select="(1 to $column)"
and although this is possible since i'm using Saxon8 it doesn't do the trick for
the following reasons:
- i should only change lines if i have $line>=2
- the following snippet is invalid as a mean to insert lines between columns:
<xsl:if test="$line>=2">
<tr>
</xsl:if>
(code to show inputs here)
<xsl:if test="$line>=2"> </tr> </xsl:if>
_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] A tricky problem, Aron Bock | Thread | [xsl] A tricky problem 2, Carlos M. S. Bento N |
RE: [xsl] Can not convert number to, Carlos M. S. Bento N | Date | Re: [xsl] Accessing <xsl:param> fro, Joe Fawcett |
Month |