Re: conditional cincludes?
How do I check for the instance of a file before attempting to cinclude it? Basically, I don't want the pipeline to die if the file isn't found. If that's the only thing you need, maybe the following use of the cinclude tag might help: cinclude:includexml ignoreErrors=true cinclude:srcfoo/bar.xml/cinclude:src /cinclude:includexml I found it in the documentation (http://cocoon.apache.org/2.1/userdocs/transformers/cinclude-transformer.htm l), but have not tried it myself yet. If there are other criteria for use cinclude or not, you might insert an XSLT-transformer before the CInclude-Transformer. The XSLT might then add the cinclude tags only under certrain conditions. -- Michael - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: conditional cincludes?
You could also use the resource exists action in the included pipeline to include an empty document if the resource is not found. Also, if you are doing this with several documents, you could generate the cinclude elements dynamically based on the presence of the files. For this you could start with the directory generator, or just do it manually in an xsp, etc. HTH, Geoff -Original Message- From: Michael Riedel [mailto:[EMAIL PROTECTED] Sent: Sunday, June 15, 2003 6:42 AM To: [EMAIL PROTECTED] Subject: Re: conditional cincludes? How do I check for the instance of a file before attempting to cinclude it? Basically, I don't want the pipeline to die if the file isn't found. If that's the only thing you need, maybe the following use of the cinclude tag might help: cinclude:includexml ignoreErrors=true cinclude:srcfoo/bar.xml/cinclude:src /cinclude:includexml I found it in the documentation (http://cocoon.apache.org/2.1/userdocs/transformers/cinclude-trans former.htm l), but have not tried it myself yet. If there are other criteria for use cinclude or not, you might insert an XSLT-transformer before the CInclude-Transformer. The XSLT might then add the cinclude tags only under certrain conditions. -- Michael - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
conditional cincludes?
Title: conditional cincludes? How do I check for the instance of a file before attempting to cinclude it? Basically, I don't want the pipeline to die if the file isn't found. Thanks, Luke.
Re: conditional cincludes?
Hello Luke, you can either use the DirectoryGenerator or the new implementation of XInclude in Cocoon 2.1 having a fallback element. Joerg Luke Penca wrote: How do I check for the instance of a file before attempting to cinclude it? Basically, I don't want the pipeline to die if the file isn't found. Thanks, Luke. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: conditional cincludes?
Or cinclude another pipeline match to return a XML dummy file cinclude src=cocoon:/maybeexists/foo.xml/ map:match pattern=maybeexists/** map:act type=resource-exists src={1} map:generate type=file src={../1}/ map:serialize type=xml/ /map:act map:generate type=file src=notfound.xml/ map:serialize type=xml/ /map:match HTH, Alfred (preferring cinclude over xinclude). -Original Message- From: Joerg Heinicke [mailto:[EMAIL PROTECTED] Sent: Dienstag, 10. Juni 2003 22:23 To: [EMAIL PROTECTED] Subject: Re: conditional cincludes? Hello Luke, you can either use the DirectoryGenerator or the new implementation of XInclude in Cocoon 2.1 having a fallback element. Joerg Luke Penca wrote: How do I check for the instance of a file before attempting to cinclude it? Basically, I don't want the pipeline to die if the file isn't found. Thanks, Luke. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This message is for the named person's use only. It may contain confidential, proprietary or legally privileged information. No confidentiality or privilege is waived or lost by any mistransmission. If you receive this message in error, please notify the sender urgently and then immediately delete the message and any copies of it from your system. Please also immediately destroy any hardcopies of the message. You must not, directly or indirectly, use, disclose, distribute, print, or copy any part of this message if you are not the intended recipient. The sender's company reserves the right to monitor all e-mail communications through their networks. Any views expressed in this message are those of the individual sender, except where the message states otherwise and the sender is authorised to state them to be the views of the sender's company. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]