473,503 Members | 1,797 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

test of following-sibling[2] does not work

Hi,

If sibling # 2 is enumRef, in xsl, I will call enumNameString template.
In my example, xml, it is an enumRef but still the call to enumNameString
is not performed. The otherwise is performed :-)

Any ideas why?

cheers,

//mikael
xml
===

<structMember name="aichTiming">
<description>Timing sensor
</description>
<enumRef name="Aich_Timing">
</enumRef>
</structMember>

xsl
===
<xsl:for-each select="structMember">
<xsl:choose>
<xsl:when test="following-sibling[2][name(.) = 'enumRef']">
<xsl:call-template name="enumNameString">
<xsl:with-param name="enumRefName" select="@name"/>
</xsl:call-template>"</xsl:when>
<xsl:otherwise>
<xsl:text>"</xsl:text><xsl:value-of select="@name"/>"
</xsl:otherwise>
</xsl:choose>
<xsl:if test="not(position()=last())">,</xsl:if>
</xsl:for-each>
Feb 6 '06 #1
1 1364
Hi Mikael,

What you want is not the a sibling of structMember, you want to check
the second child of structMember and for that you should use the child
axes like below. Also the test does not change the context node so
@name will select the structMember name and if you want the
enumRef/@name then you should first get to that node:

<xsl:when test="child::*[2][self::enumRef]">
<xsl:call-template name="enumNameString">
<xsl:with-param name="enumRefName"
select="child::*[2][self::enumRef]/@name"/>
</xsl:call-template>"</xsl:when>

Best Regards,
George
---------------------------------------------------------------------
George Cristian Bina
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com

Feb 6 '06 #2

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

Similar topics

0
2024
by: Remy Blank | last post by:
Ok, here we go. I added the possibility for tests using the unittest.py framework to be skipped. Basically, I added two methods to TestCase: TestCase.skip(msg): skips unconditionally...
0
1885
by: Andrea M. Segovia | last post by:
I just compiled (but did not install) perl 5.8.0 on an SGI Origin 300 server (IP35) running IRIX 6.5.20m. Make test reported one test error, which I narrowed down to .../lib/ExUtils/t/Constant.t...
5
1846
by: Laphan | last post by:
Hi All I know this is a big favour, but I knew I'd get good honest feedback from you. Basically users are saying that I'm having time out problems with a site of mine, but I can't pin it down...
10
23265
by: Randell D. | last post by:
Folks, I have a box that expects numeric input - I'd like to test for it (yeah, I'll have service side checks too but also want client checks). How can I test that my input is numeric - and...
4
9346
by: arotem | last post by:
Hi, I am trying to call an unbound method (PrintInput) with the object instance as the first argument but getting the following error: "TypeError: unbound method PrintInput() must be called with...
5
3529
by: Sakcee | last post by:
Hi I am trying to use pyUnit to create a framework for testing functions I am reading function name, expected output, from a text file. and in python generating dynamic test functions...
6
2610
by: ypjofficial | last post by:
HI, I have following terrific confusion. class test { public: int i; int * j; int **k;
176
8186
by: nw | last post by:
Hi, I previously asked for suggestions on teaching testing in C++. Based on some of the replies I received I decided that best way to proceed would be to teach the students how they might write...
0
2731
by: =?Utf-8?B?bmVlcmFqYkBub2lkYS5ub3NwYW1oY2x0ZWNoLmNv | last post by:
Hi, We have created new .NET web service and running it through the default test page and it's working fine in our development environment. When we moved the web service to the acceptance...
2
2583
by: =?Utf-8?B?c2lwcHl1Y29ubg==?= | last post by:
I was wonder if there is any protocol or suggestions on how to setup unit testing projects in large solution??? If you have a large solution of say 50 projects and add a project for every unit...
0
7199
marktang
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,...
0
7076
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...
0
7323
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...
1
6984
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...
0
5576
agi2029
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,...
1
5005
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...
0
3162
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...
0
3151
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
732
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.