This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
problems in loop creation in a table--help required..
- To: <xsl-list at lists dot mulberrytech dot com>
- Subject: [xsl] problems in loop creation in a table--help required..
- From: "Praveen G" <praveeng at india dot hp dot com>
- Date: Fri, 28 Sep 2001 13:31:46 +0800
- References: <002101c14663$e931b4a0$8b604c0f@india.hp.com>
- Reply-To: xsl-list at lists dot mulberrytech dot com
hi all ,
thanks for marco, sun-fu-yang, dimitre and jorg heinicke for attempting to
solve this problem. i haven't sent my xml sheet and xsl sheet
yesterday--which could have helped you to directly solve my problem. i tried
to implement 2 or 3 approaches suggested here --but Microsoft IE is showing
some errors.i am cut -pasting a sample of my xml document +xsl document --so
that it will be easy for you to solve it and help me out.PLEASE BE PATIENT
WITH ME AS THIS IS A VERY LONG MAIL DUE TO THOSE DOCUMENTS. Iam including
what i tried to incorporate earlier. I DID NOT PLACE ANY OF YOUR CODE OVER
THERE. placing your code over there--INTERNET EXPLORER is saying
that --unknown method --position() and all that.
My yesterday's mail is below these two documents. i want to design the
tables in html code and not in FO: code.PLEASE CHECK OUT THE subsystem_id
part of the xsl style sheet and give me a code so that entire stylesheet
will be in a usable form to display all the tables required.
please put C1 , C2 ...upto c16 as cu01,cu02, etc... upto cu16.
please put rows R1 as 00-3f, R2 as 40-7f, R3 as 80-Bf , R4 as
CO-FF.
MY XML DOCUMENT:
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="config.xsl"?>
<configuration_package>
<configuration>
<system>XP128</system>
<timestamp>29 Mar 2001 10:36:43</timestamp>
<time_zone>GMT+05:30</time_zone>
<configured_capacity
unit="GB">14246.54</configured_capacity>
<cache unit = "MB">32768</cache>
<dkc_info>
<dkc_serialnumber>45681</dkc_serialnumber>
<dkc_revision>10 Jun 2001</dkc_revision>
</dkc_info>
<subsystem_id>0001</subsystem_id>
<subsystem_id>0002</subsystem_id>
<subsystem_id>0003</subsystem_id>
<subsystem_id>0004</subsystem_id>
<subsystem_id>0005</subsystem_id>
<subsystem_id>0006</subsystem_id>
<subsystem_id>0007</subsystem_id>
<subsystem_id>0008</subsystem_id>
<subsystem_id>0009</subsystem_id>
<microcode_info>
<dkc_revision>01-11023-00/95</dkc_revision>
<svp_revision>01-11-29/00</svp_revision>
<config_revision>01-11-05/10</config_revision>
<lcp_revision>03-00-44</lcp_revision>
<ssvp_revision>01-00-11</ssvp_revision>
<ramboot_revision>01-01-99</ramboot_revision>
<cudg4_revision>01-02-04</cudg4_revision>
<lcdg_revision>01-00-99</lcdg_revision>
<fop_revision>01-06-07</fop_revision>
<scsir1b_revision>00-00-E6</scsir1b_revision>
<scsir1c_revision>00-00-E6</scsir1c_revision>
</microcode_info>
</configuration>
</configuration_package>
MY XSL DOCUMENT:
==================
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">
<xsl:template match="/">
<HTML>
<HEAD>
<TITLE>
<xsl:for-each select="configuration_package">
</xsl:for-each>
Configuration Collector's Information
</TITLE>
</HEAD>
<BODY>
<xsl:for-each select="configuration_package">
<H1> Configuration Collector's Information </H1>
<xsl:for-each select="configuration">
<H2 ALIGN="CENTRE"> Configuration package</H2>
<H3 ALIGN="CENTRE">system_info</H3>
<TABLE border="1">
<TBODY>
<TR>
<TD>System</TD><TD><xsl:value-of select="system"/></TD>
</TR>
<TR>
<TD>Timestamp</TD>
<TD><xsl:value-of select="timestamp"/></TD>
</TR>
<TR>
<TD>Time_zone</TD>
<TD><xsl:value-of select="time_zone"/></TD>
</TR>
<TR>
<TD>Capacity</TD>
<TD><xsl:value-of select="configured_capacity"/> GB</TD>
</TR>
<TR>
<TD>Cache </TD>
<TD><xsl:value-of select="cache"/></TD>
</TR>
</TBODY>
</TABLE>
<xsl:for-each select="dkc_info">
<H3 ALIGN="CENTRE">dkc_info</H3>
<TABLE border="1">
<THEAD>
<TR>
<TH>dkc_serialnumber</TH> <TH>dkc_revision</TH>
</TR>
</THEAD>
<TBODY>
<TR>
<TD><xsl:value-of select="dkc_serialnumber"/></TD>
<TD><xsl:value-of select="dkc_revision"/></TD>
</TR>
</TBODY>
</TABLE>
</xsl:for-each>
NOTE:-- MY subsystem_id CODE COMES HERE.
<H3 ALIGN="CENTRE">
Subsystem_id_info
</H3>
<TABLE border="1">
<THEAD>
<TR>
<TH> </TH> <TH>cu 00</TH>
<TH>cu 01</TH>
<TH>cu 02</TH>
<TH>cu 03 </TH>
<TH>cu 04</TH>
<TH>cu 05</TH>
<TH>cu 06</TH>
<TH>cu 07</TH>
<TH>cu 08</TH>
<TH>cu 09</TH>
<TH>cu 10</TH>
<TH>cu 11</TH>
<TH>cu 12</TH>
<TH>cu 13</TH>
<TH>cu 14</TH>
<TH>cu 15</TH>
</TR>
</THEAD>
<TBODY>
<TR>
<TD>00-3f</TD>
<TD><xsl:call-template match="subsystem_id[position()=1 or
position()=5]"/></TD>
</TR>
<TR>
<TD>40-7f</TD>
<TD><xsl:call-template match="subsystem_id[position()=2 or position()=6]"/>
</TD>
</TR>
<TR>
<TD>80-Bf</TD>
<TD><xsl:call-template match="subsystem_id[position()=3 or position()=7]"/>
</TD>
</TR>
<TR>
<TD>C0-FF</TD>
<TD><xsl:call-template match="subsystem_id[position()=4 or position()=8]"/>
</TD>
</TR>
</TBODY>
</TABLE>
<H3 ALIGN="CENTRE">
microcode_info</H3>
<TABLE border="1">
<THEAD>
<TR>
<TH> </TH> <TH>revision</TH>
</TR>
</THEAD>
<xsl:for-each select="microcode_info">
<TBODY>
<TR>
<TD>dkc_</TD><TD><xsl:value-of select="dkc_revision"/></TD>
</TR>
<TR>
<TD>svp_</TD>
<TD><xsl:value-of select="svp_revision"/></TD>
</TR>
<TR>
<TD>config_</TD>
<TD><xsl:value-of select="config_revision"/></TD>
</TR>
<TR>
<TD>lcp_</TD>
<TD><xsl:value-of select="lcp_revision"/></TD>
</TR>
<TR>
<TD>ssvp_ </TD>
<TD><xsl:value-of select="ssvp_revision"/></TD>
</TR>
<TR>
<TD>ramboot_ </TD>
<TD><xsl:value-of select="ramboot_revision"/></TD>
</TR>
<TR>
<TD>cudg4_ </TD>
<TD><xsl:value-of select="cudg4_revision"/></TD>
</TR>
<TR>
<TD>lcdg_ </TD>
<TD><xsl:value-of select="lcdg_revision"/></TD>
</TR>
<TR>
<TD>fop_ </TD>
<TD><xsl:value-of select="fop_revision"/></TD>
</TR>
<TR>
<TD>scsir1b_ </TD>
<TD><xsl:value-of select="scsir1b_revision"/></TD>
</TR>
<TR>
<TD>scsir1c_ </TD>
<TD><xsl:value-of select="scsir1c_revision"/></TD>
</TR>
</TBODY>
</xsl:for-each>
</TABLE>
</xsl:for-each>
</xsl:for-each>
</BODY>
</HTML>
</xsl:template>
</xsl:stylesheet>
NOTE: the table creation for subsystem id is part of a large
xsl document which has many other tables. using templates
and call-templates , i am facing problems.Can anyone of you
design a code which when included in the xsl document should
produce
table as is required.
Thanks and regards,
praveen
MY EARLIER MAIL:
> i have an xml document with elements like this-
> <subsystem_id>value1</subsystem_id>.
>
> <subsystem_id> value2</subsystem_id>.
>
>
> <subsystem_id> value3</subsystem_id>. etc .
> now i have to design a table like the one shown BELOW.. we have total of
16
> columns and 4 rows. the values indicated in the table(value 1/2/3 etc) are
> the values of <subsystem_id>.
> Now there can be a maximum of 64 .<subsystem_id> values and minimum can be
> 0ne or two ....upto 64. i.e , it varies from document to document.
> This document has other elements also. The documents vary only in
> <subsystem_id> elements. i want to prepare a generic xsl stylesheet which
> will create a
> table like this every where.
>
>
> Now the problem is , the values has to be put in such a way that, the 5th
> value will come in column c2 and row R1.
> similarly 6th value should come in column C2 and row R2. It goes down
> like this till 8 th value and again the 9th value
> will come in column c3 and row R1. similarly 10 th value will come
> incolumn C3 and row R2.
> we donot know the no. of values that are going to bepresent. so, we
cannot
> place them individually specifying the corresponding
> row and column. Given , VARIABLE no. of <subsystem_id>.s which we donot
> know
> , how do i create a loop for placing them in such a pattren as told above.
>
> C1 C2 C3 C4 C5 UPTO........C16
>
|---------------------------------------------------------------------------
> R1 | value1 value5 value9
> R2 | value2 value6
> R3 | value3
> R4 | value4
>
>
> i guess u got what i am trying to convey.can anyone suggest a solution
> please. I need the code for it. I have tried with position()=1 |
> position()=5 code , but it is giving an error in some other part of the
> program.
>
> regards,
> praveen
>
>
> XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
>
>
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list