[DDI-users] Looking for XSL advice

Winona Salesky wmeltzer at Princeton.EDU
Wed Sep 28 11:47:18 EDT 2005


Hi Fredy,
I would think you could include an if statement and a choose statement in
two places: 
  Where the table cell headers are declared add:
            <xsl:if test="catgry/catStat[@wgtd= 'wgtd']">
                <th>
                    <p>Weighted Frequency</p>
                </th>
            </xsl:if>

Where the table cell values are declared add the following:
<xsl:choose>
                <xsl:when test="catStat[@wgtd= 'wgtd']">
                    <td>
                        <xsl:choose>
                            <xsl:when test="catStat/table">
                                <p>see table below</p>
                            </xsl:when>
                            <xsl:otherwise>
                                <xsl:apply-templates select="catStat[@wgtd
!= 'wgtd']"/>
                            </xsl:otherwise>
                        </xsl:choose>
                    </td>
                    <td>
                        <xsl:apply-templates select="catStat[@wgtd =
'wgtd']"/>
                    </td>
                </xsl:when>
                <xsl:otherwise>
                    <td>
                        <xsl:choose>
                            <xsl:when test="catStat/table">
                                <p>see table below</p>
                            </xsl:when>
                            <xsl:otherwise>
                                <xsl:apply-templates select="catStat"/>
                            </xsl:otherwise>
                        </xsl:choose>
                    </td>
                </xsl:otherwise>
            </xsl:choose>

I don't normally use codebook2-0.xsl, but just looking it over briefly this
should head you in the right direction. Also if you use catStat for anything
other than frequencies you would have to adjust this to include the
@type='freq'.

Let me know if you have any questions.
-Winona

------------------
Winona Salesky
Applications Delivery Specialist
www.CPANDA.org
wmeltzer at princeton.edu


-----Original Message-----
From: ddi-users-bounces at icpsr.umich.edu
[mailto:ddi-users-bounces at icpsr.umich.edu] On Behalf Of Fredy Kuhn
Sent: Wednesday, September 28, 2005 10:48 AM
To: DDI List 1 users
Subject: [DDI-users] Looking for XSL advice

Hi all,
this is about presentation of frequencies in codebooks:

Does someone have a template or a suggestion about how to modify ICPSR's
codebook2-0.xsl (or any other xsl which deals with frequencies), to have in
the output an extra column 'weighted freq.'?

The question is about how to output two <catstat> elements into one single
html table line, in two different columns.

For details about the wish, see:
http://download.sidos.ch/pro/Service/DDI-Codebooks/wish.html
http://download.sidos.ch/pro/Service/DDI-Codebooks/

For tips, thanks in advance, and best regards
Fredy Kuhn, SIDOS

_______________________________________________
DDI-users mailing list
DDI-users at icpsr.umich.edu
http://www.icpsr.umich.edu/mailman/listinfo/ddi-users



More information about the DDI-users mailing list