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

Re: Re: adding column number to the entry

Subject: Re: Re: adding column number to the entry
From: Ganesh Babu N <nbabuganesh@xxxxxxxxx>
Date: Fri, 4 Sep 2009 10:24:26 +0530
Re:  Re: adding column number to the entry
That is only sample text (Table 1 TB...). In the real life that is not
possible.

I need to provide the sequence number of entries in that row and give
the number in the name attribute. name=1 for the first entry and
name=2 to the second entry etc. When morerows=1 means when rowspan is
there the entries in the next row should get incremented from the
entry position in the previous row.


look at the input and generate the output given.

Thanks are regards,
Ganesh




On Thu, Sep 3, 2009 at 5:47 PM, ac<ac@xxxxxxxxxxxxx> wrote:
> Hi,
>
> I may be missing something, but how about something along the lines of:
>
>   <xsl:template match="entry">
>       <cell Name="{substring(substring-after(., 'Table 1 TB C'), 1,
> 1)}" RowSpan="{if (xs:integer(@morerows)) then @morerows + 1 else 1}"
> ColumnSpan="1">
>           <xsl:value-of select="."/>
>       </cell>
>   </xsl:template>
>
> Cheers,
> ac
>
>
>
>> Please help me on this issue.
>>
>> Regards,
>> Ganesh
>>
>>
>> On Tue, Sep 1, 2009 at 3:09 PM, Ganesh Babu N<nbabuganesh@xxxxxxxxx>
>> wrote:
>>
>>>
>>> Dear All,
>>>
>>> I am having a input like this.
>>>
>>> <table>
>>>       <row>
>>>               <entry align="left" valign="top">Table 1 TB C1 R5</entry>
>>>               <entry align="left" valign="top" morerows="1">Table 1 TB C2
>>> R5 and
>>> TB C2 R6 are merged</entry>
>>>               <entry align="left" valign="top">Table 1 TB C3 R5</entry>
>>>               <entry align="left" valign="top">Table 1 TB C4 R5</entry>
>>>       </row>
>>>       <row>
>>>               <entry align="left" valign="top">Table 1 TB C1 R6</entry>
>>>               <entry align="left" valign="top">Table 1 TB C3 R6</entry>
>>>               <entry align="left" valign="top">Table 1 TB C4 R6</entry>
>>>       </row>
>>> </table>
>>>
>>> My required output is as follows:
>>>
>>> <table>
>>>  <cell Name="1" RowSpan="1" ColumnSpan="1">Table 1 TB C1 R5</cell>
>>>  <cell Name="2" RowSpan="2" ColumnSpan="1">Table 1 TB C2 R5 and TB
>>> C2 R6 are merged</cell>
>>>  <cell Name="3" RowSpan="1" ColumnSpan="1">Table 1 TB C3 R5</cell>
>>>  <cell Name="4" RowSpan="1" ColumnSpan="1">Table 1 TB C4 R5</cell>
>>>  <cell Name="1" RowSpan="1" ColumnSpan="1">Table 1 TB C1 R6</cell>
>>>  <cell Name="3" RowSpan="1" ColumnSpan="1">Table 1 TB C3 R6</cell>
>>>  <cell Name="4" RowSpan="1" ColumnSpan="1">Table 1 TB C4 R6</cell>
>>> </table>
>>>
>>> I have tried with the following code but it is changing the number in
>>> all the 2nd row entries. It requires to be changed only in C3 of R6
>>> and C4 of R6. Because C2 of R6 is already merged with C2 of R5.
>>>
>>> <xsl:template match="entry>
>>>     <xsl:if test="parent::row/preceding-sibling::row/entry/@morerows">
>>>          <xsl:value-of select="position() +
>>> parent::row/preceding-sibling::row/entry[@morerows]/position()"/>
>>>     </xsl:if>
>>> </xsl:template>
>>>
>>> Please help me getting required output.
>>>
>>> Regards,
>>> Ganesh

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.