cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Oliver Klinger" <oliver.klin...@danet-consult.de>
Subject Please help me with a FP-problem!
Date Wed, 10 Jan 2001 16:54:34 GMT
Hello,

I have two XML-files with the same structure, only one contains a single
item and the other contains many items. One of these many items matches the
single one in the first file. My question is, how to find out, which of
items is the matching item and to open a file-write-connection on this item.


For example:

file1:
<page>
	<item>
		<number>001</number>
		...
	</item>
</page>

file2:
<page>
	<item>
		<number>001</number>
		...
	</item>
	<item>
	...
	</item>
	<item>
	...
	</item>
</page>

The matching criteria is the <number>-tag. I want to write all content from
file1 over the content of file2, when the criteria matches.
So I opened these two files the following way:

<fp:resource id="input">
	<fp:resource-file>file1.xml</fp:resource-file>
	<fp:resource-node>/page/item</fp:resource-node>
</fp:resource>
	
<fp:resource id="output">
	<fp:resource-file>file2.xml</fp:resource-file>
*	<fp:resource-node>/page/item[number=<fp:read select="number"
from="input" as="node"/>]		</fp:resource-node>
	<fp:default-mode>replace</fp:default-mode>
</fp:resource>

The line marked with the '*' seems to have a problem. I don't know why, and
I don't know how to fix it.

Please help me!

Regards,
Oliver

Oliver Klinger
--------------------------------------------
Dipl.-Ing. Univ.
Danet Consult GmbH
Hansastr. 32
80686 M√ľnchen
Tel: +49-89-547096 -44
Fax: +49-89-547079 -99
EMail: klinger@danet-consult.de
-------------------------------------------- 

Mime
View raw message