xsl-list
[Top] [All Lists]

Re: [xsl] problem with xsl:copy-of and counting lines

2007-06-20 05:32:49
Quoting David Carlisle <davidc(_at_)nag(_dot_)co(_dot_)uk>:


but your problem description is refering to the number of lines in a
printed form of the document which has only a slight relationship
to the number of lines in the source xml.

The input sample in your original post looked basically like html plus
some custom tags.

I'll assume the elements work as they do in html, so that an element like

   <li>Was sagen die Blutzucker-Messwerte aus?</li>

would produce multiple lines of output if the text was sufficiently
long, even if it had no line breaks in the source, and conversely
if the input was

   <li>
    Was sagen die Blutzucker-Messwerte aus?
   </li>

the output would be the same, on one line, even though teh XML source
was spread over three.

I assume this makes a single row of a table, so one line of output even
though the code discussed so far woul count it as 7 (unless you have
specified xsl:strip-sapace in your stylesheet in which case the
indentation nodes will be ignored and it would be counted as 0 as it
doesn't contribute any #10 characters to the block.

 <tr>
   <tag>So</tag>
   <datum>13.06.07</datum>
   <uhrzeit>14:00 - 15:30 Uhr</uhrzeit>
   <kursnr>Kurs-Nr.: </kursnr>
   <nr>50</nr>
   <beitrag>10 Euro</beitrag>
   </tr>


If the thing is being displayed as a table, the first number of interest
is probably the number of rows, which is count(block/kursinfo/tr) I'd
guess.

David

________________________________________________________________________
The Numerical Algorithms Group Ltd is a company registered in England
and Wales with company number 1249803. The registered office is:
Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United Kingdom.

This e-mail has been scanned for all viruses by Star. The service is
powered by MessageLabs.
________________________________________________________________________

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--




That´s right... as you can see/read I am not a programmer and at the company where I actually do my preparative work for the diploma no one can unfortunately give support according this topic.

At first I used the HTML structure because it seems to be easier for me to transform tables etc. But now with the help of this list I am able to use more or less every kind of element for transformation so I have some ancient HTML elements between the others.

So tomorrow I will go back a few steps and reflect the whole project so far.
But I think there will be a lot of questions to come :-(

Thanks,
Andreas


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--