Hi,
This may be a stupid question, but if you count a self axe will it
always return 1?
For example:
count(self::*)
and
count(../../this_path/overhere/self::*)
Any help would be much appreciated. My XSL transformation is doing a
couple of strange things and I am not 100% sure on this. (plus it be
more efficient to put + 1 when required!)
Thanks, Rob. 5 1266
Hi,
Tempore 20:28:59, die Monday 01 August 2005 AD, hinc in foro {comp.text.xml} scripsit <ro************@gmail.com>: This may be a stupid question, but if you count a self axe will it always return 1?
No, not always.
This will only return 1 if the context node is a node which has a qname: i.e. elements and processing instructions. Not all XSLT - implementations follow this though: AltovaXSLT allows attributes as well.
regards,
--
Joris Gillis ( http://users.telenet.be/root-jg/me.html)
Deserta faciunt et innovationem appelant
Thanks!, Rob.
Joris Gillis wrote: Hi, Tempore 20:28:59, die Monday 01 August 2005 AD, hinc in foro {comp.text.xml} scripsit <ro************@gmail.com>:
This may be a stupid question, but if you count a self axe will it always return 1?
No, not always. This will only return 1 if the context node is a node which has a qname: i.e. elements and processing instructions. Not all XSLT - implementations follow this though: AltovaXSLT allows attributes as well.
regards, -- Joris Gillis (http://users.telenet.be/root-jg/me.html) Deserta faciunt et innovationem appelant
In article <11**********************@g44g2000cwa.googlegroups .com>,
<ro************@gmail.com> wrote: This may be a stupid question, but if you count a self axe will it always return 1?
The self axis of a node always contains exactly one node (the node
itself). So count(.../self::node()) will always return 1, if "..."
selects a single node.
self::* on the other hand only matches elements, because the principal
node type for the self axis is element. So if "..." selects a single
element, count(.../self::*) will return 1. If it selects a single
node of some other type, it will return 0.
-- Richard
Thanks, thats really helped to clear it up.
Thanks, Rob
"Joris Gillis" <ro**@pandora.be> wrote in message
news:op***************@news.pandora.be... Hi, Tempore 20:28:59, die Monday 01 August 2005 AD, hinc in foro {comp.text.xml} scripsit <ro************@gmail.com>:
This may be a stupid question, but if you count a self axe will it always return 1? No, not always. This will only return 1 if the context node is a node which has a qname: i.e. elements and processing instructions.
That's not correct.
1) self::* selects the current node only if it is an element.; not if it
is a processing instruction.
If the current node is a processing instruction, then the following
expression (using the "self" axis) selects the current node:
2) self::processing-instruction()
3) Regardless of the type of the node, it is selected by:
self::node()
Cheers,
Dimitre Novatchev
Not all XSLT - implementations follow this though: AltovaXSLT allows attributes as well.
regards, -- Joris Gillis (http://users.telenet.be/root-jg/me.html) Deserta faciunt et innovationem appelant This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Travers Naran |
last post by:
Here's the basic idea. I have a dictionary of substrings (the substrings
stored as keys). I have a list of strings. I want to find out, for each
word in the dictionary, how many times the...
|
by: Victor Engmark |
last post by:
When looking for a method to fetch unique elements and counting the
number of occurences of each of them, I found quite a lot of gross
examples of complex XSL. But after realizing the subtle...
|
by: Vijay |
last post by:
Hi
Can anybody explain what self::* means in Xpath. I understand that
"self" means the context node itself and * means any node type. So I
thought self::* meant all the child nodes of context,...
|
by: David Poundall |
last post by:
I have a thread class and I want to be able to track its usage within
an application. FYI the class launches aplications in their own thread
when the 'launch' method is called.
That works OK
...
|
by: Steven Bethard |
last post by:
I feel like I must be reinventing the wheel here, so I figured I'd post
to see what other people have been doing for this. In general, I love
the optparse interface, but it doesn't do any checks...
| |
by: Dan |
last post by:
Is this discouraged?:
for line in open(filename):
<do something with line>
That is, should I do this instead?:
fileptr = open(filename)
for line in fileptr:
<do something with line>
|
by: Andreas Huesgen |
last post by:
Hello,
I have a question refering python's reference counting/garbage
collection in combination with thrown exceptions.
I'm very new to this mailinglist, so I hope, that this question has not...
|
by: Eric Holbrook |
last post by:
I'm using matplotlib to generate (and save) plots of bandwidth data
from simulation logs. Since the simulations are of varying lengths, i
need a way to scale the axes so that every 100,000 points...
|
by: Mark |
last post by:
Hi all,
I have a scenario where I have a list like this:
User Score
1 0
1 1
1 5
2 3
2 1
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
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...
| |
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...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
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...
|
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 ...
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
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...
| |