cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Isidro Vila Verde" <...@serprest.pt>
Subject Xpath expression with a variable predicate in binding cforms
Date Sat, 01 May 2004 18:45:43 GMT
Sorry if this is a FAQ, but I am in my first steps into cocoon and cforms
and all (almost) is new to me.
 
I have this XML data 

<root>
<hab tipo="QD" quant="2"/>
<hab tipo="QS" quant="3"/>
<precos>
  <elem hab="QD" val="30" unit="Euro"/>
  <elem hab="QS" val="25" unit="Euro"/>
</precos>
</root>

That I wanto to bind with something like this

	<fb:repeater id="hab" parent-path="." row-path="hab">
		<fb:identity>
			<fb:value id="id" path="@id"></fb:value>
		</fb:identity>
		<fb:on-bind>
			<fb:value id="tipo" path="@tipo"/>
			<fb:value id="n" path="@quant">
				<fd:convertor datatype="integer"/>
			</fb:value>
			<fb:value id="preco"
path="../precos/elem[@hab=VARIABLE]/@val">
				<fd:convertor datatype="integer"/>
			</fb:value>
		</fb:on-bind>
	</fb:repeater>

Where VARIABLE must be the value of @tipo from current node (hab).
How can I do this. Are there any possibility to refer to value o 'tipo'?
Something like we do with xsl:variable in XSL?

Thanks in advance.
 
Isidro Vila Verde
email:jvv@serprest.pt
web: http://serprest.pt/
tel: 223743701
tel: 969103006 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.672 / Virus Database: 434 - Release Date: 28-04-2004
 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message