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

problem with xsl:copy-of and counting lines

Subject: problem with xsl:copy-of and counting lines
From: Andreas Peter <info@xxxxxxxxxx>
Date: Wed, 20 Jun 2007 10:46:56 +0200
 problem with xsl:copy-of and counting lines
Hello XSL-List-Users,

I still have a probelm with counting lines in a set of nodes. I want
to count the lines in a specific tree structure. The xml structure
looks like the following:

 <h1>Mit gesunden Fuessen laeuft es besser</h1>
  <li>Was sagen die Blutzucker-Messwerte aus?</li>
  <li>Ist die Krankheit erblich?</li>

  <refname>Seminar mit Hans Wurscht</refname></referent>
  <uhrzeit>15:00 - 16:30 Uhr</uhrzeit>

  <uhrzeit>14:00 - 15:30 Uhr</uhrzeit>

  <uhrzeit>14:00 - 15:30 Uhr</uhrzeit>
  <kursnr>Kurs-Nr.: </kursnr>

  <uhrzeit>14:00 - 15:30 Uhr</uhrzeit>
  <kursnr>Kurs-Nr.: </kursnr>
  <beitrag>10 Euro</beitrag>

  <zusatztext>blabla hier kommt noch zusC$tzlicher Text hinein, wie
z.B.     HandtC<cher mitbringen usw.</zusatztext>

My aim is to count every line between the element <block></block>
which can occur several times. The returned value should be stored in
a variable which I can use later.

My xsl so far:

<xsl:template match="block" mode="variable">
<xsl:copy-of select="."/>
<xsl:variable name="countlines" select="string-length(/) -
string-length(translate(/,'&#xA;',''))" />
<xsl:value-of select="."/>

Counting the lines for the whole document is no problem.
Hope someone out there can help.

Thanks so much.

Current Thread


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.
First Name
Last Name
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.