473,770 Members | 2,719 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Help interpreting XSL count keyword

Hello, I am trying to decipher an XSL sheet that is not my own, and
yes, I'm a newbie.

<xsl:template match="sentence ">
<xsl:variable name="lines" select="count(l ine) +
count(preceding ::line)"/>
<xsl:copy>
<xsl:attribut e name="sectionnu mber"><xsl:valu e-of
select="floor($ lines div 15) + 1"/></xsl:attribute>
<xsl:apply-templates/>
<br/>
</xsl:copy>
</xsl:template>

Is "count(line )" returning the count of all lines so far parsed in the
document, or does it have something to do with the "sentence" tag being
matched? Also, what does "preceding::lin e" mean?
Hey, thanks for all the advice, - Dave

Jul 20 '05 #1
1 4964
Am 12 Jan 2005 19:46:01 -0800 schrieb la***********@z ipmail.com:
Hello, I am trying to decipher an XSL sheet that is not my own, and
yes, I'm a newbie.

<xsl:template match="sentence ">
<xsl:variable name="lines" select="count(l ine) +
count(preceding ::line)"/>
<xsl:copy>
<xsl:attribut e name="sectionnu mber"><xsl:valu e-of
select="floor($ lines div 15) + 1"/></xsl:attribute>
<xsl:apply-templates/>
<br/>
</xsl:copy>
</xsl:template>

Is "count(line )" returning the count of all lines so far parsed in the
document, or does it have something to do with the "sentence" tag being
matched? Also, what does "preceding::lin e" mean?
Hey, thanks for all the advice, - Dave


"count(line )" counts the number of occurrences of the line-nodes embedded
in the current sentence node. "preceding::lin e" is an XPathexpression that
refers to the number of occurrences of the line-tag embedded in the
preceding sibling of the current sentence node.

A good place to look for first advice is the online tutorials at
http://www.w3schools.com/

-- Sebastian
Jul 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
2803
by: mcp6453 | last post by:
I am trying to use Jack's FormMail script (http://www.dtheatre.com/scripts/formmail). Since I'm brand new at PHP and not very good at HTML, I have an easy question, which I will narrow down. When the email arrives, it has this information: v_firstname: asdf v_lastname: asdf b_email: asdf@bellsouth.net v_phone: asdf v_cellphone: asdf
10
2281
by: Jacek Generowicz | last post by:
Where can I find concise, clear documentation describing what one has to do in order to enable Python's internal help to be able to provide descriptions of Python keywords ? I am in a situation where I have to give Python novices the ability to fix this for themselves easily. Failing "concise" and "clear", how about "complete and correct" ?
4
2771
by: Jim Hubbard | last post by:
I have some C# code that is supposed to wrap the defrag APIs and I am trying to convert it to VB.Net (2003). But, I keep having problems. The C# code is relatively short, so I'll post it here..... -------- // // a set of simple C# wrappers over the NT Defragmenter APIs //
7
7141
by: Satish | last post by:
Hi Friends I am little confused about the shadows keyword in VB.NET could anyone explain with an example about Shadows keyword Many thanks Satish
43
2238
by: ZillionDollarSadist | last post by:
Hello, I'm working at a simple Access '97 + VB4 application, and I ran into a terrible problem: something I never modified now gives me a totally unwanted "Invalid use of null" error. It happens in a Text.LostFocus event, this block: Do While Not TB6.EOF If Year(TB6(0)) = Val(Trim(Text1.Text)) Then !!!!!!!!!!!!!Here!!!!!!!!! ...
4
2128
by: infiniti | last post by:
Hi, I am coming across problems in trying to EFFICIENTLY merge to XML files into one which involves transposing the rows into columns so that I can either generate a single flat xml file or store it in a flat table in the database. The 2 XML files which I have are: <xml> <keyword>
14
1636
by: giddy | last post by:
ok i have a datagridview in my app and i have a function defined like so: public void FillColumns(ref DataGridView theDGV) when i call it ... like this : FillColumns(ref dataGridView2); i get : Object reference not set to an instance of an object.
1
3512
by: Etayki | last post by:
Hi! I am trying to find the number of records stored in my table within a MS SQL database. This is part of a Console Application. Here is my code: Sub RecordCount() Dim cmd2 As New System.Data.SqlClient.SqlCommand("SELECT COUNT(*) FROM Keyword", conn)
2
2072
by: billsahiker | last post by:
I wrote a test program to help understand asynchronous calls in c#. I have a working VB.NET app that uses a similar technique but I cannot get it to work in c#. The errors I get and the code below. I understand the need for threading when updating UI and the general concept of what is going on but do not understand the two errors.: Error 1 'testwinform.Form1.WorkDoneDelegate()' must declare a body because it is not marked abstract or...
0
9453
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10254
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10099
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10036
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7451
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5354
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5481
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4007
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2849
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.