xsl-list
[Top] [All Lists]

Re: [xsl] Question on XSLT streaming and accumulation of values

2017-10-16 06:06:23

On 16 Oct 2017, at 06:54, Felix Sasaki felix(_at_)sasakiatcf(_dot_)com 
<xsl-list-service(_at_)lists(_dot_)mulberrytech(_dot_)com> wrote:

Thank you very much for your feedback, Michael and Martin.

I have two other questions. First, does it matter wheter accumulator-before() 
or accumulator-after()? I assume not because the metadata values do not 
change before or after processing a given loop2 element.

If the value doesn't change then it doesn't really matter. Use 
accumulator-before() in preference, because the rules are a bit more liberal 
about exactly where it can be used.

Second, I have an additional requirement to process metadata that appears at 
the end of the document:


For each loop2, I want to copy not the values but the whole XML tree of 
document-end-metadata. Currently I am achieving this by doing two streams. 
a) go through the document and gather the document-end-metadata subtree to 
be put into a variable b) process the loop2 elements and add a copy of the 
variable into the loop2 specific output.

Since this requirement means copying a sub tree and not values, I assume 
there is no way to achieve this with accumulators or xsl:iterate, or other 
approaches?


Yes, I think a two-pass approach is the only way around that.

Michael Kay
Saxonica
--~----------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
EasyUnsubscribe: http://lists.mulberrytech.com/unsub/xsl-list/1167547
or by email: xsl-list-unsub(_at_)lists(_dot_)mulberrytech(_dot_)com
--~--
<Prev in Thread] Current Thread [Next in Thread>