- From: Jeni Tennison <jeni@jenitennison.com>
- Date: Fri, 10 Nov 2006 13:53:47 +0000
- To: public-xml-processing-model-wg@w3.org
Hi, Alex Milowski wrote: > Norman Walsh wrote: >> / Alex Milowski <alex@milowski.org> was heard to say: >> | I'm not certain we have a good way to do this because a viewport >> | always requires an output for the replacement. >> | >> | Any ideas how we might solve this? >> >> With an p:empty component that takes no inputs and returns an empty >> document sequence? > > I thought about that... but we don't say how empty sequences are > handled. > > I suppose we could say that a viewport's replacement must either > be a singleton sequence or an empty sequence. An empty sequence > has the effect of deleting the matching subtree. I was assuming that we'd allow an empty <p:output> if we wanted the output to be bound to an empty sequence. Note that this is required within <p:when>/<p:otherwise> as well, for situations where the <p:choose> is effectively splitting a sequence of documents onto two output ports. <p:choose step="previous" source="result"> <p:when test="/foo"> <p:output port="foos" step="previous" source="result" /> <p:output port="bars" /> </p:when> <p:otherwise> <p:output port="foos" /> <p:output port="bars" step="previous" source="result" /> </p:otherwise> </p:choose> I was also assuming that a viewport's replacement could be a sequence of documents, in which case the original element is replaced by the concatenation of that sequence. This makes it easy to use viewport to insert elements into a document. I agree with Henry that we need a 'delete' built-in component as well. Cheers, Jeni -- Jeni Tennison http://www.jenitennison.com
Received on Friday, 10 November 2006 13:54:00 UTC