> Just a gentle reminder... despite its esoteric title, it's asking > serious questions :-) ...
The mail was long and looked scary ;-)
>>I am creating an action to reload a XML dump of my eXist database >>and that raises several questions showing that the behaviour of the >>pipes called from an action isn't as straightforward as I had >>thought. >> >>The bizdoc example shows several cases of such pipes without output >>that lead to database operations and the database processors seem to >>act as sinks that pull the input of pipes even when they don't have >>any output, such as in:
[...]
>>the identity processor is never executed. That's logical and the >>result of a good optimisation since the output of the identity >>processor is never used. >> >>Is the difference of behaviour only because the oxf:xmldb-delete has >>no output while the oxf:identity processor is it a special property >>of the oxf:xmldb-delete processor to act as a sink?
Yes. Processors may or may not have outputs, and there is a difference of behavior between a processor that exposes an output if that output is never called, and a processor that does not expose an output.
In the first category, your identity processor which exposes a "data" output which is never called.
In the second category, the xmldb-delete processor which does not expose an output at all.
Without this:
1. As you say, we wouldn't be able to optimize and all processors should be executed.
2. Or, we wouldn't be able to have processors that do not have outputs, which would prevent implementing something like xmldb-delete.
>>My database dumps are RDF documents in which I'd like to split each >>top level element in a separate document in the eXist database >>(embedded in its own rdf root element to make it snippet a valid RDF >>document). >> >>The p:for-each loop seems to be the right tool to do so. >> >>Unfortunately, the for-each has a mandatory output that I need to >>declare even if the branches of the for-each are oxf:xmldb-insert >>that have no output.
If I remember well, the for-each's id or ref attribute is optional. You should be able to just omit it.
>>As a result of that, the for-each loop isn't considered as a sink >>and isn't executed when the action is called.
Correct, this is what will happen if you do declare an id or ref attribute.
>>The workaround I have found for that is to create a fake result that >>I remove with an XPointer expression before generating the output:
[...]
>>That's working, but this is neither elegant, readable nor (probably) >>efficient. >> >>Is there a simpler way of doing that?
You could also simply use the null-serializer processor, which just consumes data and does nothing with it. But you shouldn't have to do this in this particular case.
>>Would it solve the problem if the id attribute of p:for-each was made >>optional and the for-each considered as a sink when the attribute >>missing?
Yes :-) If it doesn't work in 2.7, it's a bug.
-Erik
------------------------------------------------------- This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting Tool for open source databases. Create drag-&-drop reports. Save time by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc. Download a FREE copy at http://www.intelliview.com/go/osdn_nl _______________________________________________ orbeon-user mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/orbeon-user
