RE: [xsl] preceding-sibling

Subject: RE: [xsl] preceding-sibling
From: "Borca, Olivier" <Olivier.Borca@xxxxxxxxxxxxxxxx>
Date: Tue, 13 Mar 2001 15:04:50 +0100
ok I finally found it, it was a problem of namespace, 
the right line was that one :

<xsl:when test="@type =

preceding-sibling::xd:element and not preceding-sibling::element ...
Sorry for spamming the list, I should have found this alone before ...

-----Original Message-----
From: Borca, Olivier 
Sent: Tuesday, March 13, 2001 2:54 PM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: RE: [xsl] preceding-sibling

and of course you read <xsl:when test="@type =
and not <xsl:when test="@type =
concat(preceding-sibling::element[1]/@type,'ValueMap')"> ...
sorry ;)

-----Original Message-----
From: Borca, Olivier 
Sent: Tuesday, March 13, 2001 2:28 PM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: RE: [xsl] preceding-sibling

ok let's be more precise then :)
if I create an element with the name :
I have an object created which name is ... "foo" ! ;)
The 'preceding-sibling::element[position()=1]/@type' doesnt give me any

And I am using Xalan parser.
Btw, thx a lot to all of you who help me !

The input document is the following (excerpt):

<ElementType name="CIM_ActiveConnection" content="eltOnly">
	<AttributeType name="SUPERCLASS" required="yes"/>
	<attribute type="SUPERCLASS"/>
	<group order="seq">
		<element type="IsUnidirectional"/>
		<element type="OtherTrafficDescription"/>
		<element type="TrafficType"/>
		<element type="TrafficTypeValueMap"/>
		<element type="CIM_ProtocolEndpointAntecedent"/>
		<element type="CIM_ProtocolEndpointDependent"/>

What I want to do is when I parse an element which name is the name of
the preceding element concatenated to "ValueMap", I have have a special
formatting of data. In this example, the test would answer true for
"TrafficTypeValueMap" because its preceding element is "TrafficType".
I don't know if it's clear but ... this is what I use in my XSL:

<xsl:template match="xd:element">
		<xsl:attribute name="type">
			<xsl:value-of select="@type" />

				<xsl:attribute name="sql:field">
					<xsl:value-of select="@type" />


--->					<xsl:when test="@type =
<xsl:value-of select="../../@name" />
<xsl:value-of select="preceding-sibling::element[position()=1]/@type" />
name="foreign-relation"><xsl:value-of select="@type" /></xsl:attribute>

If you have any idea ...

-----Original Message-----
From: David Carlisle [mailto:davidc@xxxxxxxxx]
Sent: Tuesday, March 13, 2001 2:07 PM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: Re: [xsl] preceding-sibling

> In fact the "preceding-sibling::element[position()=1]" doesnt work at
> all .. 

Go on, give us a clue:-)

what's the input look like, what is the context node when you evaluate
this expression. When you say "it doesn't work" do you mean you get th
ewrong thing? you get nothing? you get an error?


This message has been checked for all known viruses by Star Internet
through the MessageLabs Virus Control Centre. For further information

 XSL-List info and archive:

 XSL-List info and archive:

 XSL-List info and archive:

 XSL-List info and archive:

Current Thread